From 9d0a307dcc1d5a7868524425f7583b5d11b12e41 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 1 Nov 2013 16:29:47 +0100 Subject: improved wait method for hoster --- pyload/plugins/Hoster.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'pyload/plugins') diff --git a/pyload/plugins/Hoster.py b/pyload/plugins/Hoster.py index c95b00009..976918c0d 100644 --- a/pyload/plugins/Hoster.py +++ b/pyload/plugins/Hoster.py @@ -176,18 +176,25 @@ class Hoster(Base): return True, 10 - def setWait(self, seconds, reconnect=False): + def setWait(self, seconds, reconnect=None): """Set a specific wait time later used with `wait` :param seconds: wait time in seconds :param reconnect: True if a reconnect would avoid wait time """ - if reconnect: - self.wantReconnect = True + if reconnect is not None: + self.wantReconnect = reconnect self.pyfile.waitUntil = time() + int(seconds) - def wait(self): - """ waits the time previously set """ + def wait(self, seconds=None, reconnect=None): + """ Waits the time previously set or use these from arguments. See `setWait` + """ + if seconds is not None: + self.setWait(seconds, reconnect) + + self._wait() + + def _wait(self): self.waiting = True self.pyfile.setStatus("waiting") -- cgit v1.2.3