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@12721 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 9, 2010
1 parent 74a4be8 commit 1416065
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 1416065

Please sign in to comment.