Example #1
0
                            MenuAddress(['Refactor', 'Inline Argument Default'], 'd', 1),
                            ['python']))
actions.append(SimpleAction('rename_current_module',
                            ConfirmEditorsAreSaved(rename_module), 'C-c r 1 r',
                            MenuAddress(['Refactor', 'Rename Current Module'], None, 1),
                            ['python']))
actions.append(SimpleAction('move_current_module',
                            ConfirmEditorsAreSaved(move_module), 'C-c r 1 v',
                            MenuAddress(['Refactor', 'Move Current Module'], None, 1),
                            ['python']))
actions.append(SimpleAction('module_to_package',
                            ConfirmEditorsAreSaved(transform_module_to_package), 'C-c r 1 p',
                            MenuAddress(['Refactor', 'Transform Module to Package'], 't', 1),
                            ['python']))

imports = MenuAddress(['Refactor', 'Imports'], 'o', 2)
core.add_menu_cascade(imports, ['python'])
actions.append(SimpleAction('organize_imports',
                            ConfirmEditorsAreSaved(organize_imports, all=False), 'C-c i o',
                            imports.child('Organize Imports', 'o'), ['python']))
actions.append(SimpleAction('expand_star_imports',
                            ConfirmEditorsAreSaved(expand_star_imports, all=False), 'C-c i x',
                            imports.child('Expand Star Imports', 'x'),
                            ['python']))
actions.append(SimpleAction('relatives_to_absolutes',
                            ConfirmEditorsAreSaved(transform_relatives_to_absolute, all=False), 'C-c i a',
                            imports.child('Transform Relatives to Absolute', 'a'), ['python']))
actions.append(SimpleAction('froms_to_imports',
                            ConfirmEditorsAreSaved(transform_froms_to_imports, all=False), 'C-c i i',
                            imports.child('Transform Froms to Imports', 'i'), ['python']))
actions.append(SimpleAction('handle_long_imports',
Example #2
0
            return elements.prev(offset)

def indent_block(context):
    if context.get_active_editor():
        context.editor.indent_block()

def deindent_block(context):
    if context.get_active_editor():
        context.editor.deindent_block()


core = ropeide.core.Core.get_core()
core.add_menu_cascade(MenuAddress(['Edit'], 'e'), ['all', 'none'])
actions = []

others = MenuAddress(['Edit', 'Others'], 'o', 0)
core.add_menu_cascade(others, ['all'])

actions.append(SimpleAction('indent_block', indent_block, 'C-x i',
                            MenuAddress(['Edit', 'Indent Block'], 'i',4), ['all','none']))

actions.append(SimpleAction('deindent_block', deindent_block, 'C-x d',
                            MenuAddress(['Edit', 'De-indent Block'], 'd',4), ['all','none']))



actions.append(SimpleAction('next_word', next_word, 'M-f',
                            others.child('Next Word'), ['all']))
actions.append(SimpleAction('prev_word', prev_word, 'M-b',
                            others.child('Prev Word'), ['all']))
actions.append(SimpleAction('goto_center_line', goto_center_line, 'M-r',
                            MenuAddress(['Source', 'Find Occurrences'], 'f'), ['python']))

actions.append(SimpleAction('correct_line_indentation', do_correct_line_indentation, 'C-i',
                            MenuAddress(['Source', 'Correct Line Indentation'], 'i', 1),
                            ['python', 'rst']))
actions.append(SimpleAction('format_code', do_format_code, 'C-c C-f',
                            MenuAddress(['Source', 'Remove Extra Spaces And Lines'], None, 1),
                            ['python']))
actions.append(SimpleAction('comment_line', comment_line, 'C-c c',
                            MenuAddress(['Source', 'Comment Line'], 'e', 1),
                            ['python']))
actions.append(SimpleAction('comment_region', comment_region, 'C-c C-c',
                            MenuAddress(['Source', 'Comment Region'], 'n', 1),
                            ['python']))

run = MenuAddress(['Source', 'Run'], 'r', 2)
core.add_menu_cascade(run, ['python'])
actions.append(SimpleAction('run_module', do_run_module, 'C-c x p',
                            run.child('Run Module', 'm'), ['python']))
actions.append(SimpleAction('run_unit_tests', run_tests, 'C-c x t',
                            run.child('Run Unit Tests', 't'), ['python']))
actions.append(SimpleAction('run_soi', run_soi, 'C-c x s',
                            run.child('Run SOI On Module', 's'), ['python']))

annotes = MenuAddress(['Source', 'Annotations'], 'a', 2)
core.add_menu_cascade(annotes, ['python'])
actions.append(SimpleAction('show_codetags', show_codetags, 'C-c a t',
                            annotes.child('Show Codetags', 'c'), ['python']))
actions.append(SimpleAction('show_errors', show_errors, 'C-c a e',
                            annotes.child('Show Errors', 'e'), ['python']))
actions.append(SimpleAction('show_warnings', show_warnings, 'C-c a w',