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')
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