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
1=== modified file 'UpdateManager/UpdateManager.py'
2--- UpdateManager/UpdateManager.py 2010-10-08 13:21:13 +0000
3+++ UpdateManager/UpdateManager.py 2010-10-28 07:01:12 +0000
4@@ -523,16 +523,20 @@
5 mtime = os.stat("/var/lib/apt/periodic/update-success-stamp")[stat.ST_MTIME]
6 ago_days = int( (time.time() - mtime) / (24*60*60))
7 ago_hours = int((time.time() - mtime) / (60*60) )
8- if ago_days > 0:
9- return ngettext("The package information was last updated %(days_ago)s day ago.",
10+ if ago_days > 7:
11+ return [ngettext("The package information was last updated %(days_ago)s day ago. \n Press the 'Check' button below to check for software updates.",
12+ "The package information was last updated %(days_ago)s days ago. \n Press the 'Check' button below to check for software updates.",
13+ ago_days) % { "days_ago" : ago_days, } , True]
14+ elif ago_days > 0:
15+ return [ngettext("The package information was last updated %(days_ago)s day ago.",
16 "The package information was last updated %(days_ago)s days ago.",
17- ago_days) % { "days_ago" : ago_days, }
18+ ago_days) % { "days_ago" : ago_days, } , False]
19 elif ago_hours > 0:
20- return ngettext("The package information was last updated %(hours_ago)s hour ago.",
21+ return [ngettext("The package information was last updated %(hours_ago)s hour ago.",
22 "The package information was last updated %(hours_ago)s hours ago.",
23- ago_hours) % { "hours_ago" : ago_hours, }
24+ ago_hours) % { "hours_ago" : ago_hours, } , False]
25 else:
26- return _("The package information was last updated less than one hour ago.")
27+ return [_("The package information was last updated less than one hour ago.") , False]
28 return None
29
30 def update_last_updated_text(self):
31@@ -541,7 +545,7 @@
32 num_updates = self.cache.installCount
33 if num_updates == 0:
34 if self._get_last_apt_get_update_text() is not None:
35- text_label_main = self._get_last_apt_get_update_text()
36+ text_label_main = self._get_last_apt_get_update_text()[0]
37 self.label_main_details.set_text(text_label_main)
38 return True
39 # stop the timer if there are upgrades now
40@@ -564,7 +568,9 @@
41 self.textview_changes.get_buffer().set_text("")
42 self.textview_descr.get_buffer().set_text("")
43 if self._get_last_apt_get_update_text() is not None:
44- text_label_main = self._get_last_apt_get_update_text()
45+ text_label_main = self._get_last_apt_get_update_text()[0]
46+ if self._get_last_apt_get_update_text()[1] == True:
47+ text_header = "<big><b>%s</b></big>" % _("Software updates may be available for your computer.")
48 # add timer to ensure we update the information when the
49 # last package count update was performed
50 glib.timeout_add_seconds(10, self.update_last_updated_text)

Subscribers

People subscribed via source and target branches

to status/vote changes: