=== modified file 'UpdateManager/UpdateManager.py' --- UpdateManager/UpdateManager.py 2011-03-09 09:24:58 +0000 +++ UpdateManager/UpdateManager.py 2011-04-03 12:15:16 +0000 @@ -568,9 +568,9 @@ self.hbox_downsize.show() self.vbox_alerts.show() - def _get_last_apt_get_update_hours(self): + def _get_last_apt_get_update_minutes(self): """ - Return the number of hours since the last successful apt-get update + Return the number of minutes since the last successful apt-get update If the date is unknown, return "None" """ @@ -579,19 +579,20 @@ # calculate when the last apt-get update (or similar operation) # was performed mtime = os.stat("/var/lib/apt/periodic/update-success-stamp")[stat.ST_MTIME] - ago_hours = int((time.time() - mtime) / (60*60) ) - return ago_hours + ago_minutes = int((time.time() - mtime) / 60 ) + return ago_minutes def _get_last_apt_get_update_text(self): """ return a human readable string with the information when the last apt-get update was run """ - ago_hours = self._get_last_apt_get_update_hours() - if ago_hours is None: + ago_minutes = self._get_last_apt_get_update_minutes() + if ago_minutes is None: return _("It is unknown when the package information was " "updated last. Please try clicking on the 'Check' " "button to update the information.") + ago_hours = int( ago_minutes / 60 ) ago_days = int( ago_hours / 24 ) if ago_days > self.NO_UPDATE_WARNING_DAYS: return _("The package information was last updated %(days_ago)s " @@ -606,8 +607,14 @@ return ngettext("The package information was last updated %(hours_ago)s hour ago.", "The package information was last updated %(hours_ago)s hours ago.", ago_hours) % { "hours_ago" : ago_hours, } + elif ago_minutes >= 45: + return _("The package information was last updated about 45 minutes ago.") + elif ago_minutes >= 30: + return _("The package information was last updated about half an hour ago.") + elif ago_minutes >= 15: + return _("The package information was last updated about 15 minutes ago.") else: - return _("The package information was last updated less than one hour ago.") + return _("The package information was just updated.") return None def update_last_updated_text(self): @@ -640,7 +647,7 @@ self.textview_descr.get_buffer().set_text("") if self._get_last_apt_get_update_text() is not None: text_label_main = self._get_last_apt_get_update_text() - if self._get_last_apt_get_update_hours() > self.NO_UPDATE_WARNING_DAYS*24: + if int(self._get_last_apt_get_update_minutes() / 60) > self.NO_UPDATE_WARNING_DAYS*24: text_header = "%s" % _("Software updates may be available for your computer.") # add timer to ensure we update the information when the # last package count update was performed