From 8d3ff09df6336701f9b7d9b99396364ca61c6d2b Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 30 Sep 2010 00:49:54 +0000 Subject: Allow dashes in command name --- diff --git a/meeting.py b/meeting.py index 9ecce97..c9f86be 100644 --- a/meeting.py +++ b/meeting.py @@ -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, -- cgit v0.9.1