run method
(self)
| 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 |
nothing calls this directly
no test coverage detected