コード例 #1
0
ファイル: shell.py プロジェクト: ShenggaoZhu/spyder
 def create_shortcuts(self):
     fixed_shortcut(SHORTCUT_INLINE, self, lambda: self.enter_array_inline())
     fixed_shortcut(SHORTCUT_TABLE, self, lambda: self.enter_array_table())
     inspectsc = config_shortcut(self.inspect_current_object,
                                 context='Console',
                                 name='Inspect current object',
                                 parent=self)
     return [inspectsc]
コード例 #2
0
 def register_plugin(self):
     """Register plugin in Spyder's main window."""
     autopep8_act = create_action(self.main,
                                  _("Run autopep8 code autoformatting"),
                                  icon=self.get_plugin_icon(),
                                  triggered=self.run_autopep8)
     fixed_shortcut("Shift+F8", self.main, self.run_autopep8)
     self.main.source_menu_actions += [None, autopep8_act]
     self.main.editor.pythonfile_dependent_actions += [autopep8_act]
コード例 #3
0
 def create_shortcuts(self):
     fixed_shortcut(SHORTCUT_INLINE, self,
                    lambda: self.enter_array_inline())
     fixed_shortcut(SHORTCUT_TABLE, self, lambda: self.enter_array_table())
     inspectsc = config_shortcut(self.inspect_current_object,
                                 context='Console',
                                 name='Inspect current object',
                                 parent=self)
     return [inspectsc]
コード例 #4
0
 def register_plugin(self):
     """Register plugin in Spyder's main window."""
     autopep8_act = create_action(
         self.main, _("Run autopep8 code autoformatting"),
         icon=self.get_plugin_icon(),
         triggered=self.run_autopep8)
     fixed_shortcut("Shift+F8", self.main,
                    self.run_autopep8)
     self.main.source_menu_actions += [None, autopep8_act]
     self.main.editor.pythonfile_dependent_actions += [autopep8_act]
コード例 #5
0
 def register_plugin(self):
     """Register plugin in Spyder's main window."""
     black_act = create_action(
         self.main,
         _("Format code using Black"),
         icon=self.get_plugin_icon(),
         triggered=self.run_black,
     )
     fixed_shortcut("Shift+F5", self.main, self.run_black)
     self.main.source_menu_actions += [None, black_act]
     self.main.editor.pythonfile_dependent_actions += [black_act]
コード例 #6
0
ファイル: dataframeeditor.py プロジェクト: ShenggaoZhu/spyder
    def __init__(self, parent, model):
        QTableView.__init__(self, parent)
        self.setModel(model)

        self.sort_old = [None]
        self.header_class = self.horizontalHeader()
        self.header_class.sectionClicked.connect(self.sortByColumn)
        self.menu = self.setup_menu()
        fixed_shortcut(QKeySequence.Copy, self, self.copy)
        self.horizontalScrollBar().valueChanged.connect(
                            lambda val: self.load_more_data(val, columns=True))
        self.verticalScrollBar().valueChanged.connect(
                               lambda val: self.load_more_data(val, rows=True))
コード例 #7
0
    def __init__(self, parent, model):
        QTableView.__init__(self, parent)
        self.setModel(model)

        self.sort_old = [None]
        self.header_class = self.horizontalHeader()
        self.header_class.sectionClicked.connect(self.sortByColumn)
        self.menu = self.setup_menu()
        fixed_shortcut(QKeySequence.Copy, self, self.copy)
        self.horizontalScrollBar().valueChanged.connect(
            lambda val: self.load_more_data(val, columns=True))
        self.verticalScrollBar().valueChanged.connect(
            lambda val: self.load_more_data(val, rows=True))
コード例 #8
0
ファイル: arrayeditor.py プロジェクト: jitseniesen/spyder
    def __init__(self, parent, model, dtype, shape):
        QTableView.__init__(self, parent)

        self.setModel(model)
        self.setItemDelegate(ArrayDelegate(dtype, self))
        total_width = 0
        for k in range(shape[1]):
            total_width += self.columnWidth(k)
        self.viewport().resize(min(total_width, 1024), self.height())
        self.shape = shape
        self.menu = self.setup_menu()
        fixed_shortcut(QKeySequence.Copy, self, self.copy)
        self.horizontalScrollBar().valueChanged.connect(lambda val: self.load_more_data(val, columns=True))
        self.verticalScrollBar().valueChanged.connect(lambda val: self.load_more_data(val, rows=True))
