summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/Hoster.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-22 03:20:25 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-22 03:20:25 +0200
commitfa5e570bfa4439812b4329f43d6a49e0b5239641 (patch)
tree6ac77a73b5d13186640de30d49ff9aa07808e2ea /module/plugins/internal/Hoster.py
parentMerge pull request #1832 from GammaC0de/patch-1 (diff)
downloadpyload-fa5e570bfa4439812b4329f43d6a49e0b5239641.tar.xz
[Plugin] Fix _log + code cosmetics
Diffstat (limited to 'module/plugins/internal/Hoster.py')
-rw-r--r--module/plugins/internal/Hoster.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py
index a77ef05dd..bdb5c4746 100644
--- a/module/plugins/internal/Hoster.py
+++ b/module/plugins/internal/Hoster.py
@@ -106,7 +106,7 @@ class Hoster(Plugin):
def _log(self, level, plugintype, pluginname, messages):
log = getattr(self.pyload.log, level)
- msg = " | ".join(decode(a).strip() for a in messages if a)
+ msg = u" | ".join(decode(a).strip() for a in messages if a)
log("%(plugintype)s %(pluginname)s[%(id)s]: %(msg)s"
% {'plugintype': plugintype.upper(),
'pluginname': pluginname,
@@ -207,12 +207,13 @@ class Hoster(Plugin):
def set_reconnect(self, reconnect):
- reconnect = bool(reconnect)
+ if reconnect:
+ self.log_info(_("Requesting line reconnection...")
+ else:
+ self.log_debug("Reconnect: %s" % reconnect)
- self.log_info(_("RECONNECT ") + ("enabled" if reconnect else "disabled"))
self.log_debug("Previous wantReconnect: %s" % self.wantReconnect)
-
- self.wantReconnect = reconnect
+ self.wantReconnect = bool(reconnect)
def set_wait(self, seconds, reconnect=None):
@@ -225,7 +226,7 @@ class Hoster(Plugin):
wait_time = max(int(seconds), 1)
wait_until = time.time() + wait_time + 1
- self.log_info(_("WAIT %d seconds") % wait_time)
+ self.log_info(_("Waiting %d seconds...") % wait_time)
self.log_debug("Previous waitUntil: %f" % self.pyfile.waitUntil)
self.pyfile.waitUntil = wait_until