Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def data(self, index, role=Qt.DisplayRole): if not index.isValid(): return to_qvariant() if role == Qt.DisplayRole: return self._display_data(index) elif role == Qt.BackgroundColorRole: return to_qva...
[ "Return a model data element" ]
Please provide a description of the function:def parse_data_type(self, index, **kwargs): if not index.isValid(): return False try: if kwargs['atype'] == "date": self._data[index.row()][index.column()] = \ datestr_to_datetime(sel...
[ "Parse a type to an other type" ]
Please provide a description of the function:def _shape_text(self, text, colsep=u"\t", rowsep=u"\n", transpose=False, skiprows=0, comments='#'): assert colsep != rowsep out = [] text_rows = text.split(rowsep)[skiprows:] for row in text_rows: ...
[ "Decode the shape of the given text" ]
Please provide a description of the function:def process_data(self, text, colsep=u"\t", rowsep=u"\n", transpose=False, skiprows=0, comments='#'): data = self._shape_text(text, colsep, rowsep, transpose, skiprows, comments) self._model = ...
[ "Put data into table model" ]
Please provide a description of the function:def parse_to_type(self,**kwargs): indexes = self.selectedIndexes() if not indexes: return for index in indexes: self.model().parse_data_type(index, **kwargs)
[ "Parse to a given type" ]
Please provide a description of the function:def contextMenuEvent(self, event): self.opt_menu.popup(event.globalPos()) event.accept()
[ "Reimplement Qt method" ]
Please provide a description of the function:def open_data(self, text, colsep=u"\t", rowsep=u"\n", transpose=False, skiprows=0, comments='#'): if pd: self.pd_text = text self.pd_info = dict(sep=colsep, lineterminator=rowsep, skiprows=skipr...
[ "Open clipboard text as table" ]
Please provide a description of the function:def _focus_tab(self, tab_idx): for i in range(self.tab_widget.count()): self.tab_widget.setTabEnabled(i, False) self.tab_widget.setTabEnabled(tab_idx, True) self.tab_widget.setCurrentIndex(tab_idx)
[ "Change tab focus" ]
Please provide a description of the function:def _set_step(self, step): new_tab = self.tab_widget.currentIndex() + step assert new_tab < self.tab_widget.count() and new_tab >= 0 if new_tab == self.tab_widget.count()-1: try: self.table_widget.open_data(s...
[ "Proceed to a given step" ]
Please provide a description of the function:def _simplify_shape(self, alist, rec=0): if rec != 0: if len(alist) == 1: return alist[-1] return alist if len(alist) == 1: return self._simplify_shape(alist[-1], 1) return [self._si...
[ "Reduce the alist dimension if needed" ]
Please provide a description of the function:def _get_table_data(self): data = self._simplify_shape( self.table_widget.get_data()) if self.table_widget.array_btn.isChecked(): return array(data) elif pd and self.table_widget.df_btn.isChecked(): ...
[ "Return clipboard processed as data" ]
Please provide a description of the function:def process(self): var_name = self.name_edt.text() try: self.var_name = str(var_name) except UnicodeEncodeError: self.var_name = to_text_string(var_name) if self.text_widget.get_as_data(): s...
[ "Process the data from clipboard" ]
Please provide a description of the function:def set_spyder_breakpoints(self, force=False): if self._reading or force: breakpoints_dict = CONF.get('run', 'breakpoints', {}) # We need to enclose pickled values in a list to be able to # send them to the kernel in Pyth...
[ "Set Spyder breakpoints into a debugging session" ]
Please provide a description of the function:def dbg_exec_magic(self, magic, args=''): code = "!get_ipython().kernel.shell.run_line_magic('{}', '{}')".format( magic, args) self.kernel_client.input(code)
[ "Run an IPython magic while debugging." ]
Please provide a description of the function:def refresh_from_pdb(self, pdb_state): if 'step' in pdb_state and 'fname' in pdb_state['step']: fname = pdb_state['step']['fname'] lineno = pdb_state['step']['lineno'] self.sig_pdb_step.emit(fname, lineno) if 'nam...
[ "\n Refresh Variable Explorer and Editor from a Pdb session,\n after running any pdb command.\n\n See publish_pdb_state and notify_spyder in spyder_kernels\n " ]
Please provide a description of the function:def _handle_input_request(self, msg): if self._hidden: raise RuntimeError('Request for raw input during hidden execution.') # Make sure that all output from the SUB channel has been processed # before entering readline mode. ...
[ "Save history and add a %plot magic." ]
Please provide a description of the function:def _event_filter_console_keypress(self, event): key = event.key() if self._reading: self._control.current_prompt_pos = self._prompt_pos if key == Qt.Key_Up: self._control.browse_history(backward=True) ...
[ "Handle Key_Up/Key_Down while debugging." ]
Please provide a description of the function:def global_max(col_vals, index): col_vals_without_None = [x for x in col_vals if x is not None] max_col, min_col = zip(*col_vals_without_None) return max(max_col), min(min_col)
[ "Returns the global maximum and minimum." ]
Please provide a description of the function:def _axis(self, axis): return self.df.columns if axis == 0 else self.df.index
[ "\r\n Return the corresponding labels taking into account the axis.\r\n\r\n The axis could be horizontal (0) or vertical (1).\r\n " ]
Please provide a description of the function:def _axis_levels(self, axis): ax = self._axis(axis) return 1 if not hasattr(ax, 'levels') else len(ax.levels)
[ "\r\n Return the number of levels in the labels taking into account the axis.\r\n\r\n Get the number of levels for the columns (0) or rows (1).\r\n " ]
Please provide a description of the function:def header(self, axis, x, level=0): ax = self._axis(axis) return ax.values[x] if not hasattr(ax, 'levels') \ else ax.values[x][level]
[ "\r\n Return the values of the labels for the header of columns or rows.\r\n\r\n The value corresponds to the header of column or row x in the\r\n given level.\r\n " ]
Please provide a description of the function:def max_min_col_update(self): if self.df.shape[0] == 0: # If no rows to compute max/min then return return self.max_min_col = [] for dummy, col in self.df.iteritems(): if col.dtype in REAL_NUMBER_TYPES + COMPLEX_...
[ "\r\n Determines the maximum and minimum number in each column.\r\n\r\n The result is a list whose k-th entry is [vmax, vmin], where vmax and\r\n vmin denote the maximum and minimum of the k-th column (ignoring NaN). \r\n This list is stored in self.max_min_col.\r\n\r\n If the k-t...
Please provide a description of the function:def colum_avg(self, state): self.colum_avg_enabled = state > 0 if self.colum_avg_enabled: self.return_max = lambda col_vals, index: col_vals[index] else: self.return_max = global_max self.reset()
[ "Toggle backgroundcolor" ]
Please provide a description of the function:def get_bgcolor(self, index): column = index.column() if not self.bgcolor_enabled: return value = self.get_value(index.row(), column) if self.max_min_col[column] is None or isna(value): color = QColor(BA...
[ "Background color depending on value." ]
Please provide a description of the function:def get_value(self, row, column): # To increase the performance iat is used but that requires error # handling, so fallback uses iloc try: value = self.df.iat[row, column] except OutOfBoundsDatetime: val...
[ "Return the value of the DataFrame." ]
Please provide a description of the function:def data(self, index, role=Qt.DisplayRole): if not index.isValid(): return to_qvariant() if role == Qt.DisplayRole or role == Qt.EditRole: column = index.column() row = index.row() value = self.g...
[ "Cell content" ]
Please provide a description of the function:def sort(self, column, order=Qt.AscendingOrder): if self.complex_intran is not None: if self.complex_intran.any(axis=0).iloc[column]: QMessageBox.critical(self.dialog, "Error", "TypeError ...
[ "Overriding sort method" ]
Please provide a description of the function:def flags(self, index): return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
[ "Set flags" ]
Please provide a description of the function:def setData(self, index, value, role=Qt.EditRole, change_type=None): column = index.column() row = index.row() if index in self.display_error_idxs: return False if change_type is not None: try: ...
[ "Cell content change" ]
Please provide a description of the function:def columnCount(self, index=QModelIndex()): # Avoid a "Qt exception in virtual methods" generated in our # tests on Windows/Python 3.7 # See PR 8910 try: # This is done to implement series if len(self.df...
[ "DataFrame column number" ]
Please provide a description of the function:def load_more_data(self, value, rows=False, columns=False): try: if rows and value == self.verticalScrollBar().maximum(): self.model().fetch_more(rows=rows) self.sig_fetch_more_rows.emit() if colu...
[ "Load more rows and columns to display." ]
Please provide a description of the function:def sortByColumn(self, index): if self.sort_old == [None]: self.header_class.setSortIndicatorShown(True) sort_order = self.header_class.sortIndicatorOrder() self.sig_sort_by_column.emit() if not self.model().sort(ind...
[ "Implement a column sort." ]
Please provide a description of the function:def setup_menu(self): copy_action = create_action(self, _('Copy'), shortcut=keybinding('Copy'), icon=ima.icon('editcopy'), triggered=self.copy, ...
[ "Setup context menu." ]
Please provide a description of the function:def change_type(self, func): model = self.model() index_list = self.selectedIndexes() [model.setData(i, '', change_type=func) for i in index_list]
[ "A function that changes types of cells." ]
Please provide a description of the function:def copy(self): if not self.selectedIndexes(): return (row_min, row_max, col_min, col_max) = get_idx_rect(self.selectedIndexes()) index = header = False df = self.model().df obj = df.iloc[slice(row...
[ "Copy text to clipboard" ]
Please provide a description of the function:def rowCount(self, index=None): if self.axis == 0: return max(1, self._shape[0]) else: if self.total_rows <= self.rows_loaded: return self.total_rows else: return self.rows_l...
[ "Get number of rows in the header." ]
Please provide a description of the function:def columnCount(self, index=QModelIndex()): if self.axis == 0: if self.total_cols <= self.cols_loaded: return self.total_cols else: return self.cols_loaded else: return max(1...
[ "DataFrame column number" ]
Please provide a description of the function:def fetch_more(self, rows=False, columns=False): if self.axis == 1 and self.total_rows > self.rows_loaded: reminder = self.total_rows - self.rows_loaded items_to_fetch = min(reminder, ROWS_TO_LOAD) self.beginInsertRo...
[ "Get more columns or rows (based on axis)." ]
Please provide a description of the function:def sort(self, column, order=Qt.AscendingOrder): ascending = order == Qt.AscendingOrder self.model.sort(self.COLUMN_INDEX, order=ascending) return True
[ "Overriding sort method." ]
Please provide a description of the function:def headerData(self, section, orientation, role): if role == Qt.TextAlignmentRole: if orientation == Qt.Horizontal: return Qt.AlignCenter | Qt.AlignBottom else: return Qt.AlignRight | Qt.AlignVCen...
[ "Get the information to put in the header." ]
Please provide a description of the function:def data(self, index, role): if not index.isValid() or \ index.row() >= self._shape[0] or \ index.column() >= self._shape[1]: return None row, col = ((index.row(), index.column()) if self.axis == 0 ...
[ "\r\n Get the data for the header.\r\n\r\n This is used when a header has levels.\r\n " ]
Please provide a description of the function:def headerData(self, section, orientation, role): if role == Qt.TextAlignmentRole: if orientation == Qt.Horizontal: return Qt.AlignCenter | Qt.AlignBottom else: return Qt.AlignRight | Qt.AlignVCen...
[ "\r\n Get the text to put in the header of the levels of the indexes.\r\n\r\n By default it returns 'Index i', where i is the section in the index\r\n " ]
Please provide a description of the function:def data(self, index, role): if not index.isValid(): return None if role == Qt.FontRole: return self._font label = '' if index.column() == self.model.header_shape[1] - 1: label = str(self.mo...
[ "Get the information of the levels." ]
Please provide a description of the function:def setup_and_check(self, data, title=''): self._selection_rec = False self._model = None self.layout = QGridLayout() self.layout.setSpacing(0) self.layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self.la...
[ "\r\n Setup DataFrameEditor:\r\n return False if data is not supported, True otherwise.\r\n Supported types for data are DataFrame, Series and Index.\r\n " ]
Please provide a description of the function:def save_and_close_enable(self, top_left, bottom_right): self.btn_save_and_close.setEnabled(True) self.btn_save_and_close.setAutoDefault(True) self.btn_save_and_close.setDefault(True)
[ "Handle the data change event to enable the save and close button." ]
Please provide a description of the function:def create_table_level(self): self.table_level = QTableView() self.table_level.setEditTriggers(QTableWidget.NoEditTriggers) self.table_level.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.table_level.setVerticalScrollBa...
[ "Create the QTableView that will hold the level model." ]
Please provide a description of the function:def create_table_header(self): self.table_header = QTableView() self.table_header.verticalHeader().hide() self.table_header.setEditTriggers(QTableWidget.NoEditTriggers) self.table_header.setHorizontalScrollBarPolicy(Qt.ScrollBarA...
[ "Create the QTableView that will hold the header model." ]
Please provide a description of the function:def create_table_index(self): self.table_index = QTableView() self.table_index.horizontalHeader().hide() self.table_index.setEditTriggers(QTableWidget.NoEditTriggers) self.table_index.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwa...
[ "Create the QTableView that will hold the index model." ]
Please provide a description of the function:def create_data_table(self): self.dataTable = DataFrameView(self, self.dataModel, self.table_header.horizontalHeader(), self.hscroll, self.vscroll) self.dataTable.vert...
[ "Create the QTableView that will hold the data model." ]
Please provide a description of the function:def sortByIndex(self, index): self.table_level.horizontalHeader().setSortIndicatorShown(True) sort_order = self.table_level.horizontalHeader().sortIndicatorOrder() self.table_index.model().sort(index, sort_order) self._sort_updat...
[ "Implement a Index sort." ]
Please provide a description of the function:def _column_resized(self, col, old_width, new_width): self.dataTable.setColumnWidth(col, new_width) self._update_layout()
[ "Update the column width." ]
Please provide a description of the function:def _row_resized(self, row, old_height, new_height): self.dataTable.setRowHeight(row, new_height) self._update_layout()
[ "Update the row height." ]
Please provide a description of the function:def _index_resized(self, col, old_width, new_width): self.table_index.setColumnWidth(col, new_width) self._update_layout()
[ "Resize the corresponding column of the index section selected." ]
Please provide a description of the function:def _header_resized(self, row, old_height, new_height): self.table_header.setRowHeight(row, new_height) self._update_layout()
[ "Resize the corresponding row of the header section selected." ]
Please provide a description of the function:def _reset_model(self, table, model): old_sel_model = table.selectionModel() table.setModel(model) if old_sel_model: del old_sel_model
[ "Set the model in the given table." ]
Please provide a description of the function:def setModel(self, model, relayout=True): self._model = model sel_model = self.dataTable.selectionModel() sel_model.currentColumnChanged.connect( self._resizeCurrentColumnToContents) # Asociate the models (leve...
[ "Set the model for the data, header/index and level views." ]
Please provide a description of the function:def setCurrentIndex(self, y, x): self.dataTable.selectionModel().setCurrentIndex( self.dataTable.model().index(y, x), QItemSelectionModel.ClearAndSelect)
[ "Set current selection." ]
Please provide a description of the function:def _resizeColumnToContents(self, header, data, col, limit_ms): hdr_width = self._sizeHintForColumn(header, col, limit_ms) data_width = self._sizeHintForColumn(data, col, limit_ms) if data_width > hdr_width: width = min(self....
[ "Resize a column by its contents." ]
Please provide a description of the function:def _resizeColumnsToContents(self, header, data, limit_ms): max_col = data.model().columnCount() if limit_ms is None: max_col_ms = None else: max_col_ms = limit_ms / max(1, max_col) for col in range(max_...
[ "Resize all the colummns to its contents." ]
Please provide a description of the function:def eventFilter(self, obj, event): if obj == self.dataTable and event.type() == QEvent.Resize: self._resizeVisibleColumnsToContents() return False
[ "Override eventFilter to catch resize event." ]
Please provide a description of the function:def _resizeCurrentColumnToContents(self, new_index, old_index): if new_index.column() not in self._autosized_cols: # Ensure the requested column is fully into view after resizing self._resizeVisibleColumnsToContents() ...
[ "Resize the current column to its contents." ]
Please provide a description of the function:def resizeColumnsToContents(self): self._autosized_cols = set() self._resizeColumnsToContents(self.table_level, self.table_index, self._max_autosize_ms) self._update_layout()
[ "Resize the columns to its contents." ]
Please provide a description of the function:def change_bgcolor_enable(self, state): self.dataModel.bgcolor(state) self.bgcolor_global.setEnabled(not self.is_series and state > 0)
[ "\r\n This is implementet so column min/max is only active when bgcolor is\r\n " ]
Please provide a description of the function:def change_format(self): format, valid = QInputDialog.getText(self, _('Format'), _("Float formatting"), QLineEdit.Normal, ...
[ "\r\n Ask user for display format for floats and use it.\r\n\r\n This function also checks whether the format is valid and emits\r\n `sig_option_changed`.\r\n " ]
Please provide a description of the function:def get_value(self): # It is import to avoid accessing Qt C++ object as it has probably # already been destroyed, due to the Qt.WA_DeleteOnClose attribute df = self.dataModel.get_data() if self.is_series: return df.i...
[ "Return modified Dataframe -- this is *not* a copy" ]
Please provide a description of the function:def _update_header_size(self): column_count = self.table_header.model().columnCount() for index in range(0, column_count): if index < column_count: column_width = self.dataTable.columnWidth(index) sel...
[ "Update the column width of the header." ]
Please provide a description of the function:def setup(self, check_all=None, exclude_private=None, exclude_uppercase=None, exclude_capitalized=None, exclude_unsupported=None, excluded_names=None, minmax=None, dataframe_format=None): assert self.shellwidget...
[ "\r\n Setup the namespace browser with provided settings.\r\n\r\n Args:\r\n dataframe_format (string): default floating-point format for \r\n DataFrame editor\r\n " ]
Please provide a description of the function:def setup_toolbar(self): load_button = create_toolbutton(self, text=_('Import data'), icon=ima.icon('fileimport'), triggered=lambda: self.import_data()) self.save_bu...
[ "Setup toolbar" ]
Please provide a description of the function:def setup_option_actions(self, exclude_private, exclude_uppercase, exclude_capitalized, exclude_unsupported): self.setup_in_progress = True self.exclude_private_action = create_action(self, _("Exclu...
[ "Setup the actions to show in the cog menu." ]
Please provide a description of the function:def setup_options_button(self): if not self.options_button: self.options_button = create_toolbutton( self, text=_('Options'), icon=ima.icon('tooloptions')) actions = self.actions + [MENU_SEPARATOR] + self.plugin...
[ "Add the cog menu button to the toolbar." ]
Please provide a description of the function:def option_changed(self, option, value): setattr(self, to_text_string(option), value) self.shellwidget.set_namespace_view_settings() self.refresh_table()
[ "Option has changed" ]
Please provide a description of the function:def get_view_settings(self): settings = {} for name in REMOTE_SETTINGS: settings[name] = getattr(self, name) return settings
[ "Return dict editor view settings" ]
Please provide a description of the function:def refresh_table(self): if self.is_visible and self.isVisible(): self.shellwidget.refresh_namespacebrowser() try: self.editor.resizeRowToContents() except TypeError: pass
[ "Refresh variable table" ]
Please provide a description of the function:def set_data(self, data): if data != self.editor.model.get_data(): self.editor.set_data(data) self.editor.adjust_columns()
[ "Set data." ]
Please provide a description of the function:def import_data(self, filenames=None): title = _("Import data") if filenames is None: if self.filename is None: basedir = getcwd_or_home() else: basedir = osp.dirname(self.filename) ...
[ "Import data from text file." ]
Please provide a description of the function:def save_data(self, filename=None): if filename is None: filename = self.filename if filename is None: filename = getcwd_or_home() filename, _selfilter = getsavefilename(self, _("Save data"), ...
[ "Save data" ]
Please provide a description of the function:def apply_changes(self): if self.is_modified: self.save_to_conf() if self.apply_callback is not None: self.apply_callback() # Since the language cannot be retrieved by CONF and the language ...
[ "Apply changes callback" ]
Please provide a description of the function:def get_page(self, index=None): if index is None: widget = self.pages_widget.currentWidget() else: widget = self.pages_widget.widget(index) return widget.widget()
[ "Return page widget" ]
Please provide a description of the function:def accept(self): for index in range(self.pages_widget.count()): configpage = self.get_page(index) if not configpage.is_valid(): return configpage.apply_changes() QDialog.accept(self)
[ "Reimplement Qt method" ]
Please provide a description of the function:def resizeEvent(self, event): QDialog.resizeEvent(self, event) self.size_change.emit(self.size())
[ "\r\n Reimplement Qt method to be able to save the widget's size from the\r\n main application\r\n " ]
Please provide a description of the function:def is_valid(self): for lineedit in self.lineedits: if lineedit in self.validate_data and lineedit.isEnabled(): validator, invalid_msg = self.validate_data[lineedit] text = to_text_string(lineedit.text()) ...
[ "Return True if all widget contents are valid" ]
Please provide a description of the function:def load_from_conf(self): for checkbox, (option, default) in list(self.checkboxes.items()): checkbox.setChecked(self.get_option(option, default)) # QAbstractButton works differently for PySide and PyQt if not API == '...
[ "Load settings from configuration file" ]
Please provide a description of the function:def save_to_conf(self): for checkbox, (option, _default) in list(self.checkboxes.items()): self.set_option(option, checkbox.isChecked()) for radiobutton, (option, _default) in list(self.radiobuttons.items()): self.set_opt...
[ "Save settings to configuration file" ]
Please provide a description of the function:def select_directory(self, edit): basedir = to_text_string(edit.text()) if not osp.isdir(basedir): basedir = getcwd_or_home() title = _("Select directory") directory = getexistingdirectory(self, title, basedir) ...
[ "Select directory" ]
Please provide a description of the function:def select_file(self, edit, filters=None): basedir = osp.dirname(to_text_string(edit.text())) if not osp.isdir(basedir): basedir = getcwd_or_home() if filters is None: filters = _("All files (*)") title ...
[ "Select File" ]
Please provide a description of the function:def create_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False): label = QLabel(text) combobox = QComboBox() if tip is not None: combobox.setToolTip(tip) for name...
[ "choices: couples (name, key)" ]
Please provide a description of the function:def create_file_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False, filters=None, adjust_to_contents=False, default_line_edit=False): co...
[ "choices: couples (name, key)" ]
Please provide a description of the function:def create_fontgroup(self, option=None, text=None, title=None, tip=None, fontfilters=None, without_group=False): if title: fontlabel = QLabel(title) else: fontlabel = QLabel(_("Font")) ...
[ "Option=None -> setting plugin font" ]
Please provide a description of the function:def create_tab(self, *widgets): widget = QWidget() layout = QVBoxLayout() for widg in widgets: layout.addWidget(widg) layout.addStretch(1) widget.setLayout(layout) return widget
[ "Create simple tab widget page: widgets added in a vertical layout" ]
Please provide a description of the function:def prompt_restart_required(self): restart_opts = self.restart_options changed_opts = self.changed_options options = [restart_opts[o] for o in changed_opts if o in restart_opts] if len(options) == 1: msg_start = _(...
[ "Prompt the user with a request to restart." ]
Please provide a description of the function:def _refresh(self): padding = self.height() css_base = css_oxygen = if self._application_style == 'oxygen': css_template = css_oxygen else: css_template = css_base css = css_template.format(p...
[ "After an application style change, the paintEvent updates the\n custom defined stylesheet.\n ", "QLineEdit {{\n border: none;\n padding-right: {padding}px;\n }}\n ", "QLineEdit {{back...
Please provide a description of the function:def update_status(self, value, value_set): self._status = value self._status_set = value_set self.repaint() self.update()
[ "Update the status and set_status to update the icons to display." ]
Please provide a description of the function:def paintEvent(self, event): super(IconLineEdit, self).paintEvent(event) painter = QPainter(self) rect = self.geometry() space = int((rect.height())/6) h = rect.height() - space w = rect.width() - h if self._...
[ "Qt Override.\n\n Include a validation icon to the left of the line edit.\n " ]
Please provide a description of the function:def register_plugin(self): self.main.restore_scrollbar_position.connect( self.restore_scrollbar_position) self.main.add_dockwidget(self)
[ "Register plugin in Spyder's main window" ]
Please provide a description of the function:def visibility_changed(self, enable): super(SpyderPluginWidget, self).visibility_changed(enable) if enable: self.explorer.is_visible.emit()
[ "DockWidget visibility has changed" ]
Please provide a description of the function:def restore_scrollbar_position(self): scrollbar_pos = self.get_option('scrollbar_position', None) if scrollbar_pos is not None: self.explorer.treewidget.set_scrollbar_position(scrollbar_pos)
[ "Restoring scrollbar position after main window is visible" ]
Please provide a description of the function:def save_config(self): for option, value in list(self.explorer.get_options().items()): self.set_option(option, value) self.set_option('expanded_state', self.explorer.treewidget.get_expanded_state()) s...
[ "Save configuration: tree widget state" ]
Please provide a description of the function:def load_config(self): expanded_state = self.get_option('expanded_state', None) # Sometimes the expanded state option may be truncated in .ini file # (for an unknown reason), in this case it would be converted to a # string by 'u...
[ "Load configuration: tree widget state" ]
Please provide a description of the function:def activated(self, item): data = self.data.get(id(item)) if data is not None: fname, lineno = data self.sig_edit_goto.emit(fname, lineno, '')
[ "Double-click event" ]
Please provide a description of the function:def remove_obsolete_items(self): self.rdata = [(filename, data) for filename, data in self.rdata if is_module_or_package(filename)]
[ "Removing obsolete items" ]