Skip to content
Permalink
Browse files

Don't return null on failed metadata load

  • Loading branch information
NathanW2 committed Jun 12, 2013
1 parent 57cb575 commit b287661c91521a3482fff162b5116439da360a75
Showing with 5 additions and 8 deletions.
  1. +5 −8 python/utils.py
@@ -118,7 +118,6 @@ def initInterface(pointer):

def findPlugins(path):
""" for internal use: return list of plugins in given path """
plugins = []
for plugin in glob.glob(path + "/*"):
if not os.path.isdir(plugin):
continue
@@ -134,12 +133,10 @@ def findPlugins(path):
try:
cp.readfp(codecs.open(metadataFile, "r", "utf8"))
except:
return None # reading of metadata file failed
cp = None

pluginName = os.path.basename(plugin)
plugins.append( (pluginName, cp) )

return plugins
yield (pluginName, cp)


def updateAvailablePlugins():
@@ -148,11 +145,11 @@ def updateAvailablePlugins():
plugins = []
metadata_parser = {}
for pluginpath in plugin_paths:
for p in findPlugins(pluginpath):
pluginName = p[0]
for pluginName, parser in findPlugins(pluginpath):
if parser is None: continue
if pluginName not in plugins:
plugins.append(pluginName)
metadata_parser[pluginName] = p[1]
metadata_parser[pluginName] = parser

global available_plugins
available_plugins = plugins

0 comments on commit b287661

Please sign in to comment.
You can’t perform that action at this time.