Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 15 lines (12 sloc) 0.557 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
import re

class CommandModule:
    def __init__(self):
        self.commandList = dict()
        self.regexSplitCommand = re.compile(r"!!(?P<command>\w+)\s(?P<arguments>.*).*")

    def runCommand(self, command, messageInfo):
        split = self.regexSplitCommand.match(command)
        if split:
            commandName = split.group('command')
            commandArguments = split.group('arguments')
            if self.commandList.has_key(commandName):
                self.commandList[commandName].onRun(commandArguments, messageInfo)

Something went wrong with that request. Please try again.