diff options
author | tv <tv@nomic.retiolum> | 2014-04-25 13:34:04 +0200 |
---|---|---|
committer | tv <tv@nomic.retiolum> | 2014-04-25 13:34:04 +0200 |
commit | 7bf0b790b95d97d33e57a4e52cf7681bc6366d98 (patch) | |
tree | b8c2914c7ae79c789251c1be79cf57f1709c9853 /Reaktor/config.py | |
parent | e1571b5a5cda983234cd6d5c4998ab883cc46115 (diff) |
reaktor: move config_filename to config
Diffstat (limited to 'Reaktor/config.py')
-rw-r--r-- | Reaktor/config.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Reaktor/config.py b/Reaktor/config.py index 90540340..7f3f9c40 100644 --- a/Reaktor/config.py +++ b/Reaktor/config.py @@ -1,4 +1,4 @@ -from os.path import expanduser +from os.path import abspath, expanduser import re debug = True @@ -20,18 +20,24 @@ irc_channels = [ admin_file='admin.lst' auth_file='auth.lst' +config_filename = abspath(__file__) + # me is used, so name cannot kill our patterns below me = '\\b' + re.escape(name) + '\\b' me_or_us = '(?:' + me + '|\\*)' -def default_command(cmd): +def default_command(cmd, env={}): return { 'capname': cmd, 'pattern': '^' + me_or_us + ':\\s*' + cmd + '\\s*(?:\\s+(?P<args>.*))?$', - 'argv': [ 'commands/' + cmd ] } + 'argv': [ 'commands/' + cmd ], + 'env': env + } public_commands = [ - default_command('caps'), + default_command('caps', env={ + 'config_filename': config_filename + }), default_command('hello'), default_command('badcommand'), default_command('rev'), |