mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Updated style code
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
187eb9d61a
commit
bcd22456e0
2 changed files with 20 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
raise SystemExit()
|
||||
|
|
Loading…
Add table
Reference in a new issue