fix python plugin detection

git-svn-id: http://svn.osgeo.org/qgis/trunk@12721 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2010-01-09 20:50:14 +00:00
parent 74a4be85e8
commit 1416065936

View File

@ -101,14 +101,21 @@ active_plugins = []
# list of plugins in plugin directory and home plugin directory
available_plugins = []
def findPlugins(path):
plugins = []
for plugin in glob.glob(path + "/plugins/*"):
if os.path.isdir(plugin):
plugins.append( os.path.basename(plugin) )
return plugins
def updateAvailablePlugins():
from qgis.core import QgsApplication
pythonPath = unicode(QgsApplication.pkgDataPath()) + "/python"
homePythonPath = unicode(QgsApplication.qgisSettingsDirPath()) + "/python"
plugins = map(os.path.basename, glob.glob(pythonPath + "/plugins/*"))
homePlugins = map(os.path.basename, glob.glob(homePythonPath + "/plugins/*"))
plugins = findPlugins( pythonPath )
homePlugins = findPlugins( homePythonPath )
# merge the lists
for p in homePlugins: