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

Michael Stone michael at laptop.org
Sun May 23 14:50:26 EDT 2010


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>
---
  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 c45dcd3..5bb8cf4 100755
--- a/extensions/cpsection/updater/model.py
+++ b/extensions/cpsection/updater/model.py
@@ -63,8 +63,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.1


More information about the Sugar-devel mailing list