Пример #1
0
class Calculate(object):
    def __init__(self, server, appid):
        self.source = MathApi(appid)
        xmap(server, 'CMSG', self.calculate)
    
    @regcmd('@calc (?P<exp>.+)$')
    def calculate(self, server, nick, user, host, target, msg, exp):
        send_msg(server, target, self.source.submit(exp))
Пример #2
0
 def __init__(self, server, appid):
     self.source = MathApi(appid)
     xmap(server, 'CMSG', self.calculate)