diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2010-09-30 00:49:54 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2010-09-30 00:49:54 (GMT) |
commit | 8d3ff09df6336701f9b7d9b99396364ca61c6d2b (patch) | |
tree | 6a14396798342314345f39083a2cdc9483024354 /meeting.py | |
parent | 853229f84bfe047c9b77a204248bf7f1238a6689 (diff) |
Allow dashes in command name
Diffstat (limited to 'meeting.py')
-rw-r--r-- | meeting.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -64,7 +64,7 @@ class Config(object): UrlProtocols = ('http:', 'https:', 'irc:', 'ftp:', 'mailto:', 'ssh:') # regular expression for parsing commands. First group is the cmd name, # second group is the rest of the line. - command_RE = re.compile(r'#([\w]+)[ \t]*(.*)') + command_RE = re.compile(r'#([\w-]+)[ \t]*(.*)') # The channels which won't have date/time appended to the filename. specialChannels = ("#meetbot-test", "#meetbot-test2") # HTML irc log highlighting style. `pygmentize -L styles` to list. @@ -480,7 +480,7 @@ class Meeting(MeetingCommands, object): matchobj = self.config.command_RE.match(line) if matchobj is not None: command, line = matchobj.groups() - command = command.lower() + command = ''.join([i for i in command.lower() if i != '-']) # to define new commands, define a method do_commandname . if hasattr(self, "do_"+command): getattr(self, "do_"+command)(nick=nick, line=line, |