From ad8c971418ccc90857d79fa74f3bc1756451cf60 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 12 Jan 2024 21:26:52 +0200 Subject: [PATCH] Added comments --- slpkg/check_updates.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index 5d0748c7..233bb8ab 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -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