bigboard r7301 - trunk/bigboard/stocks/apps



Author: marco
Date: Tue Apr 15 23:02:21 2008
New Revision: 7301
URL: http://svn.gnome.org/viewvc/bigboard?rev=7301&view=rev

Log:
Remove several unused variables.

Modified:
   trunk/bigboard/stocks/apps/appbrowser.py
   trunk/bigboard/stocks/apps/apps.py

Modified: trunk/bigboard/stocks/apps/appbrowser.py
==============================================================================
--- trunk/bigboard/stocks/apps/appbrowser.py	(original)
+++ trunk/bigboard/stocks/apps/appbrowser.py	Tue Apr 15 23:02:21 2008
@@ -129,10 +129,10 @@
     def get_action_button(self):
         return self.__action_button
 
-def categorize(apps):    
+def categorize(applications):    
     """Given a set of applications, returns a map <string,set<Application>> based on category name."""
     categories = {}
-    for app in apps:
+    for app in applications:
         cat = app.get_category()
         if not categories.has_key(cat):
             categories[cat] = set()
@@ -183,7 +183,7 @@
         self.__repo.connect("my-top-apps-changed", lambda repo, my_top_apps: self.__sync())
                 
     def __sync(self):
-        apps = self.__repo.get_all_apps()
+        applications = self.__repo.get_all_apps()
         used_apps = self.__repo.get_my_top_apps()
         
         self.remove_all()
@@ -195,9 +195,9 @@
         cat_usage = {}
         
         max_usage_count = ('', 0)
-        for category,apps in categories.iteritems():
+        for category, applications in categories.iteritems():
             cat_usage_count = 0
-            for app in apps:
+            for app in applications:
                 cat_usage_count += int(app.get_usage_count())
             if cat_usage_count > max_usage_count[1]:
                 max_usage_count = (category, cat_usage_count)
@@ -321,7 +321,7 @@
         self.__app_pair2.clear()
         self.set_child_visible(self.__app_pair, not not self.__apps)
         found = 0
-        for i,app in enumerate(self.__apps or []):
+        for app in (self.__apps or []):
             if app.is_installed():
                 continue
             if self.__search_filter and (not self.__search_filter(app)):

Modified: trunk/bigboard/stocks/apps/apps.py
==============================================================================
--- trunk/bigboard/stocks/apps/apps.py	(original)
+++ trunk/bigboard/stocks/apps/apps.py	Tue Apr 15 23:02:21 2008
@@ -101,7 +101,7 @@
             theme = gtk.icon_theme_get_default()
             try:
                 pixbuf = theme.load_icon(icon_name, 48, 0)
-            except gobject.GError, e:
+            except gobject.GError:
                 return None
             return pixbuf
         return None
@@ -116,7 +116,7 @@
                 desktop = gnomedesktop.item_new_from_file(entry_path, 0)
                 if desktop:
                     return desktop            
-            except gobject.GError, e:
+            except gobject.GError:
                 desktop = None
         if not self.__resource:
             return None
@@ -126,7 +126,7 @@
             menuitem = None
             try:
                 menuitem = ad.lookup(name)
-            except KeyError, e:
+            except KeyError:
                 pass
                 
             if menuitem and not self.__menu_entry:
@@ -155,7 +155,6 @@
         return self.__desktop_entry is not None      
    
     def recheck_installed(self):
-        old_installed = self.__desktop_entry is not None
         self.__desktop_entry = self.__lookup_desktop()
 
     ## called only by apps repo
@@ -181,7 +180,7 @@
         self.__handler = handler
         
     def __load_app_from_xml(self, node):
-        id = node.getAttribute("id")
+        #id = node.getAttribute("id")
         #_logger.debug("parsing application id=%s", id)
         attrs = xml_get_attrs(node, ['id', 'rank', 'usageCount', 
                                      'iconUrl', 
@@ -438,7 +437,7 @@
         for menu in ad.get_apps():
             self.get_app_for_menu_entry(menu)
         
-        for id,app in self.__ddm_apps.iteritems():
+        for app in self.__ddm_apps.values():
             app.recheck_installed()
             
         self.emit("local-apps-changed", self.__local_apps.itervalues())
@@ -453,7 +452,7 @@
             for desktop_name in app_resource.desktopNames.split(';'):
                 try:
                     target_menuitem = ad.lookup(desktop_name)
-                except KeyError, e:
+                except KeyError:
                     continue
                 if self.__local_apps.has_key(target_menuitem.get_name()):
                     #_logger.debug("moving app %s from local to apps", target_menuitem.get_name())



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]