From 1697d46d95668a67ed62dbcdadbc86244f44bcf8 Mon Sep 17 00:00:00 2001 From: Cyril Levis Date: Sun, 8 Jul 2018 15:38:33 +0200 Subject: [PATCH] wip --- py3status/module.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/py3status/module.py b/py3status/module.py index 8c42027352..96d321037f 100644 --- a/py3status/module.py +++ b/py3status/module.py @@ -190,10 +190,11 @@ def error_output(self, message, method_affected=None): color = None error = { - "full_text": message, - "color": color, - "instance": self.module_inst, - "name": self.module_name, + 'full_text': message, + 'short_text': message, + 'color': color, + 'instance': self.module_inst, + 'name': self.module_name, } for method in self.methods.values(): if method_affected and method["method"] != method_affected: @@ -279,7 +280,7 @@ def set_updated(self): output.extend(data) else: # if the output is not 'valid' then don't add it. - if data.get("full_text") or "separator" in data: + if data.get('full_text') or data.get('short_text') or 'separator' in data: if self.testing: data["cached_until"] = method.get("cached_until") output.append(data) @@ -682,12 +683,16 @@ def deprecation_log(item): # the method_obj stores infos about each method # of this module. method_obj = { - "cached_until": time(), - "call_type": params_type, - "instance": None, - "last_output": {"name": method, "full_text": ""}, - "method": method, - "name": None, + 'cached_until': time(), + 'call_type': params_type, + 'instance': None, + 'last_output': { + 'name': method, + 'full_text': '', + 'short_text': '' + }, + 'method': method, + 'name': None } self.methods[method] = method_obj