MCPcopy
hub / github.com/pyload/pyload / parseUrls

Method parseUrls

module/plugins/PluginManager.py:235–260  ·  view source on GitHub ↗

parse plugins for given list of urls

(self, urls)

Source from the content-addressed store, hash-verified

233
234
235 def parseUrls(self, urls):
236 """parse plugins for given list of urls"""
237
238 last = None
239 res = [] # tupels of (url, plugin)
240
241 for url in urls:
242 if type(url) not in (str, unicode, buffer): continue
243 found = False
244
245 if last and last[1]["re"].match(url):
246 res.append((url, last[0]))
247 continue
248
249 for name, value in chain(self.crypterPlugins.iteritems(), self.hosterPlugins.iteritems(),
250 self.containerPlugins.iteritems()):
251 if value["re"].match(url):
252 res.append((url, name))
253 last = (name, value)
254 found = True
255 break
256
257 if not found:
258 res.append((url, "BasePlugin"))
259
260 return res
261
262 def findPlugin(self, name, pluginlist=("hoster", "crypter", "container")):
263 for ptype in pluginlist:

Callers 7

checkURLsMethod · 0.80
checkOnlineStatusMethod · 0.80
checkAndAddPackagesMethod · 0.80
decryptContainerMethod · 0.80
addLinksMethod · 0.80
PluginManager.pyFile · 0.80
whitelistMethod · 0.80

Calls 3

matchMethod · 0.45
appendMethod · 0.45
iteritemsMethod · 0.45

Tested by

no test coverage detected