[QGIS Commit] r12721 - trunk/qgis/python

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Jan 9 15:50:16 EST 2010


Author: jef
Date: 2010-01-09 15:50:14 -0500 (Sat, 09 Jan 2010)
New Revision: 12721

Modified:
   trunk/qgis/python/utils.py
Log:
fix python plugin detection

Modified: trunk/qgis/python/utils.py
===================================================================
--- trunk/qgis/python/utils.py	2010-01-09 19:58:47 UTC (rev 12720)
+++ trunk/qgis/python/utils.py	2010-01-09 20:50:14 UTC (rev 12721)
@@ -101,14 +101,21 @@
 # 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:



More information about the QGIS-commit mailing list