Index: utils.py =================================================================== --- utils.py (revision 13199) +++ utils.py (working copy) @@ -71,24 +71,37 @@ def findPlugins(path): plugins = [] - for plugin in glob.glob(path + "/plugins/*"): - if os.path.isdir(plugin): - plugins.append( os.path.basename(plugin) ) - + try: + for plugin in glob.glob(path + "/*/__init__.py*"): + plugindir = os.path.split(plugin)[0] + plugin = os.path.basename(plugindir) + if plugin not in plugins: + plugins.append( plugin ) + except: + pass return plugins def updateAvailablePlugins(): from qgis.core import QgsApplication - pythonPath = unicode(QgsApplication.pkgDataPath()) + "/python" - homePythonPath = unicode(QgsApplication.qgisSettingsDirPath()) + "/python" + plugindirs = [ + (QgsApplication.pkgDataPath()) + "/python/plugins", + unicode(QgsApplication.qgisSettingsDirPath()) + "/python/plugins" + ] + env = os.environ.get("QGIS_PLUGINPATH") + if env: + plugindirs.extend(env.split(";")) - plugins = findPlugins( pythonPath ) - homePlugins = findPlugins( homePythonPath ) - # merge the lists - for p in homePlugins: - if p not in plugins: - plugins.append(p) + plugins = [] + for path in plugindirs: + pluginpath = path+"/plugins" + newplugins = findPlugins(path) + if len(newplugins) > 0: + if pluginpath not in sys.path: + sys.path.append(pluginpath) + for p in newplugins: + if p not in plugins: + plugins.append(p) global available_plugins available_plugins = plugins