コード例 #1
0
ファイル: handler.py プロジェクト: nwatson/cslbot
    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')
コード例 #2
0
ファイル: handler.py プロジェクト: theycallmezeal/cslbot
    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')
コード例 #3
0
ファイル: reloader.py プロジェクト: Polarcraft/KbveBot
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
コード例 #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