From bcd22456e00c0e0958f97df9dac0921d91301173 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 30 Jan 2020 17:57:44 +0100 Subject: [PATCH] Updated style code Signed-off-by: Dimitris Zlatanidis --- slpkg/checksum.py | 6 ++++-- slpkg/downloader.py | 23 ++++++++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/slpkg/checksum.py b/slpkg/checksum.py index 832bb40a..0a362988 100644 --- a/slpkg/checksum.py +++ b/slpkg/checksum.py @@ -38,7 +38,8 @@ def check_md5(pkg_md5, src_file): md5s = md5(src_file) if pkg_md5 != md5s: Msg().template(78) - print(f"| MD5SUM check for {src_file.split('/')[-1]} [ {red}FAILED{endc} ]") + print(f"| MD5SUM check for {src_file.split('/')[-1]}" + f" [ {red}FAILED{endc} ]") Msg().template(78) print(f"| Expected: {pkg_md5}") print(f"| Found: {md5s}") @@ -48,6 +49,7 @@ def check_md5(pkg_md5, src_file): raise SystemExit() else: Msg().template(78) - print(f"| MD5SUM check for {src_file.split('/')[-1]} [ {green}PASSED{endc} ]") + print(f"| MD5SUM check for {src_file.split('/')[-1]}" + f" [ {green}PASSED{endc} ]") Msg().template(78) print() # new line after pass checksum diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 6d6ad90f..f8fd1096 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -64,13 +64,20 @@ class Download: self._make_tarfile(self.file_name, source_dir) self._check_certificate() - print(f"\n[{dwn_count}/{len(self.url)}][ {self.green}Download{self.endc} ] --> {self.file_name}\n") + print(f"\n[{dwn_count}/{len(self.url)}][ {self.green}" + f"Download{self.endc} ] --> {self.file_name}\n") if self.downder in ["wget"]: - subprocess.call(f"{self.downder} {self.downder_options} {self.dir_prefix}{self.path} {dwn}", shell=True) + subprocess.call(f"{self.downder} {self.downder_options}" + f" {self.dir_prefix}{self.path} {dwn}", + shell=True) if self.downder in ["aria2c"]: - subprocess.call(f"{self.downder} {self.downder_options} {self.dir_prefix}{self.path[:-1]} {dwn}", shell=True) + subprocess.call(f"{self.downder} {self.downder_options}" + f" {self.dir_prefix}{self.path[:-1]} {dwn}", + shell=True) elif self.downder in ["curl", "http"]: - subprocess.call(f"{self.downder} {self.downder_options} {self.path}{self.file_name} {dwn}", shell=True) + subprocess.call(f"{self.downder} {self.downder_options}" + f" {self.path}{self.file_name} {dwn}", + shell=True) self._check_if_downloaded() dwn_count += 1 @@ -94,7 +101,8 @@ class Download: if not os.path.isfile(self.path + self.file_name): print() self.msg.template(78) - print(f"| Download '{self.file_name}' file [ {self.red}FAILED{self.endc} ]") + print(f"| Download '{self.file_name}' file" + f" [ {self.red}FAILED{self.endc} ]") self.msg.template(78) print() if not self.msg.answer() in ["y", "Y"]: @@ -108,9 +116,10 @@ class Download: certificate = (' --no-check-certificate --header="Cookie: ' 'oraclelicense=accept-securebackup-cookie"') self.msg.template(78) - print(f"| '{certificate[:23].strip()}' need to go ahead downloading") + print(f"| '{certificate[:23].strip()}' need to go" + f" ahead downloading") self.msg.template(78) print() self.downder_options += certificate if not self.msg.answer() in ["y", "Y"]: - raise SystemExit() \ No newline at end of file + raise SystemExit()