diff options
author | Ajay Garg <ajay@activitycentral.com> | 2012-10-16 10:59:07 (GMT) |
---|---|---|
committer | Ajay Garg <ajay@activitycentral.com> | 2012-10-16 10:59:07 (GMT) |
commit | ba170d8ab871c4ea53357d0da8cbb9fdaadb131e (patch) | |
tree | 2c25fbbcb5457fae87a99b32a6ab4941d7bd7c32 | |
parent | 9b2732880a0a1a0d91091def4b85f1a0db9f6635 (diff) |
Revert "Last-Updated field in "My Settings" -> "About My Computer"."
This section code-refactoring (to avoid headaches_; and also made gconf-controllable
This reverts commit f41468507d1e814839c4a81dd001066bc2cf0a6b.
-rw-r--r-- | extensions/cpsection/aboutcomputer/model.py | 53 | ||||
-rw-r--r-- | extensions/cpsection/aboutcomputer/view.py | 22 |
2 files changed, 0 insertions, 75 deletions
diff --git a/extensions/cpsection/aboutcomputer/model.py b/extensions/cpsection/aboutcomputer/model.py index 59bae00..86d2e3f 100644 --- a/extensions/cpsection/aboutcomputer/model.py +++ b/extensions/cpsection/aboutcomputer/model.py @@ -226,56 +226,3 @@ def get_license(): except IOError: license_text = _not_available return license_text - - -def get_last_updated_on_field(): - - # Get the number of UNIX seconds of the last update date. - last_update_unix_seconds = {} - try: - 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_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. - # Using python-subprocess-module (no shell involved), to convert - # it into readable date-format; the hack being used (after - # removing '-u' option) is the first one mentioned at : - # http://www.commandlinefu.com/commands/view/3719/convert-unix-timestamp-to-date - environment = os.environ.copy() - environment['PATH'] = '%s:/usr/sbin' % (environment['PATH'], ) - - last_update_readable_format = {} - try: - last_update_readable_format = \ - subprocess.Popen(['date', '-d', - '1970-01-01 + ' + - str(last_update_unix_seconds) + - ' seconds'], - stdout=subprocess.PIPE, - env=environment).stdout.readlines()[0] - except: - msg_str = _('Information not available.') - _logger.exception(msg_str) - return msg_str - - if not last_update_readable_format: - return _('Information not available.') - - # Everything should be fine (hopefully :-) ) - return last_update_readable_format diff --git a/extensions/cpsection/aboutcomputer/view.py b/extensions/cpsection/aboutcomputer/view.py index ac0b531..f44ca51 100644 --- a/extensions/cpsection/aboutcomputer/view.py +++ b/extensions/cpsection/aboutcomputer/view.py @@ -157,28 +157,6 @@ class AboutComputer(SectionView): box_software.pack_start(box_wireless_fw, False, True, 0) box_wireless_fw.show() - # Try to fetch "Last Updated On" field from the model. - # If the field is not empty, display it. - # At present, the field is returned empty, only if "root-access" - # is disabled on the target-machine. - last_updated_on_field = self._model.get_last_updated_on_field() - if last_updated_on_field: - box_last_updated_on = Gtk.HBox(spacing=style.DEFAULT_SPACING) - label_last_updated_on = Gtk.Label(_('Last Updated On:')) - label_last_updated_on.set_alignment(1, 0) - label_last_updated_on.modify_fg(Gtk.StateType.NORMAL, - style.COLOR_SELECTION_GREY.get_gdk_color()) - box_last_updated_on.pack_start(label_last_updated_on, False, True, 0) - self._group.add_widget(label_last_updated_on) - label_last_updated_on.show() - label_last_updated_on_field = \ - Gtk.Label(last_updated_on_field) - label_last_updated_on_field.set_alignment(0, 0) - box_last_updated_on.pack_start(label_last_updated_on_field, False, True, 0) - label_last_updated_on_field.show() - box_software.pack_start(box_last_updated_on, False, True, 0) - box_last_updated_on.show() - self._vbox.pack_start(box_software, False, True, 0) box_software.show() |