예제 #1
0
        if self.next:
            return elements.next(offset)
        else:
            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']))
예제 #2
0
        if RestructureDialog.history is not None:
            data = RestructureDialog.history
            self.pattern.insert('1.0', data['pattern'])
            self.goal.insert('1.0', data['goal'])
            self.args.insert('1.0', data['checks'])
            self.imports.insert('1.0', data['imports'])


def restructure(context):
    if check_project(context.core):
        RestructureDialog(context).show()


actions = []
core = ropeide.core.get_core()
core.add_menu_cascade(MenuAddress(['Refactor'], 'r'), ['python'])

actions.append(SimpleAction('rename', ConfirmEditorsAreSaved(rename), 'C-c r r',
                            MenuAddress(['Refactor', 'Rename'], 'r'), ['python']))
actions.append(SimpleAction('extract_method',
                            ConfirmEditorsAreSaved(extract_method, all=False), 'C-c r m',
                            MenuAddress(['Refactor', 'Extract Method'], 'm'), ['python']))
actions.append(SimpleAction('move', ConfirmEditorsAreSaved(move), 'C-c r v',
                            MenuAddress(['Refactor', 'Move'], 'v'), ['python']))
actions.append(SimpleAction('inline', ConfirmEditorsAreSaved(inline), 'C-c r i',
                            MenuAddress(['Refactor', 'Inline'], 'i'), ['python']))
actions.append(SimpleAction(
               'usefunction', ConfirmEditorsAreSaved(usefunction), 'C-c r u',
               MenuAddress(['Refactor', 'UseFunction'], 'u'), ['python']))
actions.append(SimpleAction('extract_local_variable',
                            ConfirmEditorsAreSaved(extract_variable, all=False), 'C-c r l',
예제 #3
0
        history = context.project.history
        if not history.redo_list:
            return
        @simple_stoppable('Redo Change', interrupts=False)
        def redo(handle):
            history.redo(task_handle=handle)
        _confirm_action(
            'Redoing Project Change',
            'Redoing <%s>\n\n' % str(history.redo_list[-1]) +
            'Redo project might change many files. Proceed?', redo)

def exit_rope(context):
    context.get_core()._close_project_and_exit()

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

actions.append(SimpleAction('open_project', open_project, 'C-x C-p',
                            MenuAddress(['File', 'Open Project...'], 'o')))
actions.append(SimpleAction('close_project', close_project, 'C-x p k',
                            MenuAddress(['File', 'Close Project'], 'l')))

actions.append(SimpleAction('find_file', find_file, 'C-x C-f',
                            MenuAddress(['File', 'Find File...'], 'f', 1)))
core.add_menu_cascade(MenuAddress(['File', 'New'], 'n', 1), ['all', 'none'])
actions.append(SimpleAction('create_file', create_file, 'C-x n f',
                            MenuAddress(['File', 'New', 'New File...'], 'f')))
actions.append(SimpleAction('create_folder', create_folder, 'C-x n d',
                            MenuAddress(['File', 'New', 'New Directory...'], 'd')))
actions.append(SimpleAction('create_module', create_module, 'C-x n m',
예제 #4
0
    

def _generate_sort_actions(menu):
    for name in _sort_mapping.values():
        c = name[0].lower()
        sorter = ropeide.sort.get_sorter(name)
        action_name = 'sort_by_' + name
        menu_name = str(sorter)
        yield SimpleAction(
            action_name, lambda context, c=c: sort_scopes(context, c),
            'C-c s ' + c,
            menu.child(menu_name.title(), c), ['python'])


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

actions.append(SimpleAction('code_assist', DoCodeAssist(), 'M-/',
                            MenuAddress(['Source', 'Code Assist (Auto-Complete)'], 'c'), ['python']))
actions.append(SimpleAction('goto_definition', do_goto_definition, 'C-c g',
                            MenuAddress(['Source', 'Goto Definition'], 'd'), ['python']))
actions.append(SimpleAction('show_doc', do_show_doc, 'C-c C-d',
                            MenuAddress(['Source', 'Show Doc'], 's'), ['python']))
actions.append(SimpleAction('quick_outline', do_quick_outline, 'C-c C-o',
                            MenuAddress(['Source', 'Quick Outline'], 'q'), ['python']))
actions.append(SimpleAction('find_occurrences', find_occurrences, 'C-c C-s',
                            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),
예제 #5
0
def show_tutorial(context):
    show_doc(context, 'docs/tutorial.txt')

def show_contributing(context):
    show_doc(context, 'docs/contributing.txt')

def show_library(context):
    show_doc(context, 'docs/library.txt')

def show_copying(context):
    show_doc(context, 'COPYING')


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

actions.append(SimpleAction('readme', show_readme, 'C-h r',
                            MenuAddress(['Help', 'Ropeide Readme'], 'r')))
actions.append(SimpleAction('features', show_features, 'C-h f',
                            MenuAddress(['Help', 'Rope Features'], 'f')))
actions.append(SimpleAction('overview', show_overview, 'C-h o',
                            MenuAddress(['Help', 'Rope Overview'], 'o')))
actions.append(SimpleAction('tutorial', show_tutorial, 'C-h t',
                            MenuAddress(['Help', 'Ropeide Tutorial'], 't')))

actions.append(SimpleAction('contributing', show_contributing, 'C-h c',
                            MenuAddress(['Help', 'Contributing'], 'n', 1)))
actions.append(SimpleAction('library', show_library, 'C-h l',
                            MenuAddress(['Help', 'Using Rope As A Library'],