def execute(env, user, line, allowdefault=True): for component in user.CLIENT_COMPONENTS: action = component.parser(syntax.expand(env, user, line)) if action: component.run(env, user, action) break else: if allowdefault: execute(env, user, user.DEFAULT_ACTION(line), False) else: print "Error: Cannot recurse default actions"
def command(self, env, user, text): for component in user.CLIENT_COMPONENTS: action = component.parser(syntax.expand(env, user, text)) if action: component.run(env, user, action)