diff --git a/bumblebee/output.py b/bumblebee/output.py index b5e2b26..f4194a9 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -5,10 +5,13 @@ import sys import json import uuid +import logging import bumblebee.store import bumblebee.util +log = logging.getLogger(__name__) + def scrollable(func): def wrapper(module, widget): text = func(module, widget) @@ -178,6 +181,9 @@ class I3BarOutput(object): if self._config and self._config.reverse(): widgets = list(reversed(widgets)) sys.stdout.write(json.dumps(widgets)) + if len(self._config.unused_keys()) > 0: + for key in self._config.unused_keys(): + log.warning("unused parameter {} - please check the documentation of the affected module to ensure the parameter exists".format(key)) def end(self): """Finalizes output""" diff --git a/bumblebee/store.py b/bumblebee/store.py index 8fac71b..6b35347 100644 --- a/bumblebee/store.py +++ b/bumblebee/store.py @@ -9,13 +9,19 @@ class Store(object): """Interface for storing and retrieving simple values""" def __init__(self): self._data = {} + self._unused = {} def set(self, key, value): """Set 'key' to 'value', overwriting 'key' if it exists already""" self._data[key] = value + self._unused[key] = value + + def unused_keys(self): + return self._unused.keys() def get(self, key, default=None): """Return the current value of 'key', or 'default' if 'key' is not set""" + self._unused.pop(key, None) return self._data.get(key, default) # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4