[Sugar-devel] [PATCH sugar] Simplify the definition of UpdateModel._bundles_to_check().

Sascha Silbe sascha-pgp at silbe.org
Fri Jan 21 10:32:06 EST 2011


From: Michael Stone <michael at laptop.org>

The only purposes of the list comprehension in UpdateModel.check_updates() is
to set self._bundles_to_check to a list containing the elements returned by
bundleregistry.get_registry(). This purpose can be more succinctly achieved by
means of the list() constructor.

Signed-off-by: Michael Stone <michael at laptop.org>
[rebased on mainline/master]
Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
Reviewed-By: Sascha Silbe <sascha-pgp at silbe.org>
---
 extensions/cpsection/updater/model.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/extensions/cpsection/updater/model.py b/extensions/cpsection/updater/model.py
index 896c17f..7ea445f 100755
--- a/extensions/cpsection/updater/model.py
+++ b/extensions/cpsection/updater/model.py
@@ -65,8 +65,7 @@ class UpdateModel(gobject.GObject):
 
     def check_updates(self):
         self.updates = []
-        self._bundles_to_check = \
-                [bundle for bundle in bundleregistry.get_registry()]
+        self._bundles_to_check = list(bundleregistry.get_registry())
         self._check_next_update()
 
     def _check_next_update(self):
-- 
1.7.2.3



More information about the Sugar-devel mailing list