def insert_text(textString, styleString = None): cmd = archyState.commandMap.findSystemCommand( 'AddText') cmd.setinfo(textString, styleString) execute_and_record_command(cmd)
def set_selection_list(selections): cmd = archyState.commandMap.findSystemCommand( 'SetSelectionList') cmd.setinfo(selections) execute_and_record_command(cmd)
def set_style(**styles): import commands.style_editing style = commands.style_editing.StyleCommand(**styles) execute_and_record_command(style)
def set_cursor(pos): cmd = archyState.commandMap.findSystemCommand( 'SetCursor') cmd.setinfo(pos) execute_and_record_command(cmd)
def leap_backward(target): cmd = archyState.commandMap.findSystemCommand( 'LEAP backward to:' ) cmd.setinfo(target) execute_and_record_command(cmd)
def creep_backward(): cmd = archyState.commandMap.findSystemCommand( 'CreepRight') execute_and_record_command(cmd)
def creep_forward(): cmd = archyState.commandMap.findSystemCommand( 'CreepLeft') execute_and_record_command(cmd)
def delete_selection(addToDeletionsDocument = 1): cmd = archyState.commandMap.findSystemCommand( 'DeleteText' ) cmd.setinfo(addToDeletionsDocument) execute_and_record_command(cmd)
def run_command(commandName): # TO DO: Fix this when commandMap is worked out. cmd = archyState.commandMap.findCommand(commandName) execute_and_record_command(cmd)
def select(): cmd = archyState.commandMap.findSystemCommand( 'Select') execute_and_record_command(cmd)
def set_selection(selectionName, start, end): cmd = archyState.commandMap.findSystemCommand( 'SetSelection') cmd.setinfo( selectionName, start, end) execute_and_record_command(cmd)