From 84616827ad0b38442fa69af9163e799dd6a68114 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Wed, 23 Oct 2019 19:46:26 +0200 Subject: [PATCH] misc: small fix or general refactoring i did not bother commenting --- pwnagotchi/plugins/__init__.py | 4 +++- pwnagotchi/voice.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/plugins/__init__.py b/pwnagotchi/plugins/__init__.py index 6dd7b648..b2219747 100644 --- a/pwnagotchi/plugins/__init__.py +++ b/pwnagotchi/plugins/__init__.py @@ -21,6 +21,7 @@ def on(event_name, *args, **kwargs): plugin.__dict__[cb_name](*args, **kwargs) except Exception as e: logging.error("error while running %s.%s : %s" % (plugin_name, cb_name, e)) + logging.error(e, exc_info=True) def load_from_file(filename): @@ -47,7 +48,8 @@ def load_from_path(path, enabled=()): def load(config): - enabled = [name for name, options in config['main']['plugins'].items() if 'enabled' in options and options['enabled']] + enabled = [name for name, options in config['main']['plugins'].items() if + 'enabled' in options and options['enabled']] custom_path = config['main']['custom_plugins'] if 'custom_plugins' in config['main'] else None # load default plugins loaded = load_from_path(default_path, enabled=enabled) diff --git a/pwnagotchi/voice.py b/pwnagotchi/voice.py index cf98fdad..b718e4e2 100644 --- a/pwnagotchi/voice.py +++ b/pwnagotchi/voice.py @@ -136,7 +136,7 @@ class Voice: def on_unread_messages(self, count, total): s = 's' if count > 1 else '' - return self._('You have {count} new message{plural}!').format(num=count, plural=s) + return self._('You have {count} new message{plural}!').format(count=count, plural=s) def on_rebooting(self): return self._("Ops, something went wrong ... Rebooting ...")