Refactor method

This commit is contained in:
Dimitris Zlatanidis 2024-01-11 19:41:06 +02:00
parent c12389ed84
commit 171a58c17a

View file

@ -106,12 +106,12 @@ class CheckUpdates(Configs):
except KeyboardInterrupt:
raise SystemExit(1)
except HTTPError:
self.error_connect(repo_chg_txt)
self.error_connect_message(repo_chg_txt)
repo_size: int = 0
else:
repo_size: int = int(repo.headers.get('content-length', 0))
if repo_size == 0:
self.error_connect(repo_chg_txt)
self.error_connect_message(repo_chg_txt)
if local_chg_txt.is_file():
local_size: int = int(os.stat(local_chg_txt).st_size)
@ -125,7 +125,7 @@ class CheckUpdates(Configs):
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} '
f'Failed to connect to {repo_chg_txt}\n')