commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7705 - trunk/gnue-common/src/apps


From: reinhard
Subject: [gnue] r7705 - trunk/gnue-common/src/apps
Date: Thu, 7 Jul 2005 10:16:14 -0500 (CDT)

Author: reinhard
Date: 2005-07-07 10:16:13 -0500 (Thu, 07 Jul 2005)
New Revision: 7705

Modified:
   trunk/gnue-common/src/apps/plugin.py
Log:
Also find plugins if .py is missing and only .pyc or .pyo is there.


Modified: trunk/gnue-common/src/apps/plugin.py
===================================================================
--- trunk/gnue-common/src/apps/plugin.py        2005-07-07 14:53:02 UTC (rev 
7704)
+++ trunk/gnue-common/src/apps/plugin.py        2005-07-07 15:16:13 UTC (rev 
7705)
@@ -209,17 +209,20 @@
     return []
 
   # Find all submodules
-  result = []
+  result = {}
   for subfile in os.listdir (basedir):
     (subname, subext) = os.path.splitext (subfile)
     subpath = os.path.join (basedir, subfile)
     # We are only interested in Python modules or packages
-    if (not want_packages and subext == '.py' and subname != '__init__') or \
+    if (not want_packages and subext in ['.py', '.pyc', '.pyo'] and \
+        subname != '__init__') or \
        (os.path.isdir (subpath) and \
-        os.path.isfile (os.path.join (subpath, '__init__.py'))):
-      result = result + [subname]
+        os.path.isfile (os.path.join (subpath, '__init__.py')) or \
+        os.path.isfile (os.path.join (subpath, '__init__.pyc')) or \
+        os.path.isfile (os.path.join (subpath, '__init__.pyo'))):
+      result [subname] = True
 
-  return result
+  return result.keys ()
 
 
 # -----------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]