mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
Updated for ponce
This commit is contained in:
parent
4c4f7e34e1
commit
dcf850da0b
1 changed files with 9 additions and 11 deletions
|
@ -25,7 +25,7 @@ class Downloader(Configs, Utilities):
|
|||
self.color = self.colour()
|
||||
self.progress = ProgressBar()
|
||||
|
||||
self.output = 0
|
||||
self.output: int = 0
|
||||
self.stderr = None
|
||||
self.stdout = None
|
||||
|
||||
|
@ -57,15 +57,13 @@ class Downloader(Configs, Utilities):
|
|||
|
||||
def check_if_downloaded(self) -> None:
|
||||
""" Checks if the file downloaded. """
|
||||
if 'ponce' not in self.url:
|
||||
|
||||
url: str = unquote(self.url)
|
||||
file: str = url.split('/')[-1]
|
||||
path_file = Path(self.path, file)
|
||||
url: str = unquote(self.url)
|
||||
file: str = url.split('/')[-1]
|
||||
path_file = Path(self.path, file)
|
||||
|
||||
if not path_file.exists():
|
||||
raise SystemExit(f"\n{self.red}FAILED {self.output}:{self.endc} '{self.blue}{self.url}{self.endc}' "
|
||||
f"to download.\n")
|
||||
if not path_file.exists():
|
||||
raise SystemExit(f"\n{self.red}FAILED {self.output}:{self.endc} '{self.blue}{self.url}{self.endc}' "
|
||||
f"to download.\n")
|
||||
|
||||
def download(self) -> None:
|
||||
""" Starting multiprocessing download process. """
|
||||
|
@ -91,8 +89,8 @@ class Downloader(Configs, Utilities):
|
|||
if not p1.is_alive():
|
||||
|
||||
if p1.exitcode != 0:
|
||||
done = f' {self.bred} Failed{self.endc}'
|
||||
self.output = p1.exitcode
|
||||
done: str = f' {self.bred} Failed{self.endc}'
|
||||
self.output: int = p1.exitcode
|
||||
|
||||
print(f'{self.endc}{done}', end='')
|
||||
p2.terminate()
|
||||
|
|
Loading…
Reference in a new issue