mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Refactor method
This commit is contained in:
parent
c12389ed84
commit
171a58c17a
1 changed files with 3 additions and 3 deletions
|
@ -106,12 +106,12 @@ class CheckUpdates(Configs):
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
except HTTPError:
|
except HTTPError:
|
||||||
self.error_connect(repo_chg_txt)
|
self.error_connect_message(repo_chg_txt)
|
||||||
repo_size: int = 0
|
repo_size: int = 0
|
||||||
else:
|
else:
|
||||||
repo_size: int = int(repo.headers.get('content-length', 0))
|
repo_size: int = int(repo.headers.get('content-length', 0))
|
||||||
if repo_size == 0:
|
if repo_size == 0:
|
||||||
self.error_connect(repo_chg_txt)
|
self.error_connect_message(repo_chg_txt)
|
||||||
|
|
||||||
if local_chg_txt.is_file():
|
if local_chg_txt.is_file():
|
||||||
local_size: int = int(os.stat(local_chg_txt).st_size)
|
local_size: int = int(os.stat(local_chg_txt).st_size)
|
||||||
|
@ -125,7 +125,7 @@ class CheckUpdates(Configs):
|
||||||
|
|
||||||
return local_size != repo_size
|
return local_size != repo_size
|
||||||
|
|
||||||
def error_connect(self, repo_chg_txt: str) -> None:
|
def error_connect_message(self, repo_chg_txt: str) -> None:
|
||||||
print(f'\n\n{self.endc}{self.prog_name}: {self.bred}Error:{self.endc} '
|
print(f'\n\n{self.endc}{self.prog_name}: {self.bred}Error:{self.endc} '
|
||||||
f'Failed to connect to {repo_chg_txt}\n')
|
f'Failed to connect to {repo_chg_txt}\n')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue