[commons.util] refactoring: centralizing String size conversion into 'size_to_byte'

This commit is contained in:
Vinicius Moreira
2022-04-06 10:41:09 -03:00
parent 2262f36640
commit 47cb969f1a
5 changed files with 35 additions and 32 deletions

View File

@@ -438,12 +438,12 @@ def map_update_download_size(app_ids: Iterable[str], installation: str, version:
if size and len(size) > 1:
try:
res[related_id[0].strip()] = size_to_byte(float(size[0].replace(',', '.')), size[1].strip())
res[related_id[0].strip()] = size_to_byte(size[0], size[1].strip())
except:
traceback.print_exc()
else:
try:
res[related_id[0].strip()] = size_to_byte(float(size_tuple[0].replace(',', '.')), size_tuple[1].strip())
res[related_id[0].strip()] = size_to_byte(size_tuple[0], size_tuple[1].strip())
except:
traceback.print_exc()
return res