parse plugins for given list of urls
(self, urls)
| 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: |
no test coverage detected