mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #699 from kay0u/backup-size-info
Add size of apps in backup_info result
This commit is contained in:
commit
a238eca752
1 changed files with 12 additions and 0 deletions
|
@ -2272,6 +2272,18 @@ def backup_info(name, with_details=False, human_readable=False):
|
|||
if "hooks" in info.keys():
|
||||
system_key = "hooks"
|
||||
|
||||
if "size_details" in info.keys():
|
||||
for category in ["apps", "system"]:
|
||||
for name, key_info in info[category].items():
|
||||
if name in info["size_details"][category].keys():
|
||||
key_info["size"] = info["size_details"][category][name]
|
||||
if human_readable:
|
||||
key_info["size"] = binary_to_human(key_info["size"]) + 'B'
|
||||
else:
|
||||
key_info["size"] = -1
|
||||
if human_readable:
|
||||
key_info["size"] = "?"
|
||||
|
||||
result["apps"] = info["apps"]
|
||||
result["system"] = info[system_key]
|
||||
return result
|
||||
|
|
Loading…
Add table
Reference in a new issue