Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-08-01 03:57:59 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-08-01 03:57:59 (GMT)
commitdc921a23879e2f42dbef688e45c4878670c72369 (patch)
tree1abed4900b2521fca78d2e88a392ecfc803fc3ee /extensions
parentd3a1c85bcc7e97982399cf7e69e5e374c8180bfe (diff)
Fix pep8 warnings
Diffstat (limited to 'extensions')
-rwxr-xr-xextensions/cpsection/updater/model.py21
-rw-r--r--extensions/cpsection/updater/view.py25
2 files changed, 25 insertions, 21 deletions
diff --git a/extensions/cpsection/updater/model.py b/extensions/cpsection/updater/model.py
index 939b330..bb63134 100755
--- a/extensions/cpsection/updater/model.py
+++ b/extensions/cpsection/updater/model.py
@@ -118,14 +118,14 @@ class UpdateList(gtk.ListStore):
logging.debug('Looking for %s' % row[BUNDLE].get_name())
try:
- new_version, new_url, new_size = aslo.fetch_update_info(row[BUNDLE])
+ new_ver, new_url, new_size = aslo.fetch_update_info(row[BUNDLE])
except Exception, e:
logging.warning('Failure %s updating: %s' % \
(row[BUNDLE].get_name(), e))
return False
row[CURRENT_VERSION] = row[BUNDLE].get_activity_version()
- row[UPDATE_VERSION] = long(new_version)
+ row[UPDATE_VERSION] = long(new_ver)
if row[CURRENT_VERSION] >= row[UPDATE_VERSION]:
logging.debug('Skip %s update' % row[BUNDLE].get_name())
@@ -139,9 +139,9 @@ class UpdateList(gtk.ListStore):
row[UPDATE_SIZE] = new_size
row[DESCRIPTION] = \
_('From version %(current)d to %(new)s (Size: %(size)s)') % \
- { 'current' : row[CURRENT_VERSION],
- 'new' : row[UPDATE_VERSION],
- 'size' :_humanize_size(row[UPDATE_SIZE]) }
+ {'current': row[CURRENT_VERSION],
+ 'new': row[UPDATE_VERSION],
+ 'size': _humanize_size(row[UPDATE_SIZE])}
row[UPDATE_SELECTED] = True
return True
@@ -218,15 +218,16 @@ class UpdateList(gtk.ListStore):
def updates_selected(self):
"""Return the number of updates selected."""
- return self._sum_rows(lambda r: 1 if
- r[UPDATE_AVAILABLE] and r[UPDATE_SELECTED] else 0)
+ return self._sum_rows(lambda r:
+ 1 if r[UPDATE_AVAILABLE] and r[UPDATE_SELECTED] else 0)
def updates_size(self):
"""Returns the size (in bytes) of the selected updates available.
Updated by `refresh`."""
- return self._sum_rows(lambda r: r[UPDATE_SIZE] if
- r[UPDATE_AVAILABLE] and r[UPDATE_SELECTED] else 0)
+ return self._sum_rows(lambda r:
+ r[UPDATE_SIZE] if r[UPDATE_AVAILABLE] and \
+ r[UPDATE_SELECTED] else 0)
def is_valid(self):
"""The UpdateList is invalidated before it is refreshed, and when
the group information is modified without refreshing."""
@@ -277,4 +278,4 @@ def _main():
update_list.install_updates()
if __name__ == '__main__':
- _main ()
+ _main()
diff --git a/extensions/cpsection/updater/view.py b/extensions/cpsection/updater/view.py
index d02c972..41380c6 100644
--- a/extensions/cpsection/updater/view.py
+++ b/extensions/cpsection/updater/view.py
@@ -103,7 +103,7 @@ class ActivityUpdater(SectionView):
self.top_label.set_markup('<big>%s</big>' % _e(header))
self.bundle_pane.refresh_update_size()
- def install_cb(self, widget, event, data=None):
+ def __install_clicked_cb(self, widget, event, data=None):
"""Invoked when the 'ok' button is clicked."""
self.top_label.set_markup('<big>%s</big>' %
_('Installing updates...'))
@@ -160,10 +160,13 @@ class BundlePane(gtk.VBox):
self.check_button = gtk.Button(stock=gtk.STOCK_REFRESH)
self.check_button.connect('clicked', update_activity.refresh_cb, self)
button_box.pack_start(self.check_button, expand=False)
+
self.install_button = _make_button(_("Install selected"),
- name='emblem-downloads')
- self.install_button.connect('clicked', update_activity.install_cb, self)
+ name='emblem-downloads')
+ self.install_button.connect('clicked',
+ update_activity.__install_clicked_cb, self)
button_box.pack_start(self.install_button, expand=False)
+
def is_valid_cb(bundle_list, __):
self.install_button.set_sensitive(bundle_list.is_valid())
update_activity.bundle_list.connect('notify::is-valid', is_valid_cb)
@@ -178,9 +181,9 @@ class BundlePane(gtk.VBox):
def switch(self):
"""Make the bundle list visible and the progress pane invisible."""
- for widget, v in [ (self, True),
- (self.updater_activity.progress_pane, False)]:# ,
- #(self.activity_updater.expander, False)]:
+ for widget, v in [(self, True),
+ (self.updater_activity.progress_pane, False)]:# ,
+ #(self.activity_updater.expander, False)]:
widget.set_property('visible', v)
class BundleListView(gtk.ScrolledWindow):
@@ -363,12 +366,12 @@ class ProgressPane(gtk.VBox):
"""Make the progress pane visible and the activity pane invisible."""
self.update_activity.bundle_pane.set_property('visible', False)
self.set_property('visible', True)
- for widget, v in [ (self.progress, show_bar),
- (self.cancel_button, show_cancel),
- (self.refresh_button,
+ for widget, v in [(self.progress, show_bar),
+ (self.cancel_button, show_cancel),
+ (self.refresh_button,
not show_cancel and not show_try_again),
- (self.try_again_button, show_try_again),
- #(self.update_activity.expander, False)
+ (self.try_again_button, show_try_again),
+ #(self.update_activity.expander, False)
]:
widget.set_property('visible', v)
self.cancel_button.set_sensitive(True)