[Dextrose] [PATCH] Fix for bugs sl#2822 and au#383.

Ajay Garg ajaygargnsit at gmail.com
Fri Sep 9 08:21:50 EDT 2011


1. Now, only 'upgrade-activities' are selected by default during
Software-Update.

2. Fixed some format-specifier issues.

Signed-off-by: Ajay Garg <ajay at sugarlabs.org>
---
 extensions/cpsection/updater/model.py |    4 ++--
 extensions/cpsection/updater/view.py  |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/extensions/cpsection/updater/model.py b/extensions/cpsection/updater/model.py
index d7fd528..39d0b1f 100755
--- a/extensions/cpsection/updater/model.py
+++ b/extensions/cpsection/updater/model.py
@@ -106,8 +106,8 @@ class UpdateModel(gobject.GObject):
         else:
             for bundle_id, info in new_bundles.items():
                 if bundle_id in self._current_bundles:
-                    if new_bundles[bundle_id]['version'] >\
-                        self._current_bundles[bundle_id]['version']:
+                    if int(new_bundles[bundle_id]['version']) >\
+                        int(self._current_bundles[bundle_id]['version']):
                         self.updates.append(BundleUpdate(
                             self._current_bundles[bundle_id]['bundle'],
                             new_bundles[bundle_id]['version'],
diff --git a/extensions/cpsection/updater/view.py b/extensions/cpsection/updater/view.py
index 30875e4..d257b56 100644
--- a/extensions/cpsection/updater/view.py
+++ b/extensions/cpsection/updater/view.py
@@ -358,16 +358,17 @@ class UpdateListModel(gtk.ListStore):
         for bundle_update in model.updates:
             row = [None] * 5
             row[self.BUNDLE_ID] = bundle_update.bundle.get_bundle_id()
-            row[self.SELECTED] = True
             row[self.ICON_FILE_NAME] = bundle_update.bundle.get_icon()
 
             if bundle_update.package_type == 'update':
-                details = _('From version %(current)d to %(new)s (Size: %(size)s)')
+                row[self.SELECTED] = True
+                details = _('From version %(current)s to %(new)s (Size: %(size)s)')
                 details = details % \
                         {'current': bundle_update.bundle.get_activity_version(),
                          'new': bundle_update.version,
                          'size': _format_size(bundle_update.size)}
             elif bundle_update.package_type == 'new':
+                row[self.SELECTED] = False
                 details = _('Install new activity version %(new)s (Size: %(size)s)')
                 details = details % \
                         {'new': bundle_update.version,
-- 
1.7.4.4



More information about the Dextrose mailing list