コード例 #9
0
    def register_plugin(self):
        """Register plugin in Spyder's main window."""
        self.edit_goto.connect(self.main.editor.load)
        self.redirect_stdio.connect(self.main.redirect_internalshell_stdio)
        self.main.add_dockwidget(self)

        lineprofiler_act = create_action(self, _("Profile line by line"),
                                         icon=self.get_plugin_icon(),
                                         triggered=self.run_lineprofiler)
        lineprofiler_act.setEnabled(is_lineprofiler_installed())
        fixed_shortcut("Shift+F10", self.main,
                       self.run_lineprofiler)

        self.main.run_menu_actions += [lineprofiler_act]
        self.main.editor.pythonfile_dependent_actions += [lineprofiler_act]
コード例 #10
0
    def register_plugin(self):
        """Register plugin in Spyder's main window"""
        self.edit_goto.connect(self.main.editor.load)
        self.redirect_stdio.connect(self.main.redirect_internalshell_stdio)
        self.main.add_dockwidget(self)

        unittesting_act = create_action(self, _("Run unit tests"),
                                        icon=ima.icon('profiler'),
                                        triggered=self.run_unittesting)
        unittesting_act.setEnabled(is_unittesting_installed())
        fixed_shortcut("Ctrl+Shift+F11", self.main,
                       self.run_unittesting)

        self.main.run_menu_actions += [unittesting_act]
        self.main.editor.pythonfile_dependent_actions += [unittesting_act]
コード例 #11
0
    def register_plugin(self):
        """Register plugin in Spyder's main window."""
        self.edit_goto.connect(self.main.editor.load)
        self.redirect_stdio.connect(self.main.redirect_internalshell_stdio)
        self.main.add_dockwidget(self)

        memoryprofiler_act = create_action(self,
                                           _("Profile memory line by line"),
                                           icon=self.get_plugin_icon(),
                                           triggered=self.run_memoryprofiler)
        memoryprofiler_act.setEnabled(is_memoryprofiler_installed())
        fixed_shortcut("Ctrl+Shift+F10", self.main, self.run_memoryprofiler)

        self.main.run_menu_actions += [memoryprofiler_act]
        self.main.editor.pythonfile_dependent_actions += [memoryprofiler_act]
コード例 #12
0
ファイル: findreplace.py プロジェクト: ShenggaoZhu/spyder
    def create_shortcuts(self, parent):
        """Create shortcuts for this widget"""
        # Configurable
        findnext = config_shortcut(self.find_next, context='_',
                                   name='Find next', parent=parent)
        findprev = config_shortcut(self.find_previous, context='_',
                                   name='Find previous', parent=parent)
        togglefind = config_shortcut(self.show, context='_',
                                     name='Find text', parent=parent)
        togglereplace = config_shortcut(self.toggle_replace_widgets,
                                        context='_', name='Replace text',
                                        parent=parent)
        # Fixed
        fixed_shortcut("Escape", self, self.hide)

        return [findnext, findprev, togglefind, togglereplace]
コード例 #13
0
    def __init__(self, parent, model, dtype, shape):
        QTableView.__init__(self, parent)

        self.setModel(model)
        self.setItemDelegate(ArrayDelegate(dtype, self))
        total_width = 0
        for k in range(shape[1]):
            total_width += self.columnWidth(k)
        self.viewport().resize(min(total_width, 1024), self.height())
        self.shape = shape
        self.menu = self.setup_menu()
        fixed_shortcut(QKeySequence.Copy, self, self.copy)
        self.horizontalScrollBar().valueChanged.connect(
                            lambda val: self.load_more_data(val, columns=True))
        self.verticalScrollBar().valueChanged.connect(
                               lambda val: self.load_more_data(val, rows=True))
コード例 #14
0
ファイル: tabs.py プロジェクト: jitseniesen/spyder
    def __init__(self, parent, actions=None, menu=None, corner_widgets=None, menu_use_tooltips=False):
        BaseTabs.__init__(self, parent, actions, menu, corner_widgets, menu_use_tooltips)
        tab_bar = TabBar(self, parent)
        tab_bar.sig_move_tab.connect(self.move_tab)
        tab_bar.sig_move_tab[(str, int, int)].connect(self.move_tab_from_another_tabwidget)
        self.setTabBar(tab_bar)

        fixed_shortcut("Ctrl+Tab", parent, lambda: self.tab_navigate(1))
        fixed_shortcut("Shift+Ctrl+Tab", parent, lambda: self.tab_navigate(-1))
        fixed_shortcut("Ctrl+W", parent, lambda: self.sig_close_tab.emit(self.currentIndex()))
        fixed_shortcut("Ctrl+F4", parent, lambda: self.sig_close_tab.emit(self.currentIndex()))
