def process_commands(input_obj, commands):
    logging.debug('Processing commands')
    hook_plugins = []
    command_plugins = []
    load_plugins(hook_plugins, command_plugins)
    for command_str in commands:
        for plugin in command_plugins:
            if (command_str in plugin.names):
                for hook in hook_plugins:
                    hook.before_handle(input_obj, plugin)
                input_obj = plugin.handle(input_obj)
                for hook in hook_plugins:
                    hook.after_handle(input_obj, plugin)
def process_commands(input_obj, commands):
    logging.debug('Processing commands')
    hook_plugins = []
    command_plugins = []
    load_plugins(hook_plugins, command_plugins)
    for command_str in commands:
        for plugin in command_plugins:
            if (command_str in plugin.names):
                for hook in hook_plugins:
                    hook.before_handle(input_obj, plugin)
                input_obj = plugin.handle(input_obj)
                for hook in hook_plugins:
                    hook.after_handle(input_obj, plugin)