Added comments

This commit is contained in:
Dimitris Zlatanidis 2024-01-12 21:26:52 +02:00
parent 3f52013234
commit ad8c971418

View file

@ -102,10 +102,11 @@ class CheckUpdates(Configs):
if self.proxy_address.startswith('socks'):
self.set_socks_proxy_server()
# Get local changelog file size.
if local_chg_txt.is_file():
local_size: int = int(os.stat(local_chg_txt).st_size)
try:
try: # Get repository changelog file size.
repo = self.http.request('GET', repo_chg_txt)
repo_size: int = int(repo.headers.get('content-length', 0))
except KeyboardInterrupt:
@ -113,6 +114,8 @@ class CheckUpdates(Configs):
except HTTPError:
self.error_connect_message(repo_chg_txt)
# If repository changelog file failed to get a value,
# set the repo_size equal to local_size to return False.
if repo_size == 0:
repo_size: int = local_size