File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ def initInterface(pointer):
118
118
119
119
def findPlugins (path ):
120
120
""" for internal use: return list of plugins in given path """
121
- plugins = []
122
121
for plugin in glob .glob (path + "/*" ):
123
122
if not os .path .isdir (plugin ):
124
123
continue
@@ -134,12 +133,10 @@ def findPlugins(path):
134
133
try :
135
134
cp .readfp (codecs .open (metadataFile , "r" , "utf8" ))
136
135
except :
137
- return None # reading of metadata file failed
136
+ cp = None
138
137
139
138
pluginName = os .path .basename (plugin )
140
- plugins .append ( (pluginName , cp ) )
141
-
142
- return plugins
139
+ yield (pluginName , cp )
143
140
144
141
145
142
def updateAvailablePlugins ():
@@ -148,11 +145,11 @@ def updateAvailablePlugins():
148
145
plugins = []
149
146
metadata_parser = {}
150
147
for pluginpath in plugin_paths :
151
- for p in findPlugins (pluginpath ):
152
- pluginName = p [ 0 ]
148
+ for pluginName , parser in findPlugins (pluginpath ):
149
+ if parser is None : continue
153
150
if pluginName not in plugins :
154
151
plugins .append (pluginName )
155
- metadata_parser [pluginName ] = p [ 1 ]
152
+ metadata_parser [pluginName ] = parser
156
153
157
154
global available_plugins
158
155
available_plugins = plugins
You can’t perform that action at this time.
0 commit comments