From dcf850da0ba5f203a71fa84bbd6997695c25d49a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 5 Mar 2023 10:32:54 +0200 Subject: [PATCH] Updated for ponce --- slpkg/downloader.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index f182eeaa..ec748c23 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -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()