Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix python plugin detection
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12721 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 9, 2010
1 parent 2d21833 commit 43797ae
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/utils.py
Expand Up @@ -101,14 +101,21 @@ def uninstallConsoleHooks():
# 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:
Expand Down

0 comments on commit 43797ae

Please sign in to comment.