def execute_new_frame_command(command_name, arguments): """Executes command and creates a new Frame object from server response""" #support for non-plugin methods that may not supply the full name if not command_name.startswith('frame'): command_name = 'frame/' + command_name command_request = CommandRequest(command_name, arguments) command_info = executor.issue(command_request) frame_info = FrameInfo(command_info.result) return Frame(_info=frame_info)
def execute_update_frame_command(command_name, arguments, frame): """Executes command and updates frame with server response""" #support for non-plugin methods that may not supply the full name if not command_name.startswith('frame'): command_name = 'frame/' + command_name command_request = CommandRequest(command_name, arguments) command_info = executor.issue(command_request) if command_info.result.has_key('schema'): initialize_frame(frame, FrameInfo(command_info.result)) return None if (command_info.result.has_key('value') and len(command_info.result) == 1): return command_info.result.get('value') return command_info.result