diff options
| author | 2013-11-01 16:29:47 +0100 | |
|---|---|---|
| committer | 2013-11-01 16:30:03 +0100 | |
| commit | 9d0a307dcc1d5a7868524425f7583b5d11b12e41 (patch) | |
| tree | 3a0fa0a4509af5b5ee6fb07e53de1ab8aa37a4b2 /pyload/plugins | |
| parent | added install instruction (diff) | |
| download | pyload-9d0a307dcc1d5a7868524425f7583b5d11b12e41.tar.xz | |
improved wait method for hoster
Diffstat (limited to 'pyload/plugins')
| -rw-r--r-- | pyload/plugins/Hoster.py | 17 | 
1 files changed, 12 insertions, 5 deletions
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")  | 