コード例 #15
0
ファイル: shell.py プロジェクト: silentquasar/spyder
    def create_shortcuts(self):
        inspect = config_shortcut(
            self._control.inspect_current_object, context="Console", name="Inspect current object", parent=self
        )
        clear_console = config_shortcut(self.clear_console, context="Console", name="Clear shell", parent=self)

        # Fixed shortcuts
        fixed_shortcut("Ctrl+T", self, lambda: self.new_client.emit())
        fixed_shortcut("Ctrl+Alt+R", self, lambda: self.reset_namespace())
        fixed_shortcut(SHORTCUT_INLINE, self, lambda: self._control.enter_array_inline())
        fixed_shortcut(SHORTCUT_TABLE, self, lambda: self._control.enter_array_table())

        return [inspect, clear_console]
コード例 #16
0
    def create_shortcuts(self):
        inspect = config_shortcut(self._control.inspect_current_object,
                                  context='Console', name='Inspect current object',
                                  parent=self)
        clear_console = config_shortcut(self.clear_console, context='Console',
                                        name='Clear shell', parent=self)

        # Fixed shortcuts
        fixed_shortcut("Ctrl+T", self, lambda: self.new_client.emit())
        fixed_shortcut("Ctrl+R", self, lambda: self.reset_namespace())
        fixed_shortcut(SHORTCUT_INLINE, self,
                       lambda: self._control.enter_array_inline())
        fixed_shortcut(SHORTCUT_TABLE, self,
                       lambda: self._control.enter_array_table())

        return [inspect, clear_console]
コード例 #17
0
    def create_shortcuts(self, parent):
        """Create shortcuts for this widget"""
        # Configurable
        findnext = config_shortcut(self.find_next,
                                   context='_',
                                   name='Find next',
                                   parent=parent)
        findprev = config_shortcut(self.find_previous,
                                   context='_',
                                   name='Find previous',
                                   parent=parent)
        togglefind = config_shortcut(self.show,
                                     context='_',
                                     name='Find text',
                                     parent=parent)
        togglereplace = config_shortcut(self.toggle_replace_widgets,
                                        context='_',
                                        name='Replace text',
                                        parent=parent)
        # Fixed
        fixed_shortcut("Escape", self, self.hide)

        return [findnext, findprev, togglefind, togglereplace]
コード例 #18
0
    def __init__(self,
                 parent,
                 actions=None,
                 menu=None,
                 corner_widgets=None,
                 menu_use_tooltips=False):
        BaseTabs.__init__(self, parent, actions, menu, corner_widgets,
                          menu_use_tooltips)
        tab_bar = TabBar(self, parent)
        tab_bar.sig_move_tab.connect(self.move_tab)
        tab_bar.sig_move_tab[(str, int, int)].connect(
            self.move_tab_from_another_tabwidget)
        self.setTabBar(tab_bar)

        fixed_shortcut("Ctrl+Tab", parent, lambda: self.tab_navigate(1))
        fixed_shortcut("Shift+Ctrl+Tab", parent, lambda: self.tab_navigate(-1))
        fixed_shortcut("Ctrl+W", parent,
                       lambda: self.sig_close_tab.emit(self.currentIndex()))
        fixed_shortcut("Ctrl+F4", parent,
                       lambda: self.sig_close_tab.emit(self.currentIndex()))
コード例 #19
0
ファイル: vim.py プロジェクト: Nodd/spyder.vim
 def register_plugin(self):
     """Register plugin in Spyder's main window"""
     self.editor_widget.layout().addWidget(self)
     fixed_shortcut("Esc", self.editor_widget.editorsplitter,
                    self.commandline.setFocus)
コード例 #20
0
ファイル: vim.py プロジェクト: Nodd/spyder.vim
 def register_plugin(self):
     """Register plugin in Spyder's main window"""
     self.editor_widget.layout().addWidget(self)
     fixed_shortcut("Esc", self.editor_widget.editorsplitter,
                    self.commandline.setFocus)
コード例 #21
0
 def register_plugin(self):
     """Register plugin in Spyder's main window."""
     self.focus_changed.connect(self.main.plugin_focus_changed)
     self.vim_cmd.editor_widget.layout().addWidget(self.vim_cmd)
     fixed_shortcut("Esc", self.vim_cmd.editor_widget.editorsplitter,
                    self.vim_cmd.commandline.setFocus)