Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def add_color_scheme_stack(self, scheme_name, custom=False):
color_scheme_groups = [
(_('Text'), ["normal", "comment", "string", "number", "keyword",
"builtin", "definition", "instance", ]),
(_('Highlight'), [... | [
"Add a stack for a given scheme and connects the CONF values."
] |
Please provide a description of the function:def delete_color_scheme_stack(self, scheme_name):
self.set_scheme(scheme_name)
widget = self.stack.currentWidget()
self.stack.removeWidget(widget)
index = self.order.index(scheme_name)
self.order.pop(index) | [
"Remove stack widget by 'scheme_name'."
] |
Please provide a description of the function:def get_plugin_actions(self):
self.new_project_action = create_action(self,
_("New Project..."),
triggered=self.create_new_project)
self.open_project_action = create_action(... | [
"Return a list of actions related to plugin"
] |
Please provide a description of the function:def register_plugin(self):
ipyconsole = self.main.ipyconsole
treewidget = self.explorer.treewidget
lspmgr = self.main.lspmanager
self.main.add_dockwidget(self)
self.explorer.sig_open_file.connect(self.main.open_file)
... | [
"Register plugin in Spyder's main window"
] |
Please provide a description of the function:def closing_plugin(self, cancelable=False):
self.save_config()
self.explorer.closing_widget()
return True | [
"Perform actions before parent main window is closed"
] |
Please provide a description of the function:def switch_to_plugin(self):
# Unmaxizime currently maximized plugin
if (self.main.last_plugin is not None and
self.main.last_plugin.ismaximized and
self.main.last_plugin is not self):
self.main.maximi... | [
"Switch to plugin."
] |
Please provide a description of the function:def setup_menu_actions(self):
self.recent_project_menu.clear()
self.recent_projects_actions = []
if self.recent_projects:
for project in self.recent_projects:
if self.is_valid_project(project):
... | [
"Setup and update the menu actions."
] |
Please provide a description of the function:def update_project_actions(self):
if self.recent_projects:
self.clear_recent_projects_action.setEnabled(True)
else:
self.clear_recent_projects_action.setEnabled(False)
active = bool(self.get_active_project_path... | [
"Update actions of the Projects menu"
] |
Please provide a description of the function:def edit_project_preferences(self):
from spyder.plugins.projects.confpage import ProjectPreferences
if self.project_active:
active_project = self.project_list[0]
dlg = ProjectPreferences(self, active_project)
# ... | [
"Edit Spyder active project preferences"
] |
Please provide a description of the function:def create_new_project(self):
self.switch_to_plugin()
active_project = self.current_active_project
dlg = ProjectDialog(self)
dlg.sig_project_creation_requested.connect(self._create_project)
dlg.sig_project_creation_reque... | [
"Create new project"
] |
Please provide a description of the function:def _create_project(self, path):
self.open_project(path=path)
self.setup_menu_actions()
self.add_to_recent(path) | [
"Create a new project."
] |
Please provide a description of the function:def open_project(self, path=None, restart_consoles=True,
save_previous_files=True):
self.switch_to_plugin()
if path is None:
basedir = get_home_dir()
path = getexistingdirectory(parent=self,
... | [
"Open the project located in `path`"
] |
Please provide a description of the function:def close_project(self):
if self.current_active_project:
self.switch_to_plugin()
if self.main.editor is not None:
self.set_project_filenames(
self.main.editor.get_open_filenames())
... | [
"\r\n Close current project and return to a window without an active\r\n project\r\n "
] |
Please provide a description of the function:def delete_project(self):
if self.current_active_project:
self.switch_to_plugin()
path = self.current_active_project.root_path
buttons = QMessageBox.Yes | QMessageBox.No
answer = QMessageBox.warning(
... | [
"\r\n Delete the current project without deleting the files in the directory.\r\n "
] |
Please provide a description of the function:def reopen_last_project(self):
current_project_path = self.get_option('current_project_path',
default=None)
# Needs a safer test of project existence!
if current_project_path and \
... | [
"\r\n Reopen the active project when Spyder was closed last time, if any\r\n "
] |
Please provide a description of the function:def get_project_filenames(self):
recent_files = []
if self.current_active_project:
recent_files = self.current_active_project.get_recent_files()
elif self.latest_project:
recent_files = self.latest_project.get_re... | [
"Get the list of recent filenames of a project"
] |
Please provide a description of the function:def set_project_filenames(self, recent_files):
if (self.current_active_project
and self.is_valid_project(
self.current_active_project.root_path)):
self.current_active_project.set_recent_files(recent_fi... | [
"Set the list of open file names in a project"
] |
Please provide a description of the function:def get_active_project_path(self):
active_project_path = None
if self.current_active_project:
active_project_path = self.current_active_project.root_path
return active_project_path | [
"Get path of the active project"
] |
Please provide a description of the function:def get_pythonpath(self, at_start=False):
if at_start:
current_path = self.get_option('current_project_path',
default=None)
else:
current_path = self.get_active_project_path()
... | [
"Get project path as a list to be added to PYTHONPATH"
] |
Please provide a description of the function:def save_config(self):
self.set_option('recent_projects', self.recent_projects)
self.set_option('expanded_state',
self.explorer.treewidget.get_expanded_state())
self.set_option('scrollbar_position',
... | [
"\r\n Save configuration: opened projects & tree widget state.\r\n\r\n Also save whether dock widget is visible if a project is open.\r\n "
] |
Please provide a description of the function:def show_explorer(self):
if self.dockwidget is not None:
if self.dockwidget.isHidden():
self.dockwidget.show()
self.dockwidget.raise_()
self.dockwidget.update() | [
"Show the explorer"
] |
Please provide a description of the function:def is_valid_project(self, path):
spy_project_dir = osp.join(path, '.spyproject')
if osp.isdir(path) and osp.isdir(spy_project_dir):
return True
else:
return False | [
"Check if a directory is a valid Spyder project"
] |
Please provide a description of the function:def add_to_recent(self, project):
if project not in self.recent_projects:
self.recent_projects.insert(0, project)
self.recent_projects = self.recent_projects[:10] | [
"\r\n Add an entry to recent projetcs\r\n\r\n We only maintain the list of the 10 most recent projects\r\n "
] |
Please provide a description of the function:def set_attached_console_visible(state):
flag = {True: SW_SHOW, False: SW_HIDE}
return bool(ShowWindow(console_window_handle, flag[state])) | [
"Show/hide system console window attached to current process.\r\n Return it's previous state.\r\n\r\n Availability: Windows"
] |
Please provide a description of the function:def get_family(families):
if not isinstance(families, list):
families = [ families ]
for family in families:
if font_is_installed(family):
return family
else:
print("Warning: None of the following fonts is installed: %r" %... | [
"Return the first installed font family in family list"
] |
Please provide a description of the function:def get_font(section='appearance', option='font', font_size_delta=0):
font = FONT_CACHE.get((section, option))
if font is None:
families = CONF.get(section, option+"/family", None)
if families is None:
return QFont()
family... | [
"Get console font properties depending on OS and user options"
] |
Please provide a description of the function:def set_font(font, section='appearance', option='font'):
CONF.set(section, option+'/family', to_text_string(font.family()))
CONF.set(section, option+'/size', float(font.pointSize()))
CONF.set(section, option+'/italic', int(font.italic()))
CONF.set(sectio... | [
"Set font"
] |
Please provide a description of the function:def fixed_shortcut(keystr, parent, action):
sc = QShortcut(QKeySequence(keystr), parent, action)
sc.setContext(Qt.WidgetWithChildrenShortcut)
return sc | [
"\n DEPRECATED: This function will be removed in Spyder 4.0\n\n Define a fixed shortcut according to a keysequence string\n "
] |
Please provide a description of the function:def config_shortcut(action, context, name, parent):
keystr = get_shortcut(context, name)
qsc = QShortcut(QKeySequence(keystr), parent, action)
qsc.setContext(Qt.WidgetWithChildrenShortcut)
sc = Shortcut(data=(qsc, context, name))
return sc | [
"\n Create a Shortcut namedtuple for a widget\n \n The data contained in this tuple will be registered in\n our shortcuts preferences page\n "
] |
Please provide a description of the function:def iter_shortcuts():
for context_name, keystr in CONF.items('shortcuts'):
context, name = context_name.split("/", 1)
yield context, name, keystr | [
"Iterate over keyboard shortcuts."
] |
Please provide a description of the function:def get_color_scheme(name):
color_scheme = {}
for key in sh.COLOR_SCHEME_KEYS:
color_scheme[key] = CONF.get("appearance", "%s/%s" % (name, key))
return color_scheme | [
"Get syntax color scheme"
] |
Please provide a description of the function:def set_color_scheme(name, color_scheme, replace=True):
section = "appearance"
names = CONF.get("appearance", "names", [])
for key in sh.COLOR_SCHEME_KEYS:
option = "%s/%s" % (name, key)
value = CONF.get(section, option, default=None)
... | [
"Set syntax color scheme"
] |
Please provide a description of the function:def set_default_color_scheme(name, replace=True):
assert name in sh.COLOR_SCHEME_NAMES
set_color_scheme(name, sh.get_color_scheme(name), replace=replace) | [
"Reset color scheme to default values"
] |
Please provide a description of the function:def is_dark_font_color(color_scheme):
color_scheme = get_color_scheme(color_scheme)
font_color, fon_fw, fon_fs = color_scheme['normal']
return dark_color(font_color) | [
"Check if the font color used in the color scheme is dark."
] |
Please provide a description of the function:def eventFilter(self, obj, event):
event_type = event.type()
if event_type == QEvent.MouseButtonPress:
self.tab_pressed(event)
return False
return False | [
"Filter mouse press events.\n\n Events that are captured and not propagated return True. Events that\n are not captured and are propagated return False.\n "
] |
Please provide a description of the function:def tab_pressed(self, event):
self.from_index = self.dock_tabbar.tabAt(event.pos())
self.dock_tabbar.setCurrentIndex(self.from_index)
if event.button() == Qt.RightButton:
if self.from_index == -1:
self.show_nontab... | [
"Method called when a tab from a QTabBar has been pressed."
] |
Please provide a description of the function:def show_nontab_menu(self, event):
menu = self.main.createPopupMenu()
menu.exec_(self.dock_tabbar.mapToGlobal(event.pos())) | [
"Show the context menu assigned to nontabs section."
] |
Please provide a description of the function:def install_tab_event_filter(self, value):
dock_tabbar = None
tabbars = self.main.findChildren(QTabBar)
for tabbar in tabbars:
for tab in range(tabbar.count()):
title = tabbar.tabText(tab)
if title ... | [
"\n Install an event filter to capture mouse events in the tabs of a\n QTabBar holding tabified dockwidgets.\n "
] |
Please provide a description of the function:def _load_all_bookmarks():
slots = CONF.get('editor', 'bookmarks', {})
for slot_num in list(slots.keys()):
if not osp.isfile(slots[slot_num][0]):
slots.pop(slot_num)
return slots | [
"Load all bookmarks from config."
] |
Please provide a description of the function:def load_bookmarks(filename):
bookmarks = _load_all_bookmarks()
return {k: v for k, v in bookmarks.items() if v[0] == filename} | [
"Load all bookmarks for a specific file from config."
] |
Please provide a description of the function:def load_bookmarks_without_file(filename):
bookmarks = _load_all_bookmarks()
return {k: v for k, v in bookmarks.items() if v[0] != filename} | [
"Load all bookmarks but those from a specific file."
] |
Please provide a description of the function:def save_bookmarks(filename, bookmarks):
if not osp.isfile(filename):
return
slots = load_bookmarks_without_file(filename)
for slot_num, content in bookmarks.items():
slots[slot_num] = [filename, content[0], content[1]]
CONF.set('editor',... | [
"Save all bookmarks from specific file to config."
] |
Please provide a description of the function:def report_open_file(self, options):
filename = options['filename']
logger.debug('Call LSP for %s' % filename)
language = options['language']
callback = options['codeeditor']
stat = self.main.lspmanager.start_client(lang... | [
"Request to start a LSP server to attend a language."
] |
Please provide a description of the function:def register_lsp_server_settings(self, settings, language):
self.lsp_editor_settings[language] = settings
logger.debug('LSP server settings for {!s} are: {!r}'.format(
language, settings))
self.lsp_server_ready(language, self... | [
"Register LSP server settings."
] |
Please provide a description of the function:def lsp_server_ready(self, language, configuration):
for editorstack in self.editorstacks:
editorstack.notify_server_ready(language, configuration) | [
"Notify all stackeditors about LSP server availability."
] |
Please provide a description of the function:def visibility_changed(self, enable):
SpyderPluginWidget.visibility_changed(self, enable)
if self.dockwidget is None:
return
if self.dockwidget.isWindow():
self.dock_toolbar.show()
else:
sel... | [
"DockWidget visibility has changed"
] |
Please provide a description of the function:def closing_plugin(self, cancelable=False):
state = self.splitter.saveState()
self.set_option('splitter_state', qbytearray_to_str(state))
filenames = []
editorstack = self.editorstacks[0]
active_project_path = None
... | [
"Perform actions before parent main window is closed"
] |
Please provide a description of the function:def get_plugin_actions(self):
# ---- File menu and toolbar ----
self.new_action = create_action(
self,
_("&New file..."),
icon=ima.icon('filenew'), tip=_("New file"),
triggered=se... | [
"Return a list of actions related to plugin"
] |
Please provide a description of the function:def register_plugin(self):
self.main.restore_scrollbar_position.connect(
self.restore_scrollbar_position)
self.main.console.edit_goto.connect(self.load)
self.exec_in_extconsole.connect(self.main.execute_in_external_console)
... | [
"Register plugin in Spyder's main window"
] |
Please provide a description of the function:def update_font(self):
font = self.get_plugin_font()
color_scheme = self.get_color_scheme()
for editorstack in self.editorstacks:
editorstack.set_default_font(font, color_scheme)
completion_size = CONF.get('main'... | [
"Update font from Preferences"
] |
Please provide a description of the function:def _create_checkable_action(self, text, conf_name, editorstack_method):
def toogle(checked):
self.switch_to_plugin()
self._toggle_checkable_action(checked, editorstack_method,
conf_name)... | [
"Helper function to create a checkable action.\r\n\r\n Args:\r\n text (str): Text to be displayed in the action.\r\n conf_name (str): configuration setting associated with the action\r\n editorstack_method (str): name of EditorStack class that will be\r\n used ... |
Please provide a description of the function:def _toggle_checkable_action(self, checked, editorstack_method, conf_name):
if self.editorstacks:
for editorstack in self.editorstacks:
try:
editorstack.__getattribute__(editorstack_method)(checked)
... | [
"Handle the toogle of a checkable action.\r\n\r\n Update editorstacks and the configuration.\r\n\r\n Args:\r\n checked (bool): State of the action.\r\n editorstack_method (str): name of EditorStack class that will be\r\n used to update the changes in each editorsta... |
Please provide a description of the function:def received_sig_option_changed(self, option, value):
if option == 'autosave_mapping':
for editorstack in self.editorstacks:
if editorstack != self.sender():
editorstack.autosave_mapping = value
s... | [
"\r\n Called when sig_option_changed is received.\r\n\r\n If option being changed is autosave_mapping, then synchronize new\r\n mapping with all editor stacks except the sender.\r\n "
] |
Please provide a description of the function:def unregister_editorstack(self, editorstack):
self.remove_last_focus_editorstack(editorstack)
if len(self.editorstacks) > 1:
index = self.editorstacks.index(editorstack)
self.editorstacks.pop(index)
return T... | [
"Removing editorstack only if it's not the last remaining"
] |
Please provide a description of the function:def setup_other_windows(self):
self.toolbar_list = ((_("File toolbar"), "file_toolbar",
self.main.file_toolbar_actions),
(_("Search toolbar"), "search_toolbar",
s... | [
"Setup toolbars and menus for 'New window' instances"
] |
Please provide a description of the function:def set_current_filename(self, filename, editorwindow=None, focus=True):
editorstack = self.get_current_editorstack(editorwindow)
return editorstack.set_current_filename(filename, focus) | [
"Set focus to *filename* if this file has been opened.\r\n\r\n Return the editor instance associated to *filename*.\r\n "
] |
Please provide a description of the function:def refresh_file_dependent_actions(self):
if self.dockwidget and self.dockwidget.isVisible():
enable = self.get_current_editor() is not None
for action in self.file_dependent_actions:
action.setEnabled(enable) | [
"Enable/disable file dependent actions\r\n (only if dockwidget is visible)"
] |
Please provide a description of the function:def refresh_save_all_action(self):
editorstack = self.get_current_editorstack()
if editorstack:
state = any(finfo.editor.document().isModified() or finfo.newly_created
for finfo in editorstack.data)
... | [
"Enable 'Save All' if there are files to be saved"
] |
Please provide a description of the function:def update_warning_menu(self):
editor = self.get_current_editor()
check_results = editor.get_current_warnings()
self.warning_menu.clear()
filename = self.get_current_filename()
for message, line_number in check_results:
... | [
"Update warning list menu"
] |
Please provide a description of the function:def update_todo_menu(self):
editorstack = self.get_current_editorstack()
results = editorstack.get_todo_results()
self.todo_menu.clear()
filename = self.get_current_filename()
for text, line0 in results:
ico... | [
"Update todo list menu"
] |
Please provide a description of the function:def todo_results_changed(self):
editorstack = self.get_current_editorstack()
results = editorstack.get_todo_results()
index = editorstack.get_stack_index()
if index != -1:
filename = editorstack.data[index].filename
... | [
"\r\n Synchronize todo results between editorstacks\r\n Refresh todo list navigation buttons\r\n "
] |
Please provide a description of the function:def opened_files_list_changed(self):
# Refresh Python file dependent actions:
editor = self.get_current_editor()
if editor:
python_enable = editor.is_python()
cython_enable = python_enable or (
p... | [
"\r\n Opened files list has changed:\r\n --> open/close file action\r\n --> modification ('*' added to title)\r\n --> current edited file has changed\r\n "
] |
Please provide a description of the function:def update_code_analysis_actions(self):
editor = self.get_current_editor()
# To fix an error at startup
if editor is None:
return
results = editor.get_current_warnings()
# Update code analysis buttons
... | [
"Update actions in the warnings menu."
] |
Please provide a description of the function:def save_bookmarks(self, filename, bookmarks):
filename = to_text_string(filename)
bookmarks = to_text_string(bookmarks)
filename = osp.normpath(osp.abspath(filename))
bookmarks = eval(bookmarks)
save_bookmarks(filename,... | [
"Receive bookmark changes and save them."
] |
Please provide a description of the function:def __load_temp_file(self):
if not osp.isfile(self.TEMPFILE_PATH):
# Creating temporary file
default = ['# -*- coding: utf-8 -*-',
'', '', '']
text = os.linesep.join([encoding.to_unicode(qstr)
... | [
"Load temporary file from a text file in user home directory",
"', _(\"Spyder Editor\"), '',\r\n _(\"This is a temporary script file.\"),\r\n '"
] |
Please provide a description of the function:def __set_workdir(self):
fname = self.get_current_filename()
if fname is not None:
directory = osp.dirname(osp.abspath(fname))
self.open_dir.emit(directory) | [
"Set current script directory as working directory"
] |
Please provide a description of the function:def __add_recent_file(self, fname):
if fname is None:
return
if fname in self.recent_files:
self.recent_files.remove(fname)
self.recent_files.insert(0, fname)
if len(self.recent_files) > self.get_option(... | [
"Add to recent file list"
] |
Please provide a description of the function:def _clone_file_everywhere(self, finfo):
for editorstack in self.editorstacks[1:]:
editor = editorstack.clone_editor_from(finfo, set_current=False)
self.register_widget_shortcuts(editor) | [
"Clone file (*src_editor* widget) in all editorstacks\r\n Cloning from the first editorstack in which every single new editor\r\n is created (when loading or creating a new file)"
] |
Please provide a description of the function:def new(self, fname=None, editorstack=None, text=None):
# If no text is provided, create default content
empty = False
try:
if text is None:
default_content = True
text, enc = encoding.read(s... | [
"\r\n Create a new file - Untitled\r\n\r\n fname=None --> fname will be 'untitledXX.py' but do not create file\r\n fname=<basestring> --> create file\r\n "
] |
Please provide a description of the function:def update_recent_file_menu(self):
recent_files = []
for fname in self.recent_files:
if self.is_file_opened(fname) is None and osp.isfile(fname):
recent_files.append(fname)
self.recent_file_menu.clear()
... | [
"Update recent file menu"
] |
Please provide a description of the function:def load(self, filenames=None, goto=None, word='',
editorwindow=None, processevents=True, start_column=None,
set_focus=True, add_where='end'):
# Switch to editor before trying to load a file
try:
self.switc... | [
"\r\n Load a text file\r\n editorwindow: load in this editorwindow (useful when clicking on\r\n outline explorer with multiple editor windows)\r\n processevents: determines if processEvents() should be called at the\r\n end of this method (set to False to prevent keyboard events f... |
Please provide a description of the function:def print_file(self):
editor = self.get_current_editor()
filename = self.get_current_filename()
printer = Printer(mode=QPrinter.HighResolution,
header_font=self.get_plugin_font('printer_header'))
printD... | [
"Print current file"
] |
Please provide a description of the function:def print_preview(self):
from qtpy.QtPrintSupport import QPrintPreviewDialog
editor = self.get_current_editor()
printer = Printer(mode=QPrinter.HighResolution,
header_font=self.get_plugin_font('printer_header'... | [
"Print preview for current file"
] |
Please provide a description of the function:def save(self, index=None, force=False):
editorstack = self.get_current_editorstack()
return editorstack.save(index=index, force=force) | [
"Save file"
] |
Please provide a description of the function:def save_as(self):
editorstack = self.get_current_editorstack()
if editorstack.save_as():
fname = editorstack.get_current_filename()
self.__add_recent_file(fname) | [
"Save *as* the currently edited file"
] |
Please provide a description of the function:def find(self):
editorstack = self.get_current_editorstack()
editorstack.find_widget.show()
editorstack.find_widget.search_text.setFocus() | [
"Find slot"
] |
Please provide a description of the function:def open_last_closed(self):
editorstack = self.get_current_editorstack()
last_closed_files = editorstack.get_last_closed_files()
if (len(last_closed_files) > 0):
file_to_open = last_closed_files[0]
last_closed_fi... | [
" Reopens the last closed tab."
] |
Please provide a description of the function:def close_file_from_name(self, filename):
filename = osp.abspath(to_text_string(filename))
index = self.editorstacks[0].has_filename(filename)
if index is not None:
self.editorstacks[0].close_file(index) | [
"Close file from its name"
] |
Please provide a description of the function:def removed_tree(self, dirname):
dirname = osp.abspath(to_text_string(dirname))
for fname in self.get_filenames():
if osp.abspath(fname).startswith(dirname):
self.close_file_from_name(fname) | [
"Directory was removed in project explorer widget"
] |
Please provide a description of the function:def renamed(self, source, dest):
filename = osp.abspath(to_text_string(source))
index = self.editorstacks[0].has_filename(filename)
if index is not None:
for editorstack in self.editorstacks:
editorstack.rena... | [
"File was renamed in file explorer widget or in project explorer"
] |
Please provide a description of the function:def renamed_tree(self, source, dest):
dirname = osp.abspath(to_text_string(source))
tofile = to_text_string(dest)
for fname in self.get_filenames():
if osp.abspath(fname).startswith(dirname):
new_filename = f... | [
"Directory was renamed in file explorer or in project explorer."
] |
Please provide a description of the function:def run_winpdb(self):
if self.save():
fname = self.get_current_filename()
runconf = get_run_configuration(fname)
if runconf is None:
args = []
wdir = None
else:
... | [
"Run winpdb to debug current file"
] |
Please provide a description of the function:def cursor_moved(self, filename0, position0, filename1, position1):
if position0 is not None:
self.add_cursor_position_to_history(filename0, position0)
self.add_cursor_position_to_history(filename1, position1) | [
"Cursor was just moved: 'go to'"
] |
Please provide a description of the function:def go_to_line(self, line=None):
editorstack = self.get_current_editorstack()
if editorstack is not None:
editorstack.go_to_line(line) | [
"Open 'go to line' dialog"
] |
Please provide a description of the function:def set_or_clear_breakpoint(self):
editorstack = self.get_current_editorstack()
if editorstack is not None:
self.switch_to_plugin()
editorstack.set_or_clear_breakpoint() | [
"Set/Clear breakpoint"
] |
Please provide a description of the function:def set_or_edit_conditional_breakpoint(self):
editorstack = self.get_current_editorstack()
if editorstack is not None:
self.switch_to_plugin()
editorstack.set_or_edit_conditional_breakpoint() | [
"Set/Edit conditional breakpoint"
] |
Please provide a description of the function:def clear_all_breakpoints(self):
self.switch_to_plugin()
clear_all_breakpoints()
self.breakpoints_saved.emit()
editorstack = self.get_current_editorstack()
if editorstack is not None:
for data in editorstack... | [
"Clear breakpoints in all files"
] |
Please provide a description of the function:def clear_breakpoint(self, filename, lineno):
clear_breakpoint(filename, lineno)
self.breakpoints_saved.emit()
editorstack = self.get_current_editorstack()
if editorstack is not None:
index = self.is_file_opened(file... | [
"Remove a single breakpoint"
] |
Please provide a description of the function:def debug_command(self, command):
self.switch_to_plugin()
self.main.ipyconsole.write_to_stdin(command)
focus_widget = self.main.ipyconsole.get_focus_widget()
if focus_widget:
focus_widget.setFocus() | [
"Debug actions"
] |
Please provide a description of the function:def run_file(self, debug=False):
editorstack = self.get_current_editorstack()
if editorstack.save():
editor = self.get_current_editor()
fname = osp.abspath(self.get_current_filename())
# Get fname's dirname... | [
"Run script inside current interpreter or in a new one"
] |
Please provide a description of the function:def debug_file(self):
self.switch_to_plugin()
current_editor = self.get_current_editor()
if current_editor is not None:
current_editor.sig_debug_start.emit()
self.run_file(debug=True) | [
"Debug current script"
] |
Please provide a description of the function:def re_run_file(self):
if self.get_option('save_all_before_run'):
self.save_all()
if self.__last_ec_exec is None:
return
(fname, wdir, args, interact, debug,
python, python_args, current, systerm,
... | [
"Re-run last script"
] |
Please provide a description of the function:def save_bookmark(self, slot_num):
bookmarks = CONF.get('editor', 'bookmarks')
editorstack = self.get_current_editorstack()
if slot_num in bookmarks:
filename, line_num, column = bookmarks[slot_num]
if osp.isfile... | [
"Save current line and position as bookmark."
] |
Please provide a description of the function:def load_bookmark(self, slot_num):
bookmarks = CONF.get('editor', 'bookmarks')
if slot_num in bookmarks:
filename, line_num, column = bookmarks[slot_num]
else:
return
if not osp.isfile(filename):
... | [
"Set cursor to bookmarked file and position."
] |
Please provide a description of the function:def zoom(self, factor):
editor = self.get_current_editorstack().get_current_editor()
if factor == 0:
font = self.get_plugin_font()
editor.set_font(font)
else:
font = editor.font()
size =... | [
"Zoom in/out/reset"
] |
Please provide a description of the function:def apply_plugin_settings(self, options):
if self.editorstacks is not None:
# --- syntax highlight and text rendering settings
color_scheme_n = 'color_scheme_name'
color_scheme_o = self.get_color_scheme()
... | [
"Apply configuration file's plugin settings"
] |
Please provide a description of the function:def get_open_filenames(self):
editorstack = self.editorstacks[0]
filenames = []
filenames += [finfo.filename for finfo in editorstack.data]
return filenames | [
"Get the list of open files in the current stack"
] |
Please provide a description of the function:def set_open_filenames(self):
if self.projects is not None:
if not self.projects.get_active_project():
filenames = self.get_open_filenames()
self.set_option('filenames', filenames) | [
"\r\n Set the recent opened files on editor based on active project.\r\n\r\n If no project is active, then editor filenames are saved, otherwise\r\n the opened filenames are stored in the project config info.\r\n "
] |
Please provide a description of the function:def setup_open_files(self):
self.set_create_new_file_if_empty(False)
active_project_path = None
if self.projects is not None:
active_project_path = self.projects.get_active_project_path()
if active_project_path:
... | [
"\r\n Open the list of saved files per project.\r\n\r\n Also open any files that the user selected in the recovery dialog.\r\n "
] |
Please provide a description of the function:def guess_filename(filename):
if osp.isfile(filename):
return filename
if not filename.endswith('.py'):
filename += '.py'
for path in [getcwd_or_home()] + sys.path:
fname = osp.join(path, filename)
if osp.isfile(fname)... | [
"Guess filename"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.