mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
Added comments
This commit is contained in:
parent
3f52013234
commit
ad8c971418
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue