def loadmodules(): """Load all the commands. | Globs over all the .py files in the commands dir. | Skips file without the executable bit set | Imports the modules into a dict """ command.scan_for_commands(dirname(__file__) + '/commands')
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