diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2011-12-11 15:48:45 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2011-12-11 15:49:12 +0000 |
commit | fca51de6cc8a46267a1aad4d4cd261556611ee3b (patch) | |
tree | 6c9cb64c339ee46431302e4cca250f226ee96d61 /alot | |
parent | b52bb3f5db5bae61555f263ebbae71d6c7918412 (diff) |
remove unused HooksManager
hooks are now organized by AlotConfigParser
issue #146
Diffstat (limited to 'alot')
-rwxr-xr-x | alot/init.py | 1 | ||||
-rw-r--r-- | alot/settings.py | 26 |
2 files changed, 0 insertions, 27 deletions
diff --git a/alot/init.py b/alot/init.py index 16d4d870..9627370f 100755 --- a/alot/init.py +++ b/alot/init.py @@ -68,7 +68,6 @@ def main(): # read notmuch config notmuchfile = os.path.expanduser(args.notmuchconfigfile) settings.notmuchconfig.read(notmuchfile) - settings.hooks.setup(settings.config.get('general', 'hooksfile')) # setup logging numeric_loglevel = getattr(logging, args.debug_level.upper(), None) diff --git a/alot/settings.py b/alot/settings.py index f7571dcb..29949730 100644 --- a/alot/settings.py +++ b/alot/settings.py @@ -157,38 +157,12 @@ class AlotConfigParser(FallbackConfigParser): return cmdline -class HookManager(object): - """can look up user defined hook code""" - def setup(self, hooksfile): - """read callables from `hooksfile`. - - :param hooksfile: path to a file containing python source - :type hooksfile: str - """ - hf = os.path.expanduser(hooksfile) - if os.path.isfile(hf): - try: - self.module = imp.load_source('hooks', hf) - except: - self.module = None - else: - self.module = {} - - def get(self, key): - """return hook (`callable`) identified by `key`""" - if self.module: - if key in self.module.__dict__: - return self.module.__dict__[key] - return None - - config = AlotConfigParser() config.read(os.path.join(os.path.dirname(__file__), 'defaults', 'alot.rc')) notmuchconfig = FallbackConfigParser() notmuchconfig.read(os.path.join(os.path.dirname(__file__), 'defaults', 'notmuch.rc')) -hooks = HookManager() mailcaps = mailcap.getcaps() |