MCPcopy
hub / github.com/pyload/pyload / wait

Method wait

module/plugins/internal/Base.py:330–380  ·  view source on GitHub ↗

Waits the time previously set

(self, seconds=None, reconnect=None)

Source from the content-addressed store, hash-verified

328 return True
329
330 def wait(self, seconds=None, reconnect=None):
331 """
332 Waits the time previously set
333 """
334 if seconds is not None:
335 self.set_wait(seconds)
336
337 if reconnect is None:
338 reconnect = (seconds > self.config.get('max_wait', 10) * 60)
339
340 self.set_reconnect(reconnect)
341
342 wait_time = self.pyfile.waitUntil - time.time()
343
344 if wait_time < 1:
345 self.log_warning(_("Invalid wait time interval"))
346 return
347
348 self.waiting = True
349
350 status = self.pyfile.status # @NOTE: Recheck in 0.4.10
351 self.pyfile.setStatus("waiting")
352
353 self.log_info(_("Waiting %s...") % format_time(wait_time))
354
355 if self.wantReconnect:
356 self.log_info(_("Requiring reconnection..."))
357 if self.account:
358 self.log_warning(_("Reconnection ignored due logged account"))
359
360 if not self.wantReconnect or self.account:
361 while self.pyfile.waitUntil > time.time():
362 self.check_status()
363 time.sleep(2)
364
365 else:
366 while self.pyfile.waitUntil > time.time():
367 self.check_status()
368 self.thread.m.reconnecting.wait(1)
369
370 if self.thread.m.reconnecting.isSet():
371 self.waiting = False
372 self.wantReconnect = False
373
374 self.req.clearCookies()
375 raise Reconnect
376
377 time.sleep(2)
378
379 self.waiting = False
380 self.pyfile.status = status # @NOTE: Recheck in 0.4.10
381
382 def skip(self, msg=""):
383 """

Callers 15

retryMethod · 0.95
check_downloadMethod · 0.45
check_errorsMethod · 0.45
call_cmdMethod · 0.45
_post_parametersMethod · 0.45
check_errorsMethod · 0.45
handle_WEB_linksMethod · 0.45
handle_freeMethod · 0.45
prepareMethod · 0.45
handle_freeMethod · 0.45
handle_premiumMethod · 0.45
prepareMethod · 0.45

Calls 11

set_waitMethod · 0.95
set_reconnectMethod · 0.95
check_statusMethod · 0.95
log_warningMethod · 0.80
setStatusMethod · 0.80
log_infoMethod · 0.80
format_timeFunction · 0.70
_Function · 0.50
getMethod · 0.45
sleepMethod · 0.45
clearCookiesMethod · 0.45

Tested by

no test coverage detected