Exemple #1
0
    def run_keyword_hooks(self, message, private):
        """Run keyword hooks"""
        words = message.split(" ")

        for mod_name, f, kw in plugin.hook_get_keywords():
            for word in words:
                m = re.search("^%s(.+)" % kw, word, re.I)
                if m:
                    self.run_hook_command(mod_name, f, m.group(1),
                            private=private, full_message=message)
Exemple #2
0
    def _find_doc_string(self, params):
        """Find the doc string for a command or keyword hook"""
        for _, cmd_hook, cmd in plugin.hook_get_commands():
            if cmd.upper() == params.upper():
                return cmd_hook.__doc__

        for _, kw_hook, kw in plugin.hook_get_keywords():
            if kw.upper() == params.upper():
                return kw_hook.__doc__

        return None
Exemple #3
0
    def _find_doc_string(self, params):
        """Find the doc string for a plugin, command or keyword hook"""
        for p in plugin.active_plugin_classes():
            if p.__name__.upper() == params.upper():
                return p.__doc__

        for _, cmd_hook, cmd in plugin.hook_get_commands():
            if cmd.upper() == params.upper():
                return cmd_hook.__doc__

        for _, kw_hook, kw in plugin.hook_get_keywords():
            if kw.upper() == params.upper():
                return kw_hook.__doc__

        return None
Exemple #4
0
    def _find_doc_string(self, params):
        """Find the doc string for a plugin, command or keyword hook"""
        for p in plugin.active_plugin_classes():
            if p.__name__.upper() == params.upper():
                return p.__doc__

        for _, cmd_hook, cmd in plugin.hook_get_commands():
            if cmd.upper() == params.upper():
                return cmd_hook.__doc__

        for _, kw_hook, kw in plugin.hook_get_keywords():
            if kw.upper() == params.upper():
                return kw_hook.__doc__

        return None