예제 #1
0
파일: template.py 프로젝트: gipi/Richie
    def process_message(self, message, nick):
        """Create request object from recived message and process it"""

        # this object persists as it's processed by the bot subsystem.
        # if this requests generates a response, you will receive it along
        # with the response message in protocol_output(), which means you
        # can set arbitrary attributes and access them later, for example
        # a channel to send to for multi-channel protocols, etc.
        req = Request(message)

        # required for most modules
        req.nick = nick

        # some modules expect this to be set as well as logging facility
        req.channel = 'console'

        # force bot into addressed mode
        # many modules require the bot is addressed before triggering.
        req.addressed = True

        # this sets the above flag to true if the user addresses the bot,
        # as well as strips off the bots nick.
        self.checkAddressing(req)

        # pass to substem for final processing
        Madcow.process_message(self, req)
예제 #2
0
파일: irc.py 프로젝트: gipi/Richie
 def stop(self):
     Madcow.stop(self)
     log.info('[IRC] * Quitting IRC')
     message = self.config.irc.quitMessage
     if message is None:
         message = 'no reason'
     self.server.disconnect(message)
예제 #3
0
 def stop(self):
     Madcow.stop(self)
     self.log.info('[IRC] * Quitting IRC')
     message = settings.IRC_QUIT_MESSAGE
     if message is None:
         message = u'no reason'
     self.server.disconnect(message)
예제 #4
0
파일: irc.py 프로젝트: compbrain/madcow
 def stop(self):
     Madcow.stop(self)
     log.info(u'[IRC] * Quitting IRC')
     message = self.config.irc.quitMessage
     if message is None:
         message = u'no reason'
     self.server.disconnect(message)
예제 #5
0
파일: irc.py 프로젝트: seunboi4u/madcow
 def stop(self):
     Madcow.stop(self)
     self.log.info('[IRC] * Quitting IRC')
     message = settings.IRC_QUIT_MESSAGE
     if message is None:
         message = u'no reason'
     self.server.disconnect(message)
예제 #6
0
파일: template.py 프로젝트: gipi/Richie
    def process_message(self, message, nick):
        """Create request object from recived message and process it"""

        # this object persists as it's processed by the bot subsystem.
        # if this requests generates a response, you will receive it along
        # with the response message in protocol_output(), which means you
        # can set arbitrary attributes and access them later, for example
        # a channel to send to for multi-channel protocols, etc.
        req = Request(message)

        # required for most modules
        req.nick = nick

        # some modules expect this to be set as well as logging facility
        req.channel = 'console'

        # force bot into addressed mode
        # many modules require the bot is addressed before triggering.
        req.addressed = True

        # this sets the above flag to true if the user addresses the bot,
        # as well as strips off the bots nick.
        self.checkAddressing(req)

        # pass to substem for final processing
        Madcow.process_message(self, req)
예제 #7
0
파일: ipython.py 프로젝트: seunboi4u/madcow
 def process_message(self, message):
     """Create request object from recived message and process it"""
     req = Request(message=message)
     req.nick = os.environ['USER']
     req.channel = 'ipython'
     req.addressed = True
     self.check_addressing(req)
     Madcow.process_message(self, req)
예제 #8
0
파일: ipython.py 프로젝트: Havvy/madcow
 def process_message(self, message):
     """Create request object from recived message and process it"""
     req = Request(message=message)
     req.nick = os.environ['USER']
     req.channel = 'ipython'
     req.addressed = True
     self.check_addressing(req)
     Madcow.process_message(self, req)
예제 #9
0
파일: pysilc.py 프로젝트: Havvy/madcow
    def __init__(self, base, scheme=None):
        if scheme is None:
            scheme = COLOR_SCHEME
        Madcow.__init__(self, base, scheme=scheme)
        passphrase = settings.SILC_PASSPHRASE
        if not passphrase:
            passphrase = ''
        keys = silc.create_key_pair('silc.pub', 'silc.priv', passphrase=passphrase)
        nick = settings.BOTNAME
        silc.SilcClient.__init__(self, keys, nick, nick, nick)
        self.channels = settings.SILC_CHANNELS

        # throttling
        self.delay = settings.SILC_DELAY / float(1000)
        self.last_response = 0.0
