mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-27 09:58:10 +01:00
Updated for return size
This commit is contained in:
parent
1fce3598f6
commit
52264b66f0
2 changed files with 8 additions and 2 deletions
|
@ -1,5 +1,9 @@
|
|||
## slpkg - ChangeLog
|
||||
|
||||
### 4.9.2 - 04/07/2023
|
||||
- Updated:
|
||||
* Check updates function for return repository size
|
||||
|
||||
### 4.9.1 - 28/06/2023
|
||||
- Updated:
|
||||
* Bullet progress bar color
|
||||
|
|
|
@ -6,7 +6,7 @@ import logging
|
|||
from pathlib import Path
|
||||
from multiprocessing import Process
|
||||
from urllib3.exceptions import HTTPError
|
||||
from urllib3 import PoolManager, ProxyManager, make_headers
|
||||
from urllib3 import PoolManager, ProxyManager, make_headers, Timeout
|
||||
|
||||
from slpkg.configs import Configs
|
||||
from slpkg.utilities import Utilities
|
||||
|
@ -28,6 +28,8 @@ class CheckUpdates(Configs):
|
|||
self.repos = Repositories()
|
||||
|
||||
self.compare: dict = {}
|
||||
|
||||
timeout = Timeout(connect=2.0, read=3.0)
|
||||
self.http = PoolManager()
|
||||
self.proxy_default_headers = make_headers(
|
||||
proxy_basic_auth=f'{self.proxy_username}:{self.proxy_password}')
|
||||
|
@ -105,7 +107,7 @@ class CheckUpdates(Configs):
|
|||
except HTTPError:
|
||||
print(f'\n\n{self.endc}{self.prog_name}: {self.bred}Error:{self.endc} '
|
||||
f'Failed to connect to {repo_chg_txt}\n')
|
||||
return False
|
||||
repo_size: int = 0
|
||||
else:
|
||||
repo_size: int = int(repo.headers['Content-Length'])
|
||||
|
||||
|
|
Loading…
Reference in a new issue