MCPcopy
hub / github.com/pyload/pyload / run

Method run

module/PluginThread.py:355–420  ·  view source on GitHub ↗

run method

(self)

Source from the content-addressed store, hash-verified

353 return [self.active]
354
355 def run(self):
356 """run method"""
357
358 pyfile = self.active
359 retry = False
360
361 try:
362 self.m.log.info(_("Decrypting starts: %s") % self.active.name)
363 self.active.plugin.preprocessing(self)
364
365 except NotImplementedError:
366 self.m.log.error(_("Plugin %s is missing a function.") % self.active.pluginname)
367 return
368
369 except Fail, e:
370 msg = e.args[0]
371
372 if msg == "offline":
373 self.active.setStatus("offline")
374 self.m.log.warning(_("Download is offline: %s") % self.active.name)
375 else:
376 self.active.setStatus("failed")
377 self.m.log.error(_("Decrypting failed: %(name)s | %(msg)s") % {"name": self.active.name, "msg": msg})
378 self.active.error = msg
379
380 return
381
382 except Abort:
383 self.m.log.info(_("Download aborted: %s") % pyfile.name)
384 pyfile.setStatus("aborted")
385
386 return
387
388 except Retry:
389 self.m.log.info(_("Retrying %s") % self.active.name)
390 retry = True
391 return self.run()
392
393 except Exception, e:
394 self.active.setStatus("failed")
395 self.m.log.error(_("Decrypting failed: %(name)s | %(msg)s") % {"name": self.active.name, "msg": str(e)})
396 self.active.error = str(e)
397
398 if self.m.core.debug:
399 print_exc()
400 self.writeDebugReport(pyfile)
401
402 return
403
404
405 finally:
406 if not retry:
407 self.active.release()
408 self.active = False
409 self.m.core.files.save()
410 self.m.localThreads.remove(self)
411 exc_clear()
412

Callers

nothing calls this directly

Calls 9

setStatusMethod · 0.80
writeDebugReportMethod · 0.80
_Function · 0.50
preprocessingMethod · 0.45
errorMethod · 0.45
releaseMethod · 0.45
saveMethod · 0.45
removeMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected