Esempio n. 1
0
    def loadhooks():
        """Load all the hooks.

        | Globs over all the .py files in the hooks dir.
        | Skips file without the executable bit set
        | Imports the hooks into a dict
        """
        return hook.scan_for_hooks(dirname(__file__) + '/hooks')
Esempio n. 2
0
    def loadhooks():
        """Load all the hooks.

        | Globs over all the .py files in the hooks dir.
        | Skips file without the executable bit set
        | Imports the hooks into a dict
        """
        return hook.scan_for_hooks(dirname(__file__) + '/hooks')
Esempio n. 3
0
def load_modules(config, send=logging.error):
    modutils.init_aux(config['core'])
    modutils.init_groups(config['groups'])
    errored_commands = command.scan_for_commands('commands')
    if errored_commands:
        logging.error("Failed to load some commands.")
        for error in errored_commands:
            send("%s: %s" % error)
        return False
    errored_hooks = hook.scan_for_hooks('hooks')
    if errored_hooks:
        logging.error("Failed to reload some hooks.")
        for error in errored_hooks:
            send("%s: %s" % error)
        return False
    return True
Esempio n. 4
0
def load_modules(config, send=logging.error):
    modutils.init_aux(config['core'])
    modutils.init_groups(config['groups'])
    errored_commands = command.scan_for_commands('commands')
    if errored_commands:
        logging.error("Failed to load some commands.")
        for error in errored_commands:
            send("%s: %s" % error)
        return False
    errored_hooks = hook.scan_for_hooks('hooks')
    if errored_hooks:
        logging.error("Failed to reload some hooks.")
        for error in errored_hooks:
            send("%s: %s" % error)
        return False
    return True