--- smart/__init__.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) Index: smart-1.3.1/smart/__init__.py =================================================================== --- smart-1.3.1.orig/smart/__init__.py 2011-05-04 16:15:21.000000000 +0200 +++ smart-1.3.1/smart/__init__.py 2011-05-04 17:00:57.000000000 +0200 @@ -181,14 +181,24 @@ from smart import plugins from smart import backends pluginsdir = os.path.dirname(plugins.__file__) + loadedPlugins = [] for entry in os.listdir(pluginsdir): - if entry != "__init__.py" and entry.endswith(".py"): - __import__("smart.plugins."+entry[:-3]) + if entry.startswith("__init__.py"): + continue + (name, suffix) = os.path.splitext(entry) + if name in loadedPlugins: + continue + if suffix in ['.py', '.pyc', '.pyo']: + __import__("smart.plugins."+name) + loadedPlugins.append(name) else: entrypath = os.path.join(pluginsdir, entry) if os.path.isdir(entrypath): initpath = os.path.join(entrypath, "__init__.py") - if os.path.isfile(initpath): + if (os.path.isfile(initpath) or + os.path.isfile(initpath+"c") or + os.path.isfile(initpath+"o") + ): __import__("smart.plugins."+entry) if os.path.isdir(PLUGINSDIR): for entry in os.listdir(PLUGINSDIR): @@ -199,7 +209,10 @@ entrypath = os.path.join(backendsdir, entry) if os.path.isdir(entrypath): initpath = os.path.join(entrypath, "__init__.py") - if os.path.isfile(initpath): + if (os.path.isfile(initpath) or + os.path.isfile(initpath+"c") or + os.path.isfile(initpath+"o") + ): __import__("smart.backends."+entry) def initPsyco():