[common] refactoring: 'get_human_size_str' moved from 'system' to 'view_utils'

This commit is contained in:
Vinicius Moreira
2022-03-14 09:46:17 -03:00
parent 5538a52442
commit e1921facf8
12 changed files with 69 additions and 63 deletions

View File

@@ -7,6 +7,7 @@ import requests
import yaml
from bauh.commons import system
from bauh.commons.view_utils import get_human_size_str
class HttpClient:
@@ -102,7 +103,7 @@ class HttpClient:
size = self.get_content_length_in_bytes(url, session)
if size:
return system.get_human_size_str(size)
return get_human_size_str(size)
def exists(self, url: str, session: bool = True, timeout: int = 5) -> bool:
params = {'url': url, 'allow_redirects': True, 'verify': False, 'timeout': timeout}