Title: [commits] (vajda) [16062] - fixed bug 11558 (r=bkirsch)
Revision
16062
Author
vajda
Date
2007-12-06 11:44:35 -0800 (Thu, 06 Dec 2007)

Log Message

- fixed bug 11558 (r=bkirsch)
(http://bugzilla.osafoundation.org/show_bug.cgi?id=11558)
(Language eggs should be handled like plugins)

Modified Paths

Diff

Modified: trunk/chandler/application/Application.py (16061 => 16062)

--- trunk/chandler/application/Application.py	2007-12-06 19:28:19 UTC (rev 16061)
+++ trunk/chandler/application/Application.py	2007-12-06 19:44:35 UTC (rev 16062)
@@ -322,13 +322,15 @@
 
         self.startenv = os.environ.copy()
 
+        # add plugin eggs and l10n eggs to working_set
+        # collect plugin eggs
+        pluginEnv, pluginEggs = Utility.initPluginEnv(options,
+                                                      options.pluginPath)
+
         # The initI18n can't be initialized until after the App
         # object has been created since initialization creates a
         # wx.Locale object which requires a path that requires
         # GetTraits, which is a method on the App object.
-        #
-        # Eventually when we get Python egg based localization
-        # implemented, this constraint may change
         Utility.initI18n(options)
 
         util.timing.begin("wxApplication OnInit") #@@@Temporary testing tool written by Morgen -- DJA
@@ -355,8 +357,6 @@
         
         # Initialize PARCELPATH and sys.path
         parcelPath = Utility.initParcelEnv(options, Globals.chandlerDirectory)
-        pluginEnv, pluginEggs = Utility.initPluginEnv(options,
-                                                      options.pluginPath)
 
         # If a magic metakey is down, run the startup options box; it'll
         # modify options as necessary.

Modified: trunk/chandler/application/Utility.py (16061 => 16062)

--- trunk/chandler/application/Utility.py	2007-12-06 19:28:19 UTC (rev 16061)
+++ trunk/chandler/application/Utility.py	2007-12-06 19:44:35 UTC (rev 16062)
@@ -848,6 +848,9 @@
     return parcelPath
 
 
+# add plugin eggs and l10n eggs to working_set
+# collect plugin eggs
+
 def initPluginEnv(options, path):
 
     from pkg_resources import working_set, Environment
@@ -863,7 +866,7 @@
         pluginPrefs = None
     
     plugin_env = Environment(path)
-    eggs = []
+    plugin_eggs = []
 
     # remove uninstalled plugins from prefs
     if pluginPrefs is not None:
@@ -872,17 +875,18 @@
                 del prefs['plugins'][project_name]
         prefs.write()
 
-    # add active plugins to working set
+    # add active plugins and l10n eggs to working set
     for project_name in sorted(plugin_env):
-        if pluginPrefs is not None:
-            if pluginPrefs.get(project_name) == 'inactive':
-                continue
         for egg in plugin_env[project_name]:
-            working_set.add(egg)
-            eggs.append(egg)
+            if egg.has_metadata('resources.ini'):
+                working_set.add(egg)            # possible l10n egg
+            elif (pluginPrefs is None or
+                  pluginPrefs.get(project_name) != 'inactive'):
+                working_set.add(egg)            # possible plugin egg
+                plugin_eggs.append(egg)
             break
 
-    return plugin_env, eggs
+    return plugin_env, plugin_eggs
 
 
 def initParcels(options, view, path, namespaces=None):




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to