예제 #10
0
    def __init__(self, base, scheme=None):
        if scheme is None:
            scheme = COLOR_SCHEME
        Madcow.__init__(self, base, scheme=scheme)
        passphrase = settings.SILC_PASSPHRASE
        if not passphrase:
            passphrase = ''
        keys = silc.create_key_pair('silc.pub',
                                    'silc.priv',
                                    passphrase=passphrase)
        nick = settings.BOTNAME
        silc.SilcClient.__init__(self, keys, nick, nick, nick)
        self.channels = settings.SILC_CHANNELS

        # throttling
        self.delay = settings.SILC_DELAY / float(1000)
        self.last_response = 0.0
예제 #11
0
파일: irc.py 프로젝트: gipi/Richie
    def __init__(self, config=None, dir=None):
        Madcow.__init__(self, config=config, dir=dir)

        self.colorlib = ColorLib('mirc')
        if log.root.level <= log.DEBUG:
            irclib.DEBUG = 1
        else:
            irclib.DEBUG = 0
        self.irc = irclib.IRC()
        self.server = self.irc.server()
        for event in self.events:
            log.info('[IRC] * Registering event: %s' % event)
            self.server.add_global_handler(
                event,
                getattr(self, 'on_' + event),
                0,
            )
        if self.config.irc.channels is not None:
            self.channels = self._delim.split(self.config.irc.channels)
        else:
            self.channels = []
        self.names = {}
        self.last_names_update = unix_time()
예제 #12
0
파일: irc.py 프로젝트: gipi/Richie
    def __init__(self, config=None, dir=None):
        Madcow.__init__(self, config=config, dir=dir)

        self.colorlib = ColorLib('mirc')
        if log.root.level <= log.DEBUG:
            irclib.DEBUG = 1
        else:
            irclib.DEBUG = 0
        self.irc = irclib.IRC()
        self.server = self.irc.server()
        for event in self.events:
            log.info('[IRC] * Registering event: %s' % event)
            self.server.add_global_handler(
                event,
                getattr(self, 'on_' + event),
                0,
            )
        if self.config.irc.channels is not None:
            self.channels = self._delim.split(self.config.irc.channels)
        else:
            self.channels = []
        self.names = {}
        self.last_names_update = unix_time()
예제 #13
0
파일: ipython.py 프로젝트: seunboi4u/madcow
 def stop(self):
     """Protocol-specific shutdown procedure"""
     Madcow.stop(self)
예제 #14
0
파일: template.py 프로젝트: gipi/Richie
 def __init__(self, config, dir):
     """Protocol-specific initializations"""
     Madcow.__init__(self, config, dir)
예제 #15
0
파일: cli.py 프로젝트: gipi/Richie
 def __init__(self, config=None, dir=None):
     self.colorlib = ColorLib('ansi')
     Madcow.__init__(self, config=config, dir=dir)
     self.user_nick = os.environ['USER']
     self.shell = Shell(polls=[self.check_response_queue])
     self.usageLines += self._cli_usage
예제 #16
0
 def __init__(self, config=None, dir=None):
     self.colorlib = ColorLib('ansi')
     Madcow.__init__(self, config=config, dir=dir)
     self.user_nick = os.environ['USER']
     self.shell = Shell(polls=[self.check_response_queue])
     self.usageLines += self._cli_usage
예제 #17
0
파일: template.py 프로젝트: gipi/Richie
 def __init__(self, config, dir):
     """Protocol-specific initializations"""
     Madcow.__init__(self, config, dir)
예제 #18
0
파일: template.py 프로젝트: gipi/Richie
 def stop(self):
     """Protocol-specific shutdown procedure"""
     Madcow.stop(self)