From 95ed76d34290e08876dccce6840c3e09138a2047 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 23:47:47 +0200 Subject: Spare code fixes --- module/plugins/internal/Hoster.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/Hoster.py') diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index 8a11499fa..3d4c11af9 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -272,15 +272,17 @@ class Hoster(Plugin): """ Skip and give reason """ - raise Skip(encode(reason)) + raise Skip(encode(reason)) #@TODO: Remove `encode` in 0.4.10 def abort(self, reason=""): """ Abort and give reason """ + #@TODO: Remove in 0.4.10 if reason: self.pyfile.error = encode(reason) + raise Abort @@ -288,8 +290,10 @@ class Hoster(Plugin): """ Fail and indicate file is offline """ + #@TODO: Remove in 0.4.10 if reason: self.pyfile.error = encode(reason) + raise Fail("offline") @@ -297,8 +301,10 @@ class Hoster(Plugin): """ Fail and indicates file ist temporary offline, the core may take consequences """ + #@TODO: Remove in 0.4.10 if reason: self.pyfile.error = encode(reason) + raise Fail("temp. offline") @@ -320,7 +326,7 @@ class Hoster(Plugin): self.wait(wait_time, False) self.retries[id] += 1 - raise Retry(reason) + raise Retry(encode(reason)) #@TODO: Remove `encode` in 0.4.10 def restart(self, reason=None, reset=False): @@ -335,7 +341,7 @@ class Hoster(Plugin): self.account = None self.req = self.pyload.requestFactory.getRequest(self.__name__) - raise Retry(reason) + raise Retry(encode(reason)) #@TODO: Remove `encode` in 0.4.10 def fixurl(self, url): -- cgit v1.2.3