1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
From f0abf7d5cd3444e2e26af5cc428e19f9c42954e9 Mon Sep 17 00:00:00 2001
From: Ajay Garg <ajay@activitycentral.com>
Date: Thu, 23 Aug 2012 21:47:35 +0530
Subject: [sugar PATCH] au#1563, au#1615: (i)
Remove the dependency upon "sugar-client".
(ii)
In case no updates have taken place, provide a
NOT-UPDATED message, instead of the default
OLPC epoch date.
Organization: Sugar Labs Foundation
Signed-off-by: Ajay Garg <ajay@activitycentral.com>
---
extensions/cpsection/aboutcomputer/model.py | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/extensions/cpsection/aboutcomputer/model.py b/extensions/cpsection/aboutcomputer/model.py
index 4510af6..c85e00e 100644
--- a/extensions/cpsection/aboutcomputer/model.py
+++ b/extensions/cpsection/aboutcomputer/model.py
@@ -262,26 +262,22 @@ def get_last_updated_on_field():
# Get the number of UNIX seconds of the last update date.
last_update_unix_seconds = {}
try:
- SERVICE_NAME = 'org.sugarlabs.client.System'
- SERVICE_PATH = '/org/sugarlabs/client/System'
- SERVICE_INTERFACE = 'org.sugarlabs.client.System'
-
- bus_class = dbus.SystemBus()
- system_obj = bus_class.get_object(SERVICE_NAME, SERVICE_PATH)
- system_iface = dbus.Interface(system_obj, SERVICE_INTERFACE)
- system_props = dbus.Interface(system_iface,
- dbus.PROPERTIES_IFACE)
- last_update_unix_seconds = system_props.Get(SERVICE_INTERFACE,
- 'LastUpdate')
+ last_update_unix_seconds = int(os.stat('/var/lib/rpm/Packages').st_mtime)
except:
msg_str = _('Information not available.')
_logger.exception(msg_str)
return msg_str
+
+ NO_UPDATE_MESSAGE = _('No update yet!')
+
# Check once again that 'last_update_unix_seconds' is not empty.
# You never know !
if not last_update_unix_seconds:
- return _('No update yet!')
+ return NO_UPDATE_MESSAGE
+
+ if int(last_update_unix_seconds) == 1194004800:
+ return NO_UPDATE_MESSAGE
# If we reached here, we have the last-update-time, but it's in
# timestamp format.
--
1.7.4.4
|