From 161c18831e8c0d009833dce39229c89abe091490 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 25 Apr 2019 01:04:59 +0200 Subject: [PATCH] Also get size info about system ? --- src/yunohost/backup.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index 5db17a047..e5a21669c 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -2273,15 +2273,16 @@ def backup_info(name, with_details=False, human_readable=False): system_key = "hooks" if "size_details" in info.keys(): - for name, key_info in info["apps"].items(): - if name in info["size_details"]["apps"].keys(): - key_info["size"] = info["size_details"]["apps"][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"] = "?" + 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]