From a9d937db211871e26415125c5c75f86b9e55334b Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 13 Apr 2018 10:11:44 +0200 Subject: [PATCH] [enh] Display nice operation name --- locales/en.json | 18 ++++++++++++++++++ src/yunohost/log.py | 10 +++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/locales/en.json b/locales/en.json index 9f310c3b9..47b3eefee 100644 --- a/locales/en.json +++ b/locales/en.json @@ -207,6 +207,24 @@ "iptables_unavailable": "You cannot play with iptables here. You are either in a container or your kernel does not support it", "log_does_exists": "There is not operation log with the name '{log}', use 'yunohost log list to see all available operation logs'", "log_operation_unit_unclosed_properly": "Operation unit has not been closed properly", + "log_app_removelist": "Remove an application list", + "log_app_change_url": "Change the url of '{}' application", + "log_app_install": "Install '{}' application", + "log_app_remove": "Remove '{}' application", + "log_app_upgrade": "Upgrade '{}' application", + "log_app_makedefault": "Make '{}' as default application", + "log_domain_add": "Add '{}' domain into system configuration", + "log_domain_remove": "Remove '{}' domain from system configuration", + "log_dyndns_subscribe": "Subscribe to a YunoHost subdomain '{}'", + "log_dyndns_update": "Update the ip associated with your YunoHost subdomain '{}'", + "log_user_create": "Add '{}' user", + "log_user_delete": "Delete '{}' user", + "log_user_update": "Update information of '{}' user", + "log_tools_maindomain": "Make '{}' as main domain", + "log_tools_postinstall": "Postinstall your YunoHost server", + "log_tools_upgrade": "Upgrade debian packages", + "log_tools_shutdown": "Shutdown your server", + "log_tools_reboot": "Reboot your server", "ldap_init_failed_to_create_admin": "LDAP initialization failed to create admin user", "ldap_initialized": "LDAP has been initialized", "license_undefined": "undefined", diff --git a/src/yunohost/log.py b/src/yunohost/log.py index fbf2fc232..da6543c86 100644 --- a/src/yunohost/log.py +++ b/src/yunohost/log.py @@ -63,13 +63,13 @@ def log_list(limit=None): file_name = operation operation = operation[:-len(METADATA_FILE_EXT)] - operation = operation.split("_") + operation = operation.split("-") - operation_datetime = datetime.strptime(" ".join(operation[:2]), "%Y-%m-%d %H-%M-%S") + operation_datetime = datetime.strptime(" ".join(operation[:2]), "%Y%m%d %H%M%S") result["categories"][-1]["operations"].append({ "started_at": operation_datetime, - "name": " ".join(operation[-2:]), + "name": m18n.n("log_" + operation[2], *operation[3:]), "file_name": file_name, "path": os.path.join(OPERATIONS_PATH, category, file_name), }) @@ -213,11 +213,11 @@ class UnitOperation(object): @property def name(self): - name = [self.started_at.strftime("%F_%X").replace(":", "-")] + name = [self.started_at.strftime("%Y%m%d-%H%M%S")] name += [self.operation] if self.on is not None: name += self.on - return '_'.join(name) + return '-'.join(name) @property def metadata(self):