diff --git a/bumblebee-status b/bumblebee-status index d757abe..42258a4 100755 --- a/bumblebee-status +++ b/bumblebee-status @@ -9,7 +9,6 @@ def main(): engine = bumblebee.engine.Engine(config) engine.load_modules() - engine.register_events() engine.run() diff --git a/bumblebee/config.py b/bumblebee/config.py index ef11a49..a990c7f 100644 --- a/bumblebee/config.py +++ b/bumblebee/config.py @@ -54,7 +54,6 @@ class ModuleConfig(object): class Config(object): def __init__(self, args): - self._raw = args self._parser = self._parser() self._store = {} diff --git a/bumblebee/engine.py b/bumblebee/engine.py index a1d366f..1625ee7 100644 --- a/bumblebee/engine.py +++ b/bumblebee/engine.py @@ -1,9 +1,3 @@ -import os -import sys -import glob -import pkgutil -import textwrap -import argparse import importlib import bumblebee.theme import bumblebee.output @@ -25,24 +19,6 @@ class Engine: for m in self._config.modules(): self._modules.append(self.load_module(m)) - def register_event(self, eventspec): - return - # TODO - event = eventspec.split(self._args.split) - if len(event) < 3: - raise Exception("invalid click event format, expected 3 parameters") - self._output.add_callback( - module = event[0], - button = int(event[1]), - cmd = event[2], - ) - - def register_events(self): - return - # TODO - for e in self._args.events: - self.register_event(e) - def run(self): self._output.start() diff --git a/bumblebee/output.py b/bumblebee/output.py index 43d7688..35a451d 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -71,18 +71,11 @@ class Output(object): )] = cmd def callback(self, event): + module = event.get("instance", event.get("name", None)) cb = self._callbacks.get(( event.get("button", -1), - None, + module, ), None) - cb = self._callbacks.get(( - event.get("button", -1), - event.get("name", None), - ), cb) - cb = self._callbacks.get(( - event.get("button", -1), - event.get("instance", None), - ), cb) if inspect.isfunction(cb) or cb is None: return cb return Command(cb)