Skip to content

Commit fc20388

Browse files
committed
Update web.py
1 parent 2aeb4a0 commit fc20388

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

philh_myftp_biz/web.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,8 @@ def stop(self, rm_files:bool=True):
199199
def restart(self):
200200
self.__qbit.restart(self)
201201

202-
def files(self,
203-
timeout: None|int = 30
204-
):
205-
return self.__qbit.files(self, timeout)
202+
def files(self):
203+
return self.__qbit.files(self)
206204

207205
def finished(self):
208206
return self.__qbit.finished(self)
@@ -552,6 +550,7 @@ def __init__(self,
552550

553551
self.__host = host
554552
self.__port = port
553+
self.__timeout = timeout
555554

556555
self.__rclient = Client(
557556
host = host,
@@ -639,7 +638,7 @@ def restart(self,
639638

640639
def files(self,
641640
magnet: Magnet,
642-
timeout: None|int = 30
641+
643642
) -> Generator[File]:
644643
"""
645644
List all files in Magnet Download
@@ -657,10 +656,6 @@ def files(self,
657656
658657
"""
659658
from .time import Stopwatch
660-
from sys import maxsize
661-
662-
if timeout is None:
663-
timeout = maxsize
664659

665660
sw = Stopwatch()
666661
sw.start()
@@ -674,7 +669,7 @@ def files(self,
674669
#
675670
while len(t.files) == 0:
676671

677-
if sw >= timeout:
672+
if sw >= self.__timeout:
678673
raise TimeoutError()
679674

680675
t.setForceStart(False)
@@ -786,18 +781,6 @@ def exists(self,
786781

787782
return (t != None)
788783

789-
def wait(self):
790-
791-
#
792-
dbg = self.debug
793-
self.debug = False
794-
795-
#
796-
self._client()
797-
798-
#
799-
self.debug = dbg
800-
801784
class thePirateBay:
802785
"""
803786
thePirateBay

0 commit comments

Comments
 (0)