Merge lp:~bilalakhtar/update-manager/fix-35009 into lp:update-manager

Proposed by Bilal Akhtar
Status: Merged
Merge reported by: Michael Vogt
Merged at revision: not available
Proposed branch: lp:~bilalakhtar/update-manager/fix-35009
Merge into: lp:update-manager
Diff against target: 50 lines (+14/-8)
1 file modified
UpdateManager/UpdateManager.py (+14/-8)
To merge this branch: bzr merge lp:~bilalakhtar/update-manager/fix-35009
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team Pending
Review via email: mp+39495@code.launchpad.net

Description of the change

This branch fixes bug #35009 .

To post a comment you must log in.
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

This branch displays 'Software updates may be available for your computer' when apt-get update hasn't been run for 7 days or more. It also displays below 'The package information was last updated X days ago. Press the 'Check' button below to check for software updates.'

Revision history for this message
Michael Vogt (mvo) wrote :

Merged into trunk with minor modifications.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'UpdateManager/UpdateManager.py'
--- UpdateManager/UpdateManager.py 2010-10-08 13:21:13 +0000
+++ UpdateManager/UpdateManager.py 2010-10-28 07:01:12 +0000
@@ -523,16 +523,20 @@
523 mtime = os.stat("/var/lib/apt/periodic/update-success-stamp")[stat.ST_MTIME]523 mtime = os.stat("/var/lib/apt/periodic/update-success-stamp")[stat.ST_MTIME]
524 ago_days = int( (time.time() - mtime) / (24*60*60))524 ago_days = int( (time.time() - mtime) / (24*60*60))
525 ago_hours = int((time.time() - mtime) / (60*60) )525 ago_hours = int((time.time() - mtime) / (60*60) )
526 if ago_days > 0:526 if ago_days > 7:
527 return ngettext("The package information was last updated %(days_ago)s day ago.",527 return [ngettext("The package information was last updated %(days_ago)s day ago. \n Press the 'Check' button below to check for software updates.",
528 "The package information was last updated %(days_ago)s days ago. \n Press the 'Check' button below to check for software updates.",
529 ago_days) % { "days_ago" : ago_days, } , True]
530 elif ago_days > 0:
531 return [ngettext("The package information was last updated %(days_ago)s day ago.",
528 "The package information was last updated %(days_ago)s days ago.",532 "The package information was last updated %(days_ago)s days ago.",
529 ago_days) % { "days_ago" : ago_days, }533 ago_days) % { "days_ago" : ago_days, } , False]
530 elif ago_hours > 0:534 elif ago_hours > 0:
531 return ngettext("The package information was last updated %(hours_ago)s hour ago.",535 return [ngettext("The package information was last updated %(hours_ago)s hour ago.",
532 "The package information was last updated %(hours_ago)s hours ago.",536 "The package information was last updated %(hours_ago)s hours ago.",
533 ago_hours) % { "hours_ago" : ago_hours, }537 ago_hours) % { "hours_ago" : ago_hours, } , False]
534 else:538 else:
535 return _("The package information was last updated less than one hour ago.")539 return [_("The package information was last updated less than one hour ago.") , False]
536 return None540 return None
537541
538 def update_last_updated_text(self):542 def update_last_updated_text(self):
@@ -541,7 +545,7 @@
541 num_updates = self.cache.installCount545 num_updates = self.cache.installCount
542 if num_updates == 0:546 if num_updates == 0:
543 if self._get_last_apt_get_update_text() is not None:547 if self._get_last_apt_get_update_text() is not None:
544 text_label_main = self._get_last_apt_get_update_text()548 text_label_main = self._get_last_apt_get_update_text()[0]
545 self.label_main_details.set_text(text_label_main)549 self.label_main_details.set_text(text_label_main)
546 return True550 return True
547 # stop the timer if there are upgrades now551 # stop the timer if there are upgrades now
@@ -564,7 +568,9 @@
564 self.textview_changes.get_buffer().set_text("")568 self.textview_changes.get_buffer().set_text("")
565 self.textview_descr.get_buffer().set_text("")569 self.textview_descr.get_buffer().set_text("")
566 if self._get_last_apt_get_update_text() is not None:570 if self._get_last_apt_get_update_text() is not None:
567 text_label_main = self._get_last_apt_get_update_text()571 text_label_main = self._get_last_apt_get_update_text()[0]
572 if self._get_last_apt_get_update_text()[1] == True:
573 text_header = "<big><b>%s</b></big>" % _("Software updates may be available for your computer.")
568 # add timer to ensure we update the information when the 574 # add timer to ensure we update the information when the
569 # last package count update was performed575 # last package count update was performed
570 glib.timeout_add_seconds(10, self.update_last_updated_text)576 glib.timeout_add_seconds(10, self.update_last_updated_text)

Subscribers

People subscribed via source and target branches

to status/vote changes: