summaryrefslogtreecommitdiff
path: root/alot/commands
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-12-11 15:38:05 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2011-12-11 15:38:05 +0000
commit11320f095eff59e5fd266c747d6d2d4a2cd96637 (patch)
treebd971b418813bffa9f376f5748db75a95f29227b /alot/commands
parent8a54c31255fa29a7a441db4e3ae750e09717705f (diff)
move hook lookups to AlotConfigParser
issue #146
Diffstat (limited to 'alot/commands')
-rw-r--r--alot/commands/__init__.py4
-rw-r--r--alot/commands/envelope.py4
-rw-r--r--alot/commands/thread.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/alot/commands/__init__.py b/alot/commands/__init__.py
index 2fbb8552..76ba0e0c 100644
--- a/alot/commands/__init__.py
+++ b/alot/commands/__init__.py
@@ -191,8 +191,8 @@ def commandfactory(cmdline, mode='global'):
parms.update(forcedparms)
logging.debug('PARMS: %s' % parms)
- parms['prehook'] = alot.settings.hooks.get('pre_' + cmdname)
- parms['posthook'] = alot.settings.hooks.get('post_' + cmdname)
+ parms['prehook'] = alot.settings.config.get_hook('pre_' + cmdname)
+ parms['posthook'] = alot.settings.config.get_hook('post_' + cmdname)
logging.debug('cmd parms %s' % parms)
return cmdclass(**parms)
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 94a2e58d..2597e9de 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -166,7 +166,7 @@ class EditCommand(Command):
f.close()
# call post-edit translate hook
- translate = settings.hooks.get('post_edit_translate')
+ translate = settings.config.get_hook('post_edit_translate')
if translate:
template = translate(template, ui=ui, dbm=ui.dbman,
aman=ui.accountman, log=ui.logger,
@@ -187,7 +187,7 @@ class EditCommand(Command):
bodytext = self.envelope.body
# call pre-edit translate hook
- translate = settings.hooks.get('pre_edit_translate')
+ translate = settings.config.get_hook('pre_edit_translate')
if translate:
bodytext = translate(bodytext, ui=ui, dbm=ui.dbman,
aman=ui.accountman, log=ui.logger,
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index 60984f88..464fb91a 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -42,7 +42,7 @@ class ReplyCommand(Command):
# set body text
name, address = self.message.get_author()
timestamp = self.message.get_date()
- qf = settings.hooks.get('reply_prefix')
+ qf = settings.config.get_hook('reply_prefix')
if qf:
quotestring = qf(name, address, timestamp,
ui=ui, dbm=ui.dbman, aman=ui.accountman,
@@ -146,7 +146,7 @@ class ForwardCommand(Command):
# set body text
name, address = self.message.get_author()
timestamp = self.message.get_date()
- qf = settings.hooks.get('forward_prefix')
+ qf = settings.config.get_hook('forward_prefix')
if qf:
quote = qf(name, address, timestamp,
ui=ui, dbm=ui.dbman, aman=ui.accountman,