id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30,800 | spyder-ide/spyder | spyder/plugins/ipythonconsole/plugin.py | IPythonConsole.rename_client_tab | def rename_client_tab(self, client, given_name):
"""Rename client's tab"""
index = self.get_client_index_from_id(id(client))
if given_name is not None:
client.given_name = given_name
self.tabwidget.setTabText(index, client.get_name()) | python | def rename_client_tab(self, client, given_name):
"""Rename client's tab"""
index = self.get_client_index_from_id(id(client))
if given_name is not None:
client.given_name = given_name
self.tabwidget.setTabText(index, client.get_name()) | [
"def",
"rename_client_tab",
"(",
"self",
",",
"client",
",",
"given_name",
")",
":",
"index",
"=",
"self",
".",
"get_client_index_from_id",
"(",
"id",
"(",
"client",
")",
")",
"if",
"given_name",
"is",
"not",
"None",
":",
"client",
".",
"given_name",
"=",
... | Rename client's tab | [
"Rename",
"client",
"s",
"tab"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1290-L1296 |
30,801 | spyder-ide/spyder | spyder/plugins/ipythonconsole/plugin.py | IPythonConsole.rename_tabs_after_change | def rename_tabs_after_change(self, given_name):
"""Rename tabs after a change in name."""
client = self.get_current_client()
# Prevent renames that want to assign the same name of
# a previous tab
repeated = False
for cl in self.get_clients():
if id(c... | python | def rename_tabs_after_change(self, given_name):
"""Rename tabs after a change in name."""
client = self.get_current_client()
# Prevent renames that want to assign the same name of
# a previous tab
repeated = False
for cl in self.get_clients():
if id(c... | [
"def",
"rename_tabs_after_change",
"(",
"self",
",",
"given_name",
")",
":",
"client",
"=",
"self",
".",
"get_current_client",
"(",
")",
"# Prevent renames that want to assign the same name of\r",
"# a previous tab\r",
"repeated",
"=",
"False",
"for",
"cl",
"in",
"self"... | Rename tabs after a change in name. | [
"Rename",
"tabs",
"after",
"a",
"change",
"in",
"name",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1298-L1319 |
30,802 | spyder-ide/spyder | spyder/plugins/ipythonconsole/plugin.py | IPythonConsole.tab_name_editor | def tab_name_editor(self):
"""Trigger the tab name editor."""
index = self.tabwidget.currentIndex()
self.tabwidget.tabBar().tab_name_editor.edit_tab(index) | python | def tab_name_editor(self):
"""Trigger the tab name editor."""
index = self.tabwidget.currentIndex()
self.tabwidget.tabBar().tab_name_editor.edit_tab(index) | [
"def",
"tab_name_editor",
"(",
"self",
")",
":",
"index",
"=",
"self",
".",
"tabwidget",
".",
"currentIndex",
"(",
")",
"self",
".",
"tabwidget",
".",
"tabBar",
"(",
")",
".",
"tab_name_editor",
".",
"edit_tab",
"(",
"index",
")"
] | Trigger the tab name editor. | [
"Trigger",
"the",
"tab",
"name",
"editor",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1321-L1324 |
30,803 | spyder-ide/spyder | spyder/plugins/ipythonconsole/plugin.py | IPythonConsole.show_intro | def show_intro(self):
"""Show intro to IPython help"""
from IPython.core.usage import interactive_usage
self.main.help.show_rich_text(interactive_usage) | python | def show_intro(self):
"""Show intro to IPython help"""
from IPython.core.usage import interactive_usage
self.main.help.show_rich_text(interactive_usage) | [
"def",
"show_intro",
"(",
"self",
")",
":",
"from",
"IPython",
".",
"core",
".",
"usage",
"import",
"interactive_usage",
"self",
".",
"main",
".",
"help",
".",
"show_rich_text",
"(",
"interactive_usage",
")"
] | Show intro to IPython help | [
"Show",
"intro",
"to",
"IPython",
"help"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1338-L1341 |
30,804 | spyder-ide/spyder | spyder/plugins/ipythonconsole/plugin.py | IPythonConsole.show_guiref | def show_guiref(self):
"""Show qtconsole help"""
from qtconsole.usage import gui_reference
self.main.help.show_rich_text(gui_reference, collapse=True) | python | def show_guiref(self):
"""Show qtconsole help"""
from qtconsole.usage import gui_reference
self.main.help.show_rich_text(gui_reference, collapse=True) | [
"def",
"show_guiref",
"(",
"self",
")",
":",
"from",
"qtconsole",
".",
"usage",
"import",
"gui_reference",
"self",
".",
"main",
".",
"help",
".",
"show_rich_text",
"(",
"gui_reference",
",",
"collapse",
"=",
"True",
")"
] | Show qtconsole help | [
"Show",
"qtconsole",
"help"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1344-L1347 |
30,805 | spyder-ide/spyder | spyder/plugins/ipythonconsole/plugin.py | IPythonConsole.show_quickref | def show_quickref(self):
"""Show IPython Cheat Sheet"""
from IPython.core.usage import quick_reference
self.main.help.show_plain_text(quick_reference) | python | def show_quickref(self):
"""Show IPython Cheat Sheet"""
from IPython.core.usage import quick_reference
self.main.help.show_plain_text(quick_reference) | [
"def",
"show_quickref",
"(",
"self",
")",
":",
"from",
"IPython",
".",
"core",
".",
"usage",
"import",
"quick_reference",
"self",
".",
"main",
".",
"help",
".",
"show_plain_text",
"(",
"quick_reference",
")"
] | Show IPython Cheat Sheet | [
"Show",
"IPython",
"Cheat",
"Sheet"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1350-L1353 |
30,806 | spyder-ide/spyder | spyder/plugins/ipythonconsole/plugin.py | IPythonConsole._remove_old_stderr_files | def _remove_old_stderr_files(self):
"""
Remove stderr files left by previous Spyder instances.
This is only required on Windows because we can't
clean up stderr files while Spyder is running on it.
"""
if os.name == 'nt':
tmpdir = get_temp_dir()
... | python | def _remove_old_stderr_files(self):
"""
Remove stderr files left by previous Spyder instances.
This is only required on Windows because we can't
clean up stderr files while Spyder is running on it.
"""
if os.name == 'nt':
tmpdir = get_temp_dir()
... | [
"def",
"_remove_old_stderr_files",
"(",
"self",
")",
":",
"if",
"os",
".",
"name",
"==",
"'nt'",
":",
"tmpdir",
"=",
"get_temp_dir",
"(",
")",
"for",
"fname",
"in",
"os",
".",
"listdir",
"(",
"tmpdir",
")",
":",
"if",
"osp",
".",
"splitext",
"(",
"fn... | Remove stderr files left by previous Spyder instances.
This is only required on Windows because we can't
clean up stderr files while Spyder is running on it. | [
"Remove",
"stderr",
"files",
"left",
"by",
"previous",
"Spyder",
"instances",
".",
"This",
"is",
"only",
"required",
"on",
"Windows",
"because",
"we",
"can",
"t",
"clean",
"up",
"stderr",
"files",
"while",
"Spyder",
"is",
"running",
"on",
"it",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/ipythonconsole/plugin.py#L1504-L1518 |
30,807 | spyder-ide/spyder | spyder/plugins/editor/utils/kill_ring.py | KillRing.rotate | def rotate(self):
""" Rotate the kill ring, then yank back the new top.
Returns
-------
A text string or None.
"""
self._index -= 1
if self._index >= 0:
return self._ring[self._index]
return None | python | def rotate(self):
""" Rotate the kill ring, then yank back the new top.
Returns
-------
A text string or None.
"""
self._index -= 1
if self._index >= 0:
return self._ring[self._index]
return None | [
"def",
"rotate",
"(",
"self",
")",
":",
"self",
".",
"_index",
"-=",
"1",
"if",
"self",
".",
"_index",
">=",
"0",
":",
"return",
"self",
".",
"_ring",
"[",
"self",
".",
"_index",
"]",
"return",
"None"
] | Rotate the kill ring, then yank back the new top.
Returns
-------
A text string or None. | [
"Rotate",
"the",
"kill",
"ring",
"then",
"yank",
"back",
"the",
"new",
"top",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/kill_ring.py#L55-L65 |
30,808 | spyder-ide/spyder | spyder/plugins/editor/utils/kill_ring.py | QtKillRing.kill_cursor | def kill_cursor(self, cursor):
""" Kills the text selected by the give cursor.
"""
text = cursor.selectedText()
if text:
cursor.removeSelectedText()
self.kill(text) | python | def kill_cursor(self, cursor):
""" Kills the text selected by the give cursor.
"""
text = cursor.selectedText()
if text:
cursor.removeSelectedText()
self.kill(text) | [
"def",
"kill_cursor",
"(",
"self",
",",
"cursor",
")",
":",
"text",
"=",
"cursor",
".",
"selectedText",
"(",
")",
"if",
"text",
":",
"cursor",
".",
"removeSelectedText",
"(",
")",
"self",
".",
"kill",
"(",
"text",
")"
] | Kills the text selected by the give cursor. | [
"Kills",
"the",
"text",
"selected",
"by",
"the",
"give",
"cursor",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/kill_ring.py#L100-L106 |
30,809 | spyder-ide/spyder | spyder/plugins/editor/utils/kill_ring.py | QtKillRing.yank | def yank(self):
""" Yank back the most recently killed text.
"""
text = self._ring.yank()
if text:
self._skip_cursor = True
cursor = self._text_edit.textCursor()
cursor.insertText(text)
self._prev_yank = text | python | def yank(self):
""" Yank back the most recently killed text.
"""
text = self._ring.yank()
if text:
self._skip_cursor = True
cursor = self._text_edit.textCursor()
cursor.insertText(text)
self._prev_yank = text | [
"def",
"yank",
"(",
"self",
")",
":",
"text",
"=",
"self",
".",
"_ring",
".",
"yank",
"(",
")",
"if",
"text",
":",
"self",
".",
"_skip_cursor",
"=",
"True",
"cursor",
"=",
"self",
".",
"_text_edit",
".",
"textCursor",
"(",
")",
"cursor",
".",
"inse... | Yank back the most recently killed text. | [
"Yank",
"back",
"the",
"most",
"recently",
"killed",
"text",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/utils/kill_ring.py#L108-L116 |
30,810 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | fixpath | def fixpath(path):
"""Normalize path fixing case, making absolute and removing symlinks"""
norm = osp.normcase if os.name == 'nt' else osp.normpath
return norm(osp.abspath(osp.realpath(path))) | python | def fixpath(path):
"""Normalize path fixing case, making absolute and removing symlinks"""
norm = osp.normcase if os.name == 'nt' else osp.normpath
return norm(osp.abspath(osp.realpath(path))) | [
"def",
"fixpath",
"(",
"path",
")",
":",
"norm",
"=",
"osp",
".",
"normcase",
"if",
"os",
".",
"name",
"==",
"'nt'",
"else",
"osp",
".",
"normpath",
"return",
"norm",
"(",
"osp",
".",
"abspath",
"(",
"osp",
".",
"realpath",
"(",
"path",
")",
")",
... | Normalize path fixing case, making absolute and removing symlinks | [
"Normalize",
"path",
"fixing",
"case",
"making",
"absolute",
"and",
"removing",
"symlinks"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L71-L74 |
30,811 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | create_script | def create_script(fname):
"""Create a new Python script"""
text = os.linesep.join(["# -*- coding: utf-8 -*-", "", ""])
try:
encoding.write(to_text_string(text), fname, 'utf-8')
except EnvironmentError as error:
QMessageBox.critical(_("Save Error"),
_("... | python | def create_script(fname):
"""Create a new Python script"""
text = os.linesep.join(["# -*- coding: utf-8 -*-", "", ""])
try:
encoding.write(to_text_string(text), fname, 'utf-8')
except EnvironmentError as error:
QMessageBox.critical(_("Save Error"),
_("... | [
"def",
"create_script",
"(",
"fname",
")",
":",
"text",
"=",
"os",
".",
"linesep",
".",
"join",
"(",
"[",
"\"# -*- coding: utf-8 -*-\"",
",",
"\"\"",
",",
"\"\"",
"]",
")",
"try",
":",
"encoding",
".",
"write",
"(",
"to_text_string",
"(",
"text",
")",
... | Create a new Python script | [
"Create",
"a",
"new",
"Python",
"script"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L77-L86 |
30,812 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | listdir | def listdir(path, include=r'.', exclude=r'\.pyc$|^\.', show_all=False,
folders_only=False):
"""List files and directories"""
namelist = []
dirlist = [to_text_string(osp.pardir)]
for item in os.listdir(to_text_string(path)):
if re.search(exclude, item) and not show_all:
... | python | def listdir(path, include=r'.', exclude=r'\.pyc$|^\.', show_all=False,
folders_only=False):
"""List files and directories"""
namelist = []
dirlist = [to_text_string(osp.pardir)]
for item in os.listdir(to_text_string(path)):
if re.search(exclude, item) and not show_all:
... | [
"def",
"listdir",
"(",
"path",
",",
"include",
"=",
"r'.'",
",",
"exclude",
"=",
"r'\\.pyc$|^\\.'",
",",
"show_all",
"=",
"False",
",",
"folders_only",
"=",
"False",
")",
":",
"namelist",
"=",
"[",
"]",
"dirlist",
"=",
"[",
"to_text_string",
"(",
"osp",
... | List files and directories | [
"List",
"files",
"and",
"directories"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L88-L103 |
30,813 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | has_subdirectories | def has_subdirectories(path, include, exclude, show_all):
"""Return True if path has subdirectories"""
try:
# > 1 because of '..'
return len( listdir(path, include, exclude,
show_all, folders_only=True) ) > 1
except (IOError, OSError):
return False | python | def has_subdirectories(path, include, exclude, show_all):
"""Return True if path has subdirectories"""
try:
# > 1 because of '..'
return len( listdir(path, include, exclude,
show_all, folders_only=True) ) > 1
except (IOError, OSError):
return False | [
"def",
"has_subdirectories",
"(",
"path",
",",
"include",
",",
"exclude",
",",
"show_all",
")",
":",
"try",
":",
"# > 1 because of '..'\r",
"return",
"len",
"(",
"listdir",
"(",
"path",
",",
"include",
",",
"exclude",
",",
"show_all",
",",
"folders_only",
"=... | Return True if path has subdirectories | [
"Return",
"True",
"if",
"path",
"has",
"subdirectories"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L106-L113 |
30,814 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.setup_fs_model | def setup_fs_model(self):
"""Setup filesystem model"""
filters = QDir.AllDirs | QDir.Files | QDir.Drives | QDir.NoDotAndDotDot
self.fsmodel = QFileSystemModel(self)
self.fsmodel.setFilter(filters)
self.fsmodel.setNameFilterDisables(False) | python | def setup_fs_model(self):
"""Setup filesystem model"""
filters = QDir.AllDirs | QDir.Files | QDir.Drives | QDir.NoDotAndDotDot
self.fsmodel = QFileSystemModel(self)
self.fsmodel.setFilter(filters)
self.fsmodel.setNameFilterDisables(False) | [
"def",
"setup_fs_model",
"(",
"self",
")",
":",
"filters",
"=",
"QDir",
".",
"AllDirs",
"|",
"QDir",
".",
"Files",
"|",
"QDir",
".",
"Drives",
"|",
"QDir",
".",
"NoDotAndDotDot",
"self",
".",
"fsmodel",
"=",
"QFileSystemModel",
"(",
"self",
")",
"self",
... | Setup filesystem model | [
"Setup",
"filesystem",
"model"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L167-L172 |
30,815 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.set_single_click_to_open | def set_single_click_to_open(self, value):
"""Set single click to open items."""
self.single_click_to_open = value
self.parent_widget.sig_option_changed.emit('single_click_to_open',
value) | python | def set_single_click_to_open(self, value):
"""Set single click to open items."""
self.single_click_to_open = value
self.parent_widget.sig_option_changed.emit('single_click_to_open',
value) | [
"def",
"set_single_click_to_open",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"single_click_to_open",
"=",
"value",
"self",
".",
"parent_widget",
".",
"sig_option_changed",
".",
"emit",
"(",
"'single_click_to_open'",
",",
"value",
")"
] | Set single click to open items. | [
"Set",
"single",
"click",
"to",
"open",
"items",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L191-L195 |
30,816 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.set_name_filters | def set_name_filters(self, name_filters):
"""Set name filters"""
self.name_filters = name_filters
self.fsmodel.setNameFilters(name_filters) | python | def set_name_filters(self, name_filters):
"""Set name filters"""
self.name_filters = name_filters
self.fsmodel.setNameFilters(name_filters) | [
"def",
"set_name_filters",
"(",
"self",
",",
"name_filters",
")",
":",
"self",
".",
"name_filters",
"=",
"name_filters",
"self",
".",
"fsmodel",
".",
"setNameFilters",
"(",
"name_filters",
")"
] | Set name filters | [
"Set",
"name",
"filters"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L197-L200 |
30,817 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.set_show_all | def set_show_all(self, state):
"""Toggle 'show all files' state"""
if state:
self.fsmodel.setNameFilters([])
else:
self.fsmodel.setNameFilters(self.name_filters) | python | def set_show_all(self, state):
"""Toggle 'show all files' state"""
if state:
self.fsmodel.setNameFilters([])
else:
self.fsmodel.setNameFilters(self.name_filters) | [
"def",
"set_show_all",
"(",
"self",
",",
"state",
")",
":",
"if",
"state",
":",
"self",
".",
"fsmodel",
".",
"setNameFilters",
"(",
"[",
"]",
")",
"else",
":",
"self",
".",
"fsmodel",
".",
"setNameFilters",
"(",
"self",
".",
"name_filters",
")"
] | Toggle 'show all files' state | [
"Toggle",
"show",
"all",
"files",
"state"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L202-L207 |
30,818 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.get_selected_filenames | def get_selected_filenames(self):
"""Return selected filenames"""
if self.selectionMode() == self.ExtendedSelection:
if self.selectionModel() is None:
return []
return [self.get_filename(idx) for idx in
self.selectionModel().selectedRows... | python | def get_selected_filenames(self):
"""Return selected filenames"""
if self.selectionMode() == self.ExtendedSelection:
if self.selectionModel() is None:
return []
return [self.get_filename(idx) for idx in
self.selectionModel().selectedRows... | [
"def",
"get_selected_filenames",
"(",
"self",
")",
":",
"if",
"self",
".",
"selectionMode",
"(",
")",
"==",
"self",
".",
"ExtendedSelection",
":",
"if",
"self",
".",
"selectionModel",
"(",
")",
"is",
"None",
":",
"return",
"[",
"]",
"return",
"[",
"self"... | Return selected filenames | [
"Return",
"selected",
"filenames"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L218-L226 |
30,819 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.setup | def setup(self, name_filters=['*.py', '*.pyw'], show_all=False,
single_click_to_open=False):
"""Setup tree widget"""
self.setup_view()
self.set_name_filters(name_filters)
self.show_all = show_all
self.single_click_to_open = single_click_to_open
... | python | def setup(self, name_filters=['*.py', '*.pyw'], show_all=False,
single_click_to_open=False):
"""Setup tree widget"""
self.setup_view()
self.set_name_filters(name_filters)
self.show_all = show_all
self.single_click_to_open = single_click_to_open
... | [
"def",
"setup",
"(",
"self",
",",
"name_filters",
"=",
"[",
"'*.py'",
",",
"'*.pyw'",
"]",
",",
"show_all",
"=",
"False",
",",
"single_click_to_open",
"=",
"False",
")",
":",
"self",
".",
"setup_view",
"(",
")",
"self",
".",
"set_name_filters",
"(",
"nam... | Setup tree widget | [
"Setup",
"tree",
"widget"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L238-L249 |
30,820 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.edit_filter | def edit_filter(self):
"""Edit name filters"""
filters, valid = QInputDialog.getText(self, _('Edit filename filters'),
_('Name filters:'),
QLineEdit.Normal,
", "... | python | def edit_filter(self):
"""Edit name filters"""
filters, valid = QInputDialog.getText(self, _('Edit filename filters'),
_('Name filters:'),
QLineEdit.Normal,
", "... | [
"def",
"edit_filter",
"(",
"self",
")",
":",
"filters",
",",
"valid",
"=",
"QInputDialog",
".",
"getText",
"(",
"self",
",",
"_",
"(",
"'Edit filename filters'",
")",
",",
"_",
"(",
"'Name filters:'",
")",
",",
"QLineEdit",
".",
"Normal",
",",
"\", \"",
... | Edit name filters | [
"Edit",
"name",
"filters"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L279-L288 |
30,821 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.toggle_all | def toggle_all(self, checked):
"""Toggle all files mode"""
self.parent_widget.sig_option_changed.emit('show_all', checked)
self.show_all = checked
self.set_show_all(checked) | python | def toggle_all(self, checked):
"""Toggle all files mode"""
self.parent_widget.sig_option_changed.emit('show_all', checked)
self.show_all = checked
self.set_show_all(checked) | [
"def",
"toggle_all",
"(",
"self",
",",
"checked",
")",
":",
"self",
".",
"parent_widget",
".",
"sig_option_changed",
".",
"emit",
"(",
"'show_all'",
",",
"checked",
")",
"self",
".",
"show_all",
"=",
"checked",
"self",
".",
"set_show_all",
"(",
"checked",
... | Toggle all files mode | [
"Toggle",
"all",
"files",
"mode"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L291-L295 |
30,822 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.create_file_new_actions | def create_file_new_actions(self, fnames):
"""Return actions for submenu 'New...'"""
if not fnames:
return []
new_file_act = create_action(self, _("File..."),
icon=ima.icon('filenew'),
triggered=lambda:
... | python | def create_file_new_actions(self, fnames):
"""Return actions for submenu 'New...'"""
if not fnames:
return []
new_file_act = create_action(self, _("File..."),
icon=ima.icon('filenew'),
triggered=lambda:
... | [
"def",
"create_file_new_actions",
"(",
"self",
",",
"fnames",
")",
":",
"if",
"not",
"fnames",
":",
"return",
"[",
"]",
"new_file_act",
"=",
"create_action",
"(",
"self",
",",
"_",
"(",
"\"File...\"",
")",
",",
"icon",
"=",
"ima",
".",
"icon",
"(",
"'f... | Return actions for submenu 'New... | [
"Return",
"actions",
"for",
"submenu",
"New",
"..."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L297-L318 |
30,823 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.create_folder_manage_actions | def create_folder_manage_actions(self, fnames):
"""Return folder management actions"""
actions = []
if os.name == 'nt':
_title = _("Open command prompt here")
else:
_title = _("Open terminal here")
_title = _("Open IPython console here")
ac... | python | def create_folder_manage_actions(self, fnames):
"""Return folder management actions"""
actions = []
if os.name == 'nt':
_title = _("Open command prompt here")
else:
_title = _("Open terminal here")
_title = _("Open IPython console here")
ac... | [
"def",
"create_folder_manage_actions",
"(",
"self",
",",
"fnames",
")",
":",
"actions",
"=",
"[",
"]",
"if",
"os",
".",
"name",
"==",
"'nt'",
":",
"_title",
"=",
"_",
"(",
"\"Open command prompt here\"",
")",
"else",
":",
"_title",
"=",
"_",
"(",
"\"Open... | Return folder management actions | [
"Return",
"folder",
"management",
"actions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L414-L426 |
30,824 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.create_context_menu_actions | def create_context_menu_actions(self):
"""Create context menu actions"""
actions = []
fnames = self.get_selected_filenames()
new_actions = self.create_file_new_actions(fnames)
if len(new_actions) > 1:
# Creating a submenu only if there is more than one entry
... | python | def create_context_menu_actions(self):
"""Create context menu actions"""
actions = []
fnames = self.get_selected_filenames()
new_actions = self.create_file_new_actions(fnames)
if len(new_actions) > 1:
# Creating a submenu only if there is more than one entry
... | [
"def",
"create_context_menu_actions",
"(",
"self",
")",
":",
"actions",
"=",
"[",
"]",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"new_actions",
"=",
"self",
".",
"create_file_new_actions",
"(",
"fnames",
")",
"if",
"len",
"(",
"new_action... | Create context menu actions | [
"Create",
"context",
"menu",
"actions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L428-L456 |
30,825 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.update_menu | def update_menu(self):
"""Update context menu"""
self.menu.clear()
add_actions(self.menu, self.create_context_menu_actions()) | python | def update_menu(self):
"""Update context menu"""
self.menu.clear()
add_actions(self.menu, self.create_context_menu_actions()) | [
"def",
"update_menu",
"(",
"self",
")",
":",
"self",
".",
"menu",
".",
"clear",
"(",
")",
"add_actions",
"(",
"self",
".",
"menu",
",",
"self",
".",
"create_context_menu_actions",
"(",
")",
")"
] | Update context menu | [
"Update",
"context",
"menu"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L458-L461 |
30,826 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.dragMoveEvent | def dragMoveEvent(self, event):
"""Drag and Drop - Move event"""
if (event.mimeData().hasFormat("text/plain")):
event.setDropAction(Qt.MoveAction)
event.accept()
else:
event.ignore() | python | def dragMoveEvent(self, event):
"""Drag and Drop - Move event"""
if (event.mimeData().hasFormat("text/plain")):
event.setDropAction(Qt.MoveAction)
event.accept()
else:
event.ignore() | [
"def",
"dragMoveEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"(",
"event",
".",
"mimeData",
"(",
")",
".",
"hasFormat",
"(",
"\"text/plain\"",
")",
")",
":",
"event",
".",
"setDropAction",
"(",
"Qt",
".",
"MoveAction",
")",
"event",
".",
"accept"... | Drag and Drop - Move event | [
"Drag",
"and",
"Drop",
"-",
"Move",
"event"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L533-L539 |
30,827 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.startDrag | def startDrag(self, dropActions):
"""Reimplement Qt Method - handle drag event"""
data = QMimeData()
data.setUrls([QUrl(fname) for fname in self.get_selected_filenames()])
drag = QDrag(self)
drag.setMimeData(data)
drag.exec_() | python | def startDrag(self, dropActions):
"""Reimplement Qt Method - handle drag event"""
data = QMimeData()
data.setUrls([QUrl(fname) for fname in self.get_selected_filenames()])
drag = QDrag(self)
drag.setMimeData(data)
drag.exec_() | [
"def",
"startDrag",
"(",
"self",
",",
"dropActions",
")",
":",
"data",
"=",
"QMimeData",
"(",
")",
"data",
".",
"setUrls",
"(",
"[",
"QUrl",
"(",
"fname",
")",
"for",
"fname",
"in",
"self",
".",
"get_selected_filenames",
"(",
")",
"]",
")",
"drag",
"... | Reimplement Qt Method - handle drag event | [
"Reimplement",
"Qt",
"Method",
"-",
"handle",
"drag",
"event"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L541-L547 |
30,828 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.open | def open(self, fnames=None):
"""Open files with the appropriate application"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
if osp.isfile(fname) and encoding.is_text_file(fname):
self.parent_widget.sig_open_file.emit... | python | def open(self, fnames=None):
"""Open files with the appropriate application"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
if osp.isfile(fname) and encoding.is_text_file(fname):
self.parent_widget.sig_open_file.emit... | [
"def",
"open",
"(",
"self",
",",
"fnames",
"=",
"None",
")",
":",
"if",
"fnames",
"is",
"None",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"for",
"fname",
"in",
"fnames",
":",
"if",
"osp",
".",
"isfile",
"(",
"fname",
")",
... | Open files with the appropriate application | [
"Open",
"files",
"with",
"the",
"appropriate",
"application"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L551-L559 |
30,829 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.open_external | def open_external(self, fnames=None):
"""Open files with default application"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
self.open_outside_spyder([fname]) | python | def open_external(self, fnames=None):
"""Open files with default application"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
self.open_outside_spyder([fname]) | [
"def",
"open_external",
"(",
"self",
",",
"fnames",
"=",
"None",
")",
":",
"if",
"fnames",
"is",
"None",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"for",
"fname",
"in",
"fnames",
":",
"self",
".",
"open_outside_spyder",
"(",
"[... | Open files with default application | [
"Open",
"files",
"with",
"default",
"application"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L562-L567 |
30,830 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.open_outside_spyder | def open_outside_spyder(self, fnames):
"""Open file outside Spyder with the appropriate application
If this does not work, opening unknown file in Spyder, as text file"""
for path in sorted(fnames):
path = file_uri(path)
ok = programs.start_file(path)
if... | python | def open_outside_spyder(self, fnames):
"""Open file outside Spyder with the appropriate application
If this does not work, opening unknown file in Spyder, as text file"""
for path in sorted(fnames):
path = file_uri(path)
ok = programs.start_file(path)
if... | [
"def",
"open_outside_spyder",
"(",
"self",
",",
"fnames",
")",
":",
"for",
"path",
"in",
"sorted",
"(",
"fnames",
")",
":",
"path",
"=",
"file_uri",
"(",
"path",
")",
"ok",
"=",
"programs",
".",
"start_file",
"(",
"path",
")",
"if",
"not",
"ok",
":",... | Open file outside Spyder with the appropriate application
If this does not work, opening unknown file in Spyder, as text file | [
"Open",
"file",
"outside",
"Spyder",
"with",
"the",
"appropriate",
"application",
"If",
"this",
"does",
"not",
"work",
"opening",
"unknown",
"file",
"in",
"Spyder",
"as",
"text",
"file"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L569-L576 |
30,831 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.run | def run(self, fnames=None):
"""Run Python scripts"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
self.sig_run.emit(fname) | python | def run(self, fnames=None):
"""Run Python scripts"""
if fnames is None:
fnames = self.get_selected_filenames()
for fname in fnames:
self.sig_run.emit(fname) | [
"def",
"run",
"(",
"self",
",",
"fnames",
"=",
"None",
")",
":",
"if",
"fnames",
"is",
"None",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"for",
"fname",
"in",
"fnames",
":",
"self",
".",
"sig_run",
".",
"emit",
"(",
"fname"... | Run Python scripts | [
"Run",
"Python",
"scripts"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L584-L589 |
30,832 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.remove_tree | def remove_tree(self, dirname):
"""Remove whole directory tree
Reimplemented in project explorer widget"""
while osp.exists(dirname):
try:
shutil.rmtree(dirname, onerror=misc.onerror)
except Exception as e:
# This handles a Windows p... | python | def remove_tree(self, dirname):
"""Remove whole directory tree
Reimplemented in project explorer widget"""
while osp.exists(dirname):
try:
shutil.rmtree(dirname, onerror=misc.onerror)
except Exception as e:
# This handles a Windows p... | [
"def",
"remove_tree",
"(",
"self",
",",
"dirname",
")",
":",
"while",
"osp",
".",
"exists",
"(",
"dirname",
")",
":",
"try",
":",
"shutil",
".",
"rmtree",
"(",
"dirname",
",",
"onerror",
"=",
"misc",
".",
"onerror",
")",
"except",
"Exception",
"as",
... | Remove whole directory tree
Reimplemented in project explorer widget | [
"Remove",
"whole",
"directory",
"tree",
"Reimplemented",
"in",
"project",
"explorer",
"widget"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L591-L602 |
30,833 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.convert_notebook | def convert_notebook(self, fname):
"""Convert an IPython notebook to a Python script in editor"""
try:
script = nbexporter().from_filename(fname)[0]
except Exception as e:
QMessageBox.critical(self, _('Conversion error'),
_("It was... | python | def convert_notebook(self, fname):
"""Convert an IPython notebook to a Python script in editor"""
try:
script = nbexporter().from_filename(fname)[0]
except Exception as e:
QMessageBox.critical(self, _('Conversion error'),
_("It was... | [
"def",
"convert_notebook",
"(",
"self",
",",
"fname",
")",
":",
"try",
":",
"script",
"=",
"nbexporter",
"(",
")",
".",
"from_filename",
"(",
"fname",
")",
"[",
"0",
"]",
"except",
"Exception",
"as",
"e",
":",
"QMessageBox",
".",
"critical",
"(",
"self... | Convert an IPython notebook to a Python script in editor | [
"Convert",
"an",
"IPython",
"notebook",
"to",
"a",
"Python",
"script",
"in",
"editor"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L661-L671 |
30,834 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.convert_notebooks | def convert_notebooks(self):
"""Convert IPython notebooks to Python scripts in editor"""
fnames = self.get_selected_filenames()
if not isinstance(fnames, (tuple, list)):
fnames = [fnames]
for fname in fnames:
self.convert_notebook(fname) | python | def convert_notebooks(self):
"""Convert IPython notebooks to Python scripts in editor"""
fnames = self.get_selected_filenames()
if not isinstance(fnames, (tuple, list)):
fnames = [fnames]
for fname in fnames:
self.convert_notebook(fname) | [
"def",
"convert_notebooks",
"(",
"self",
")",
":",
"fnames",
"=",
"self",
".",
"get_selected_filenames",
"(",
")",
"if",
"not",
"isinstance",
"(",
"fnames",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"fnames",
"=",
"[",
"fnames",
"]",
"for",
"fname... | Convert IPython notebooks to Python scripts in editor | [
"Convert",
"IPython",
"notebooks",
"to",
"Python",
"scripts",
"in",
"editor"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L674-L680 |
30,835 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.create_new_file | def create_new_file(self, current_path, title, filters, create_func):
"""Create new file
Returns True if successful"""
if current_path is None:
current_path = ''
if osp.isfile(current_path):
current_path = osp.dirname(current_path)
self.redirect_std... | python | def create_new_file(self, current_path, title, filters, create_func):
"""Create new file
Returns True if successful"""
if current_path is None:
current_path = ''
if osp.isfile(current_path):
current_path = osp.dirname(current_path)
self.redirect_std... | [
"def",
"create_new_file",
"(",
"self",
",",
"current_path",
",",
"title",
",",
"filters",
",",
"create_func",
")",
":",
"if",
"current_path",
"is",
"None",
":",
"current_path",
"=",
"''",
"if",
"osp",
".",
"isfile",
"(",
"current_path",
")",
":",
"current_... | Create new file
Returns True if successful | [
"Create",
"new",
"file",
"Returns",
"True",
"if",
"successful"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L803-L821 |
30,836 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.create_shortcuts | def create_shortcuts(self):
"""Create shortcuts for this file explorer."""
# Configurable
copy_clipboard_file = config_shortcut(self.copy_file_clipboard,
context='explorer',
name='copy file', parent=... | python | def create_shortcuts(self):
"""Create shortcuts for this file explorer."""
# Configurable
copy_clipboard_file = config_shortcut(self.copy_file_clipboard,
context='explorer',
name='copy file', parent=... | [
"def",
"create_shortcuts",
"(",
"self",
")",
":",
"# Configurable\r",
"copy_clipboard_file",
"=",
"config_shortcut",
"(",
"self",
".",
"copy_file_clipboard",
",",
"context",
"=",
"'explorer'",
",",
"name",
"=",
"'copy file'",
",",
"parent",
"=",
"self",
")",
"pa... | Create shortcuts for this file explorer. | [
"Create",
"shortcuts",
"for",
"this",
"file",
"explorer",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1003-L1021 |
30,837 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.set_scrollbar_position | def set_scrollbar_position(self, position):
"""Set scrollbar positions"""
# Scrollbars will be restored after the expanded state
self._scrollbar_positions = position
if self._to_be_loaded is not None and len(self._to_be_loaded) == 0:
self.restore_scrollbar_positions() | python | def set_scrollbar_position(self, position):
"""Set scrollbar positions"""
# Scrollbars will be restored after the expanded state
self._scrollbar_positions = position
if self._to_be_loaded is not None and len(self._to_be_loaded) == 0:
self.restore_scrollbar_positions() | [
"def",
"set_scrollbar_position",
"(",
"self",
",",
"position",
")",
":",
"# Scrollbars will be restored after the expanded state\r",
"self",
".",
"_scrollbar_positions",
"=",
"position",
"if",
"self",
".",
"_to_be_loaded",
"is",
"not",
"None",
"and",
"len",
"(",
"self... | Set scrollbar positions | [
"Set",
"scrollbar",
"positions"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1052-L1057 |
30,838 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.restore_scrollbar_positions | def restore_scrollbar_positions(self):
"""Restore scrollbar positions once tree is loaded"""
hor, ver = self._scrollbar_positions
self.horizontalScrollBar().setValue(hor)
self.verticalScrollBar().setValue(ver) | python | def restore_scrollbar_positions(self):
"""Restore scrollbar positions once tree is loaded"""
hor, ver = self._scrollbar_positions
self.horizontalScrollBar().setValue(hor)
self.verticalScrollBar().setValue(ver) | [
"def",
"restore_scrollbar_positions",
"(",
"self",
")",
":",
"hor",
",",
"ver",
"=",
"self",
".",
"_scrollbar_positions",
"self",
".",
"horizontalScrollBar",
"(",
")",
".",
"setValue",
"(",
"hor",
")",
"self",
".",
"verticalScrollBar",
"(",
")",
".",
"setVal... | Restore scrollbar positions once tree is loaded | [
"Restore",
"scrollbar",
"positions",
"once",
"tree",
"is",
"loaded"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1059-L1063 |
30,839 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.restore_directory_state | def restore_directory_state(self, fname):
"""Restore directory expanded state"""
root = osp.normpath(to_text_string(fname))
if not osp.exists(root):
# Directory has been (re)moved outside Spyder
return
for basename in os.listdir(root):
path = os... | python | def restore_directory_state(self, fname):
"""Restore directory expanded state"""
root = osp.normpath(to_text_string(fname))
if not osp.exists(root):
# Directory has been (re)moved outside Spyder
return
for basename in os.listdir(root):
path = os... | [
"def",
"restore_directory_state",
"(",
"self",
",",
"fname",
")",
":",
"root",
"=",
"osp",
".",
"normpath",
"(",
"to_text_string",
"(",
"fname",
")",
")",
"if",
"not",
"osp",
".",
"exists",
"(",
"root",
")",
":",
"# Directory has been (re)moved outside Spyder\... | Restore directory expanded state | [
"Restore",
"directory",
"expanded",
"state"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1086-L1101 |
30,840 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.follow_directories_loaded | def follow_directories_loaded(self, fname):
"""Follow directories loaded during startup"""
if self._to_be_loaded is None:
return
path = osp.normpath(to_text_string(fname))
if path in self._to_be_loaded:
self._to_be_loaded.remove(path)
if self._to_be... | python | def follow_directories_loaded(self, fname):
"""Follow directories loaded during startup"""
if self._to_be_loaded is None:
return
path = osp.normpath(to_text_string(fname))
if path in self._to_be_loaded:
self._to_be_loaded.remove(path)
if self._to_be... | [
"def",
"follow_directories_loaded",
"(",
"self",
",",
"fname",
")",
":",
"if",
"self",
".",
"_to_be_loaded",
"is",
"None",
":",
"return",
"path",
"=",
"osp",
".",
"normpath",
"(",
"to_text_string",
"(",
"fname",
")",
")",
"if",
"path",
"in",
"self",
".",... | Follow directories loaded during startup | [
"Follow",
"directories",
"loaded",
"during",
"startup"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1103-L1115 |
30,841 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | DirView.filter_directories | def filter_directories(self):
"""Filter the directories to show"""
index = self.get_index('.spyproject')
if index is not None:
self.setRowHidden(index.row(), index.parent(), True) | python | def filter_directories(self):
"""Filter the directories to show"""
index = self.get_index('.spyproject')
if index is not None:
self.setRowHidden(index.row(), index.parent(), True) | [
"def",
"filter_directories",
"(",
"self",
")",
":",
"index",
"=",
"self",
".",
"get_index",
"(",
"'.spyproject'",
")",
"if",
"index",
"is",
"not",
"None",
":",
"self",
".",
"setRowHidden",
"(",
"index",
".",
"row",
"(",
")",
",",
"index",
".",
"parent"... | Filter the directories to show | [
"Filter",
"the",
"directories",
"to",
"show"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1127-L1131 |
30,842 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | ProxyModel.setup_filter | def setup_filter(self, root_path, path_list):
"""Setup proxy model filter parameters"""
self.root_path = osp.normpath(to_text_string(root_path))
self.path_list = [osp.normpath(to_text_string(p)) for p in path_list]
self.invalidateFilter() | python | def setup_filter(self, root_path, path_list):
"""Setup proxy model filter parameters"""
self.root_path = osp.normpath(to_text_string(root_path))
self.path_list = [osp.normpath(to_text_string(p)) for p in path_list]
self.invalidateFilter() | [
"def",
"setup_filter",
"(",
"self",
",",
"root_path",
",",
"path_list",
")",
":",
"self",
".",
"root_path",
"=",
"osp",
".",
"normpath",
"(",
"to_text_string",
"(",
"root_path",
")",
")",
"self",
".",
"path_list",
"=",
"[",
"osp",
".",
"normpath",
"(",
... | Setup proxy model filter parameters | [
"Setup",
"proxy",
"model",
"filter",
"parameters"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1141-L1145 |
30,843 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | ProxyModel.data | def data(self, index, role):
"""Show tooltip with full path only for the root directory"""
if role == Qt.ToolTipRole:
root_dir = self.path_list[0].split(osp.sep)[-1]
if index.data() == root_dir:
return osp.join(self.root_path, root_dir)
return QSortF... | python | def data(self, index, role):
"""Show tooltip with full path only for the root directory"""
if role == Qt.ToolTipRole:
root_dir = self.path_list[0].split(osp.sep)[-1]
if index.data() == root_dir:
return osp.join(self.root_path, root_dir)
return QSortF... | [
"def",
"data",
"(",
"self",
",",
"index",
",",
"role",
")",
":",
"if",
"role",
"==",
"Qt",
".",
"ToolTipRole",
":",
"root_dir",
"=",
"self",
".",
"path_list",
"[",
"0",
"]",
".",
"split",
"(",
"osp",
".",
"sep",
")",
"[",
"-",
"1",
"]",
"if",
... | Show tooltip with full path only for the root directory | [
"Show",
"tooltip",
"with",
"full",
"path",
"only",
"for",
"the",
"root",
"directory"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1168-L1174 |
30,844 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | FilteredDirView.setup_proxy_model | def setup_proxy_model(self):
"""Setup proxy model"""
self.proxymodel = ProxyModel(self)
self.proxymodel.setSourceModel(self.fsmodel) | python | def setup_proxy_model(self):
"""Setup proxy model"""
self.proxymodel = ProxyModel(self)
self.proxymodel.setSourceModel(self.fsmodel) | [
"def",
"setup_proxy_model",
"(",
"self",
")",
":",
"self",
".",
"proxymodel",
"=",
"ProxyModel",
"(",
"self",
")",
"self",
".",
"proxymodel",
".",
"setSourceModel",
"(",
"self",
".",
"fsmodel",
")"
] | Setup proxy model | [
"Setup",
"proxy",
"model"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1185-L1188 |
30,845 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | FilteredDirView.set_root_path | def set_root_path(self, root_path):
"""Set root path"""
self.root_path = root_path
self.install_model()
index = self.fsmodel.setRootPath(root_path)
self.proxymodel.setup_filter(self.root_path, [])
self.setRootIndex(self.proxymodel.mapFromSource(index)) | python | def set_root_path(self, root_path):
"""Set root path"""
self.root_path = root_path
self.install_model()
index = self.fsmodel.setRootPath(root_path)
self.proxymodel.setup_filter(self.root_path, [])
self.setRootIndex(self.proxymodel.mapFromSource(index)) | [
"def",
"set_root_path",
"(",
"self",
",",
"root_path",
")",
":",
"self",
".",
"root_path",
"=",
"root_path",
"self",
".",
"install_model",
"(",
")",
"index",
"=",
"self",
".",
"fsmodel",
".",
"setRootPath",
"(",
"root_path",
")",
"self",
".",
"proxymodel",... | Set root path | [
"Set",
"root",
"path"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1195-L1201 |
30,846 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | FilteredDirView.get_index | def get_index(self, filename):
"""Return index associated with filename"""
index = self.fsmodel.index(filename)
if index.isValid() and index.model() is self.fsmodel:
return self.proxymodel.mapFromSource(index) | python | def get_index(self, filename):
"""Return index associated with filename"""
index = self.fsmodel.index(filename)
if index.isValid() and index.model() is self.fsmodel:
return self.proxymodel.mapFromSource(index) | [
"def",
"get_index",
"(",
"self",
",",
"filename",
")",
":",
"index",
"=",
"self",
".",
"fsmodel",
".",
"index",
"(",
"filename",
")",
"if",
"index",
".",
"isValid",
"(",
")",
"and",
"index",
".",
"model",
"(",
")",
"is",
"self",
".",
"fsmodel",
":"... | Return index associated with filename | [
"Return",
"index",
"associated",
"with",
"filename"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1203-L1207 |
30,847 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | FilteredDirView.set_folder_names | def set_folder_names(self, folder_names):
"""Set folder names"""
assert self.root_path is not None
path_list = [osp.join(self.root_path, dirname)
for dirname in folder_names]
self.proxymodel.setup_filter(self.root_path, path_list) | python | def set_folder_names(self, folder_names):
"""Set folder names"""
assert self.root_path is not None
path_list = [osp.join(self.root_path, dirname)
for dirname in folder_names]
self.proxymodel.setup_filter(self.root_path, path_list) | [
"def",
"set_folder_names",
"(",
"self",
",",
"folder_names",
")",
":",
"assert",
"self",
".",
"root_path",
"is",
"not",
"None",
"path_list",
"=",
"[",
"osp",
".",
"join",
"(",
"self",
".",
"root_path",
",",
"dirname",
")",
"for",
"dirname",
"in",
"folder... | Set folder names | [
"Set",
"folder",
"names"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1209-L1214 |
30,848 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | FilteredDirView.get_filename | def get_filename(self, index):
"""Return filename from index"""
if index:
path = self.fsmodel.filePath(self.proxymodel.mapToSource(index))
return osp.normpath(to_text_string(path)) | python | def get_filename(self, index):
"""Return filename from index"""
if index:
path = self.fsmodel.filePath(self.proxymodel.mapToSource(index))
return osp.normpath(to_text_string(path)) | [
"def",
"get_filename",
"(",
"self",
",",
"index",
")",
":",
"if",
"index",
":",
"path",
"=",
"self",
".",
"fsmodel",
".",
"filePath",
"(",
"self",
".",
"proxymodel",
".",
"mapToSource",
"(",
"index",
")",
")",
"return",
"osp",
".",
"normpath",
"(",
"... | Return filename from index | [
"Return",
"filename",
"from",
"index"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1216-L1220 |
30,849 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | FilteredDirView.setup_project_view | def setup_project_view(self):
"""Setup view for projects"""
for i in [1, 2, 3]:
self.hideColumn(i)
self.setHeaderHidden(True)
# Disable the view of .spyproject.
self.filter_directories() | python | def setup_project_view(self):
"""Setup view for projects"""
for i in [1, 2, 3]:
self.hideColumn(i)
self.setHeaderHidden(True)
# Disable the view of .spyproject.
self.filter_directories() | [
"def",
"setup_project_view",
"(",
"self",
")",
":",
"for",
"i",
"in",
"[",
"1",
",",
"2",
",",
"3",
"]",
":",
"self",
".",
"hideColumn",
"(",
"i",
")",
"self",
".",
"setHeaderHidden",
"(",
"True",
")",
"# Disable the view of .spyproject. \r",
"self",
"."... | Setup view for projects | [
"Setup",
"view",
"for",
"projects"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1222-L1228 |
30,850 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | ExplorerTreeWidget.toggle_show_cd_only | def toggle_show_cd_only(self, checked):
"""Toggle show current directory only mode"""
self.parent_widget.sig_option_changed.emit('show_cd_only', checked)
self.show_cd_only = checked
if checked:
if self.__last_folder is not None:
self.set_current_folder(s... | python | def toggle_show_cd_only(self, checked):
"""Toggle show current directory only mode"""
self.parent_widget.sig_option_changed.emit('show_cd_only', checked)
self.show_cd_only = checked
if checked:
if self.__last_folder is not None:
self.set_current_folder(s... | [
"def",
"toggle_show_cd_only",
"(",
"self",
",",
"checked",
")",
":",
"self",
".",
"parent_widget",
".",
"sig_option_changed",
".",
"emit",
"(",
"'show_cd_only'",
",",
"checked",
")",
"self",
".",
"show_cd_only",
"=",
"checked",
"if",
"checked",
":",
"if",
"s... | Toggle show current directory only mode | [
"Toggle",
"show",
"current",
"directory",
"only",
"mode"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1275-L1283 |
30,851 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | ExplorerTreeWidget.set_current_folder | def set_current_folder(self, folder):
"""Set current folder and return associated model index"""
index = self.fsmodel.setRootPath(folder)
self.__last_folder = folder
if self.show_cd_only:
if self.__original_root_index is None:
self.__original_root_index ... | python | def set_current_folder(self, folder):
"""Set current folder and return associated model index"""
index = self.fsmodel.setRootPath(folder)
self.__last_folder = folder
if self.show_cd_only:
if self.__original_root_index is None:
self.__original_root_index ... | [
"def",
"set_current_folder",
"(",
"self",
",",
"folder",
")",
":",
"index",
"=",
"self",
".",
"fsmodel",
".",
"setRootPath",
"(",
"folder",
")",
"self",
".",
"__last_folder",
"=",
"folder",
"if",
"self",
".",
"show_cd_only",
":",
"if",
"self",
".",
"__or... | Set current folder and return associated model index | [
"Set",
"current",
"folder",
"and",
"return",
"associated",
"model",
"index"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1286-L1294 |
30,852 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | ExplorerTreeWidget.go_to_parent_directory | def go_to_parent_directory(self):
"""Go to parent directory"""
self.chdir(osp.abspath(osp.join(getcwd_or_home(), os.pardir))) | python | def go_to_parent_directory(self):
"""Go to parent directory"""
self.chdir(osp.abspath(osp.join(getcwd_or_home(), os.pardir))) | [
"def",
"go_to_parent_directory",
"(",
"self",
")",
":",
"self",
".",
"chdir",
"(",
"osp",
".",
"abspath",
"(",
"osp",
".",
"join",
"(",
"getcwd_or_home",
"(",
")",
",",
"os",
".",
"pardir",
")",
")",
")"
] | Go to parent directory | [
"Go",
"to",
"parent",
"directory"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1322-L1324 |
30,853 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | ExplorerTreeWidget.update_history | def update_history(self, directory):
"""Update browse history"""
try:
directory = osp.abspath(to_text_string(directory))
if directory in self.history:
self.histindex = self.history.index(directory)
except Exception:
user_directory = get_... | python | def update_history(self, directory):
"""Update browse history"""
try:
directory = osp.abspath(to_text_string(directory))
if directory in self.history:
self.histindex = self.history.index(directory)
except Exception:
user_directory = get_... | [
"def",
"update_history",
"(",
"self",
",",
"directory",
")",
":",
"try",
":",
"directory",
"=",
"osp",
".",
"abspath",
"(",
"to_text_string",
"(",
"directory",
")",
")",
"if",
"directory",
"in",
"self",
".",
"history",
":",
"self",
".",
"histindex",
"=",... | Update browse history | [
"Update",
"browse",
"history"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1338-L1346 |
30,854 | spyder-ide/spyder | spyder/plugins/explorer/widgets.py | ExplorerWidget.toggle_icontext | def toggle_icontext(self, state):
"""Toggle icon text"""
self.sig_option_changed.emit('show_icontext', state)
for widget in self.action_widgets:
if widget is not self.button_menu:
if state:
widget.setToolButtonStyle(Qt.ToolButtonTextBesideIco... | python | def toggle_icontext(self, state):
"""Toggle icon text"""
self.sig_option_changed.emit('show_icontext', state)
for widget in self.action_widgets:
if widget is not self.button_menu:
if state:
widget.setToolButtonStyle(Qt.ToolButtonTextBesideIco... | [
"def",
"toggle_icontext",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"sig_option_changed",
".",
"emit",
"(",
"'show_icontext'",
",",
"state",
")",
"for",
"widget",
"in",
"self",
".",
"action_widgets",
":",
"if",
"widget",
"is",
"not",
"self",
".",
... | Toggle icon text | [
"Toggle",
"icon",
"text"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/widgets.py#L1463-L1471 |
30,855 | spyder-ide/spyder | spyder/plugins/breakpoints/widgets/breakpointsgui.py | BreakpointTableModel.data | def data(self, index, role=Qt.DisplayRole):
"""Return data at table index"""
if not index.isValid():
return to_qvariant()
if role == Qt.DisplayRole:
if index.column() == 0:
value = osp.basename(self.get_value(index))
return to_qvaria... | python | def data(self, index, role=Qt.DisplayRole):
"""Return data at table index"""
if not index.isValid():
return to_qvariant()
if role == Qt.DisplayRole:
if index.column() == 0:
value = osp.basename(self.get_value(index))
return to_qvaria... | [
"def",
"data",
"(",
"self",
",",
"index",
",",
"role",
"=",
"Qt",
".",
"DisplayRole",
")",
":",
"if",
"not",
"index",
".",
"isValid",
"(",
")",
":",
"return",
"to_qvariant",
"(",
")",
"if",
"role",
"==",
"Qt",
".",
"DisplayRole",
":",
"if",
"index"... | Return data at table index | [
"Return",
"data",
"at",
"table",
"index"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/breakpoints/widgets/breakpointsgui.py#L107-L125 |
30,856 | spyder-ide/spyder | spyder/plugins/editor/lsp/manager.py | LSPManager.get_languages | def get_languages(self):
"""
Get the list of languages we need to start servers and create
clients for.
"""
languages = ['python']
all_options = CONF.options(self.CONF_SECTION)
for option in all_options:
if option in [l.lower() for l in LSP_LANGUAGES]:... | python | def get_languages(self):
"""
Get the list of languages we need to start servers and create
clients for.
"""
languages = ['python']
all_options = CONF.options(self.CONF_SECTION)
for option in all_options:
if option in [l.lower() for l in LSP_LANGUAGES]:... | [
"def",
"get_languages",
"(",
"self",
")",
":",
"languages",
"=",
"[",
"'python'",
"]",
"all_options",
"=",
"CONF",
".",
"options",
"(",
"self",
".",
"CONF_SECTION",
")",
"for",
"option",
"in",
"all_options",
":",
"if",
"option",
"in",
"[",
"l",
".",
"l... | Get the list of languages we need to start servers and create
clients for. | [
"Get",
"the",
"list",
"of",
"languages",
"we",
"need",
"to",
"start",
"servers",
"and",
"create",
"clients",
"for",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/lsp/manager.py#L68-L78 |
30,857 | spyder-ide/spyder | spyder/plugins/editor/lsp/manager.py | LSPManager.get_root_path | def get_root_path(self, language):
"""
Get root path to pass to the LSP servers.
This can be the current project path or the output of
getcwd_or_home (except for Python, see below).
"""
path = None
# Get path of the current project
if self.main and self.... | python | def get_root_path(self, language):
"""
Get root path to pass to the LSP servers.
This can be the current project path or the output of
getcwd_or_home (except for Python, see below).
"""
path = None
# Get path of the current project
if self.main and self.... | [
"def",
"get_root_path",
"(",
"self",
",",
"language",
")",
":",
"path",
"=",
"None",
"# Get path of the current project",
"if",
"self",
".",
"main",
"and",
"self",
".",
"main",
".",
"projects",
":",
"path",
"=",
"self",
".",
"main",
".",
"projects",
".",
... | Get root path to pass to the LSP servers.
This can be the current project path or the output of
getcwd_or_home (except for Python, see below). | [
"Get",
"root",
"path",
"to",
"pass",
"to",
"the",
"LSP",
"servers",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/lsp/manager.py#L87-L115 |
30,858 | spyder-ide/spyder | spyder/plugins/editor/lsp/manager.py | LSPManager.reinitialize_all_clients | def reinitialize_all_clients(self):
"""
Send a new initialize message to each LSP server when the project
path has changed so they can update the respective server root paths.
"""
for language in self.clients:
language_client = self.clients[language]
if la... | python | def reinitialize_all_clients(self):
"""
Send a new initialize message to each LSP server when the project
path has changed so they can update the respective server root paths.
"""
for language in self.clients:
language_client = self.clients[language]
if la... | [
"def",
"reinitialize_all_clients",
"(",
"self",
")",
":",
"for",
"language",
"in",
"self",
".",
"clients",
":",
"language_client",
"=",
"self",
".",
"clients",
"[",
"language",
"]",
"if",
"language_client",
"[",
"'status'",
"]",
"==",
"self",
".",
"RUNNING",... | Send a new initialize message to each LSP server when the project
path has changed so they can update the respective server root paths. | [
"Send",
"a",
"new",
"initialize",
"message",
"to",
"each",
"LSP",
"server",
"when",
"the",
"project",
"path",
"has",
"changed",
"so",
"they",
"can",
"update",
"the",
"respective",
"server",
"root",
"paths",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/lsp/manager.py#L118-L129 |
30,859 | spyder-ide/spyder | spyder/plugins/editor/lsp/manager.py | LSPManager.start_client | def start_client(self, language):
"""Start an LSP client for a given language."""
started = False
if language in self.clients:
language_client = self.clients[language]
queue = self.register_queue[language]
# Don't start LSP services when testing unless we dem... | python | def start_client(self, language):
"""Start an LSP client for a given language."""
started = False
if language in self.clients:
language_client = self.clients[language]
queue = self.register_queue[language]
# Don't start LSP services when testing unless we dem... | [
"def",
"start_client",
"(",
"self",
",",
"language",
")",
":",
"started",
"=",
"False",
"if",
"language",
"in",
"self",
".",
"clients",
":",
"language_client",
"=",
"self",
".",
"clients",
"[",
"language",
"]",
"queue",
"=",
"self",
".",
"register_queue",
... | Start an LSP client for a given language. | [
"Start",
"an",
"LSP",
"client",
"for",
"a",
"given",
"language",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/lsp/manager.py#L131-L172 |
30,860 | spyder-ide/spyder | spyder/plugins/history/confpage.py | HistoryConfigPage.setup_page | def setup_page(self):
"""Setup config page widgets and options."""
settings_group = QGroupBox(_("Settings"))
hist_spin = self.create_spinbox(
_("History depth: "), _(" entries"),
'max_entries', min_=10, max_=10000, step=10,
... | python | def setup_page(self):
"""Setup config page widgets and options."""
settings_group = QGroupBox(_("Settings"))
hist_spin = self.create_spinbox(
_("History depth: "), _(" entries"),
'max_entries', min_=10, max_=10000, step=10,
... | [
"def",
"setup_page",
"(",
"self",
")",
":",
"settings_group",
"=",
"QGroupBox",
"(",
"_",
"(",
"\"Settings\"",
")",
")",
"hist_spin",
"=",
"self",
".",
"create_spinbox",
"(",
"_",
"(",
"\"History depth: \"",
")",
",",
"_",
"(",
"\" entries\"",
")",
",",
... | Setup config page widgets and options. | [
"Setup",
"config",
"page",
"widgets",
"and",
"options",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/history/confpage.py#L25-L54 |
30,861 | spyder-ide/spyder | spyder/utils/encoding.py | transcode | def transcode(text, input=PREFERRED_ENCODING, output=PREFERRED_ENCODING):
"""Transcode a text string"""
try:
return text.decode("cp437").encode("cp1252")
except UnicodeError:
try:
return text.decode("cp437").encode(output)
except UnicodeError:
return t... | python | def transcode(text, input=PREFERRED_ENCODING, output=PREFERRED_ENCODING):
"""Transcode a text string"""
try:
return text.decode("cp437").encode("cp1252")
except UnicodeError:
try:
return text.decode("cp437").encode(output)
except UnicodeError:
return t... | [
"def",
"transcode",
"(",
"text",
",",
"input",
"=",
"PREFERRED_ENCODING",
",",
"output",
"=",
"PREFERRED_ENCODING",
")",
":",
"try",
":",
"return",
"text",
".",
"decode",
"(",
"\"cp437\"",
")",
".",
"encode",
"(",
"\"cp1252\"",
")",
"except",
"UnicodeError",... | Transcode a text string | [
"Transcode",
"a",
"text",
"string"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/encoding.py#L33-L41 |
30,862 | spyder-ide/spyder | spyder/utils/encoding.py | to_unicode_from_fs | def to_unicode_from_fs(string):
"""
Return a unicode version of string decoded using the file system encoding.
"""
if not is_string(string): # string is a QString
string = to_text_string(string.toUtf8(), 'utf-8')
else:
if is_binary_string(string):
try:
... | python | def to_unicode_from_fs(string):
"""
Return a unicode version of string decoded using the file system encoding.
"""
if not is_string(string): # string is a QString
string = to_text_string(string.toUtf8(), 'utf-8')
else:
if is_binary_string(string):
try:
... | [
"def",
"to_unicode_from_fs",
"(",
"string",
")",
":",
"if",
"not",
"is_string",
"(",
"string",
")",
":",
"# string is a QString\r",
"string",
"=",
"to_text_string",
"(",
"string",
".",
"toUtf8",
"(",
")",
",",
"'utf-8'",
")",
"else",
":",
"if",
"is_binary_st... | Return a unicode version of string decoded using the file system encoding. | [
"Return",
"a",
"unicode",
"version",
"of",
"string",
"decoded",
"using",
"the",
"file",
"system",
"encoding",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/encoding.py#L63-L77 |
30,863 | spyder-ide/spyder | spyder/utils/encoding.py | to_fs_from_unicode | def to_fs_from_unicode(unic):
"""
Return a byte string version of unic encoded using the file
system encoding.
"""
if is_unicode(unic):
try:
string = unic.encode(FS_ENCODING)
except (UnicodeError, TypeError):
pass
else:
return s... | python | def to_fs_from_unicode(unic):
"""
Return a byte string version of unic encoded using the file
system encoding.
"""
if is_unicode(unic):
try:
string = unic.encode(FS_ENCODING)
except (UnicodeError, TypeError):
pass
else:
return s... | [
"def",
"to_fs_from_unicode",
"(",
"unic",
")",
":",
"if",
"is_unicode",
"(",
"unic",
")",
":",
"try",
":",
"string",
"=",
"unic",
".",
"encode",
"(",
"FS_ENCODING",
")",
"except",
"(",
"UnicodeError",
",",
"TypeError",
")",
":",
"pass",
"else",
":",
"r... | Return a byte string version of unic encoded using the file
system encoding. | [
"Return",
"a",
"byte",
"string",
"version",
"of",
"unic",
"encoded",
"using",
"the",
"file",
"system",
"encoding",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/encoding.py#L79-L91 |
30,864 | spyder-ide/spyder | spyder/utils/encoding.py | decode | def decode(text):
"""
Function to decode a text.
@param text text to decode (string)
@return decoded text and encoding
"""
try:
if text.startswith(BOM_UTF8):
# UTF-8 with BOM
return to_text_string(text[len(BOM_UTF8):], 'utf-8'), 'utf-8-bom'
elif ... | python | def decode(text):
"""
Function to decode a text.
@param text text to decode (string)
@return decoded text and encoding
"""
try:
if text.startswith(BOM_UTF8):
# UTF-8 with BOM
return to_text_string(text[len(BOM_UTF8):], 'utf-8'), 'utf-8-bom'
elif ... | [
"def",
"decode",
"(",
"text",
")",
":",
"try",
":",
"if",
"text",
".",
"startswith",
"(",
"BOM_UTF8",
")",
":",
"# UTF-8 with BOM\r",
"return",
"to_text_string",
"(",
"text",
"[",
"len",
"(",
"BOM_UTF8",
")",
":",
"]",
",",
"'utf-8'",
")",
",",
"'utf-8... | Function to decode a text.
@param text text to decode (string)
@return decoded text and encoding | [
"Function",
"to",
"decode",
"a",
"text",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/encoding.py#L142-L169 |
30,865 | spyder-ide/spyder | spyder/config/utils.py | _get_pygments_extensions | def _get_pygments_extensions():
"""Return all file type extensions supported by Pygments"""
# NOTE: Leave this import here to keep startup process fast!
import pygments.lexers as lexers
extensions = []
for lx in lexers.get_all_lexers():
lexer_exts = lx[2]
if lexer_exts:
... | python | def _get_pygments_extensions():
"""Return all file type extensions supported by Pygments"""
# NOTE: Leave this import here to keep startup process fast!
import pygments.lexers as lexers
extensions = []
for lx in lexers.get_all_lexers():
lexer_exts = lx[2]
if lexer_exts:
... | [
"def",
"_get_pygments_extensions",
"(",
")",
":",
"# NOTE: Leave this import here to keep startup process fast!",
"import",
"pygments",
".",
"lexers",
"as",
"lexers",
"extensions",
"=",
"[",
"]",
"for",
"lx",
"in",
"lexers",
".",
"get_all_lexers",
"(",
")",
":",
"le... | Return all file type extensions supported by Pygments | [
"Return",
"all",
"file",
"type",
"extensions",
"supported",
"by",
"Pygments"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/utils.py#L82-L102 |
30,866 | spyder-ide/spyder | spyder/config/utils.py | get_filter | def get_filter(filetypes, ext):
"""Return filter associated to file extension"""
if not ext:
return ALL_FILTER
for title, ftypes in filetypes:
if ext in ftypes:
return _create_filter(title, ftypes)
else:
return '' | python | def get_filter(filetypes, ext):
"""Return filter associated to file extension"""
if not ext:
return ALL_FILTER
for title, ftypes in filetypes:
if ext in ftypes:
return _create_filter(title, ftypes)
else:
return '' | [
"def",
"get_filter",
"(",
"filetypes",
",",
"ext",
")",
":",
"if",
"not",
"ext",
":",
"return",
"ALL_FILTER",
"for",
"title",
",",
"ftypes",
"in",
"filetypes",
":",
"if",
"ext",
"in",
"ftypes",
":",
"return",
"_create_filter",
"(",
"title",
",",
"ftypes"... | Return filter associated to file extension | [
"Return",
"filter",
"associated",
"to",
"file",
"extension"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/utils.py#L108-L116 |
30,867 | spyder-ide/spyder | spyder/config/utils.py | get_edit_filetypes | def get_edit_filetypes():
"""Get all file types supported by the Editor"""
# The filter details are not hidden on Windows, so we can't use
# all Pygments extensions on that platform
if os.name == 'nt':
supported_exts = []
else:
try:
supported_exts = _get_pygments_extensio... | python | def get_edit_filetypes():
"""Get all file types supported by the Editor"""
# The filter details are not hidden on Windows, so we can't use
# all Pygments extensions on that platform
if os.name == 'nt':
supported_exts = []
else:
try:
supported_exts = _get_pygments_extensio... | [
"def",
"get_edit_filetypes",
"(",
")",
":",
"# The filter details are not hidden on Windows, so we can't use",
"# all Pygments extensions on that platform",
"if",
"os",
".",
"name",
"==",
"'nt'",
":",
"supported_exts",
"=",
"[",
"]",
"else",
":",
"try",
":",
"supported_ex... | Get all file types supported by the Editor | [
"Get",
"all",
"file",
"types",
"supported",
"by",
"the",
"Editor"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/utils.py#L119-L140 |
30,868 | spyder-ide/spyder | spyder/config/utils.py | is_ubuntu | def is_ubuntu():
"""Detect if we are running in an Ubuntu-based distribution"""
if sys.platform.startswith('linux') and osp.isfile('/etc/lsb-release'):
release_info = open('/etc/lsb-release').read()
if 'Ubuntu' in release_info:
return True
else:
return False
e... | python | def is_ubuntu():
"""Detect if we are running in an Ubuntu-based distribution"""
if sys.platform.startswith('linux') and osp.isfile('/etc/lsb-release'):
release_info = open('/etc/lsb-release').read()
if 'Ubuntu' in release_info:
return True
else:
return False
e... | [
"def",
"is_ubuntu",
"(",
")",
":",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'linux'",
")",
"and",
"osp",
".",
"isfile",
"(",
"'/etc/lsb-release'",
")",
":",
"release_info",
"=",
"open",
"(",
"'/etc/lsb-release'",
")",
".",
"read",
"(",
")",... | Detect if we are running in an Ubuntu-based distribution | [
"Detect",
"if",
"we",
"are",
"running",
"in",
"an",
"Ubuntu",
"-",
"based",
"distribution"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/utils.py#L164-L173 |
30,869 | spyder-ide/spyder | spyder/config/utils.py | is_gtk_desktop | def is_gtk_desktop():
"""Detect if we are running in a Gtk-based desktop"""
if sys.platform.startswith('linux'):
xdg_desktop = os.environ.get('XDG_CURRENT_DESKTOP', '')
if xdg_desktop:
gtk_desktops = ['Unity', 'GNOME', 'XFCE']
if any([xdg_desktop.startswith(d) for d in gt... | python | def is_gtk_desktop():
"""Detect if we are running in a Gtk-based desktop"""
if sys.platform.startswith('linux'):
xdg_desktop = os.environ.get('XDG_CURRENT_DESKTOP', '')
if xdg_desktop:
gtk_desktops = ['Unity', 'GNOME', 'XFCE']
if any([xdg_desktop.startswith(d) for d in gt... | [
"def",
"is_gtk_desktop",
"(",
")",
":",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'linux'",
")",
":",
"xdg_desktop",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'XDG_CURRENT_DESKTOP'",
",",
"''",
")",
"if",
"xdg_desktop",
":",
"gtk_desktops",... | Detect if we are running in a Gtk-based desktop | [
"Detect",
"if",
"we",
"are",
"running",
"in",
"a",
"Gtk",
"-",
"based",
"desktop"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/utils.py#L176-L189 |
30,870 | spyder-ide/spyder | spyder/config/utils.py | is_kde_desktop | def is_kde_desktop():
"""Detect if we are running in a KDE desktop"""
if sys.platform.startswith('linux'):
xdg_desktop = os.environ.get('XDG_CURRENT_DESKTOP', '')
if xdg_desktop:
if 'KDE' in xdg_desktop:
return True
else:
return False
... | python | def is_kde_desktop():
"""Detect if we are running in a KDE desktop"""
if sys.platform.startswith('linux'):
xdg_desktop = os.environ.get('XDG_CURRENT_DESKTOP', '')
if xdg_desktop:
if 'KDE' in xdg_desktop:
return True
else:
return False
... | [
"def",
"is_kde_desktop",
"(",
")",
":",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'linux'",
")",
":",
"xdg_desktop",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'XDG_CURRENT_DESKTOP'",
",",
"''",
")",
"if",
"xdg_desktop",
":",
"if",
"'KDE'"... | Detect if we are running in a KDE desktop | [
"Detect",
"if",
"we",
"are",
"running",
"in",
"a",
"KDE",
"desktop"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/utils.py#L192-L204 |
30,871 | spyder-ide/spyder | spyder/plugins/projects/projecttypes/python.py | PythonProject._get_relative_pythonpath | def _get_relative_pythonpath(self):
"""Return PYTHONPATH list as relative paths"""
# Workaround to replace os.path.relpath (new in Python v2.6):
offset = len(self.root_path)+len(os.pathsep)
return [path[offset:] for path in self.pythonpath] | python | def _get_relative_pythonpath(self):
"""Return PYTHONPATH list as relative paths"""
# Workaround to replace os.path.relpath (new in Python v2.6):
offset = len(self.root_path)+len(os.pathsep)
return [path[offset:] for path in self.pythonpath] | [
"def",
"_get_relative_pythonpath",
"(",
"self",
")",
":",
"# Workaround to replace os.path.relpath (new in Python v2.6):\r",
"offset",
"=",
"len",
"(",
"self",
".",
"root_path",
")",
"+",
"len",
"(",
"os",
".",
"pathsep",
")",
"return",
"[",
"path",
"[",
"offset",... | Return PYTHONPATH list as relative paths | [
"Return",
"PYTHONPATH",
"list",
"as",
"relative",
"paths"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/projecttypes/python.py#L23-L27 |
30,872 | spyder-ide/spyder | spyder/plugins/projects/projecttypes/python.py | PythonProject._set_relative_pythonpath | def _set_relative_pythonpath(self, value):
"""Set PYTHONPATH list relative paths"""
self.pythonpath = [osp.abspath(osp.join(self.root_path, path))
for path in value] | python | def _set_relative_pythonpath(self, value):
"""Set PYTHONPATH list relative paths"""
self.pythonpath = [osp.abspath(osp.join(self.root_path, path))
for path in value] | [
"def",
"_set_relative_pythonpath",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"pythonpath",
"=",
"[",
"osp",
".",
"abspath",
"(",
"osp",
".",
"join",
"(",
"self",
".",
"root_path",
",",
"path",
")",
")",
"for",
"path",
"in",
"value",
"]"
] | Set PYTHONPATH list relative paths | [
"Set",
"PYTHONPATH",
"list",
"relative",
"paths"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/projecttypes/python.py#L29-L32 |
30,873 | spyder-ide/spyder | spyder/plugins/projects/projecttypes/python.py | PythonProject.is_in_pythonpath | def is_in_pythonpath(self, dirname):
"""Return True if dirname is in project's PYTHONPATH"""
return fixpath(dirname) in [fixpath(_p) for _p in self.pythonpath] | python | def is_in_pythonpath(self, dirname):
"""Return True if dirname is in project's PYTHONPATH"""
return fixpath(dirname) in [fixpath(_p) for _p in self.pythonpath] | [
"def",
"is_in_pythonpath",
"(",
"self",
",",
"dirname",
")",
":",
"return",
"fixpath",
"(",
"dirname",
")",
"in",
"[",
"fixpath",
"(",
"_p",
")",
"for",
"_p",
"in",
"self",
".",
"pythonpath",
"]"
] | Return True if dirname is in project's PYTHONPATH | [
"Return",
"True",
"if",
"dirname",
"is",
"in",
"project",
"s",
"PYTHONPATH"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/projecttypes/python.py#L38-L40 |
30,874 | spyder-ide/spyder | spyder/plugins/projects/projecttypes/python.py | PythonProject.remove_from_pythonpath | def remove_from_pythonpath(self, path):
"""Remove path from project's PYTHONPATH
Return True if path was removed, False if it was not found"""
pathlist = self.get_pythonpath()
if path in pathlist:
pathlist.pop(pathlist.index(path))
self.set_pythonpath(pathli... | python | def remove_from_pythonpath(self, path):
"""Remove path from project's PYTHONPATH
Return True if path was removed, False if it was not found"""
pathlist = self.get_pythonpath()
if path in pathlist:
pathlist.pop(pathlist.index(path))
self.set_pythonpath(pathli... | [
"def",
"remove_from_pythonpath",
"(",
"self",
",",
"path",
")",
":",
"pathlist",
"=",
"self",
".",
"get_pythonpath",
"(",
")",
"if",
"path",
"in",
"pathlist",
":",
"pathlist",
".",
"pop",
"(",
"pathlist",
".",
"index",
"(",
"path",
")",
")",
"self",
".... | Remove path from project's PYTHONPATH
Return True if path was removed, False if it was not found | [
"Remove",
"path",
"from",
"project",
"s",
"PYTHONPATH",
"Return",
"True",
"if",
"path",
"was",
"removed",
"False",
"if",
"it",
"was",
"not",
"found"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/projecttypes/python.py#L51-L60 |
30,875 | spyder-ide/spyder | spyder/plugins/projects/projecttypes/python.py | PythonProject.add_to_pythonpath | def add_to_pythonpath(self, path):
"""Add path to project's PYTHONPATH
Return True if path was added, False if it was already there"""
pathlist = self.get_pythonpath()
if path in pathlist:
return False
else:
pathlist.insert(0, path)
sel... | python | def add_to_pythonpath(self, path):
"""Add path to project's PYTHONPATH
Return True if path was added, False if it was already there"""
pathlist = self.get_pythonpath()
if path in pathlist:
return False
else:
pathlist.insert(0, path)
sel... | [
"def",
"add_to_pythonpath",
"(",
"self",
",",
"path",
")",
":",
"pathlist",
"=",
"self",
".",
"get_pythonpath",
"(",
")",
"if",
"path",
"in",
"pathlist",
":",
"return",
"False",
"else",
":",
"pathlist",
".",
"insert",
"(",
"0",
",",
"path",
")",
"self"... | Add path to project's PYTHONPATH
Return True if path was added, False if it was already there | [
"Add",
"path",
"to",
"project",
"s",
"PYTHONPATH",
"Return",
"True",
"if",
"path",
"was",
"added",
"False",
"if",
"it",
"was",
"already",
"there"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/projects/projecttypes/python.py#L62-L71 |
30,876 | spyder-ide/spyder | spyder/app/mainwindow.py | set_opengl_implementation | def set_opengl_implementation(option):
"""
Set the OpenGL implementation used by Spyder.
See issue 7447 for the details.
"""
if option == 'software':
QCoreApplication.setAttribute(Qt.AA_UseSoftwareOpenGL)
if QQuickWindow is not None:
QQuickWindow.setSceneGraphBa... | python | def set_opengl_implementation(option):
"""
Set the OpenGL implementation used by Spyder.
See issue 7447 for the details.
"""
if option == 'software':
QCoreApplication.setAttribute(Qt.AA_UseSoftwareOpenGL)
if QQuickWindow is not None:
QQuickWindow.setSceneGraphBa... | [
"def",
"set_opengl_implementation",
"(",
"option",
")",
":",
"if",
"option",
"==",
"'software'",
":",
"QCoreApplication",
".",
"setAttribute",
"(",
"Qt",
".",
"AA_UseSoftwareOpenGL",
")",
"if",
"QQuickWindow",
"is",
"not",
"None",
":",
"QQuickWindow",
".",
"setS... | Set the OpenGL implementation used by Spyder.
See issue 7447 for the details. | [
"Set",
"the",
"OpenGL",
"implementation",
"used",
"by",
"Spyder",
".",
"See",
"issue",
"7447",
"for",
"the",
"details",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L213-L230 |
30,877 | spyder-ide/spyder | spyder/app/mainwindow.py | setup_logging | def setup_logging(cli_options):
"""Setup logging with cli options defined by the user."""
if cli_options.debug_info or get_debug_level() > 0:
levels = {2: logging.INFO, 3: logging.DEBUG}
log_level = levels[get_debug_level()]
log_format = '%(asctime)s [%(levelname)s] [%(name)s] -> %(... | python | def setup_logging(cli_options):
"""Setup logging with cli options defined by the user."""
if cli_options.debug_info or get_debug_level() > 0:
levels = {2: logging.INFO, 3: logging.DEBUG}
log_level = levels[get_debug_level()]
log_format = '%(asctime)s [%(levelname)s] [%(name)s] -> %(... | [
"def",
"setup_logging",
"(",
"cli_options",
")",
":",
"if",
"cli_options",
".",
"debug_info",
"or",
"get_debug_level",
"(",
")",
">",
"0",
":",
"levels",
"=",
"{",
"2",
":",
"logging",
".",
"INFO",
",",
"3",
":",
"logging",
".",
"DEBUG",
"}",
"log_leve... | Setup logging with cli options defined by the user. | [
"Setup",
"logging",
"with",
"cli",
"options",
"defined",
"by",
"the",
"user",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L233-L248 |
30,878 | spyder-ide/spyder | spyder/app/mainwindow.py | qt_message_handler | def qt_message_handler(msg_type, msg_log_context, msg_string):
"""
Qt warning messages are intercepted by this handler.
On some operating systems, warning messages might be displayed
even if the actual message does not apply. This filter adds a
blacklist for messages that are being printed fo... | python | def qt_message_handler(msg_type, msg_log_context, msg_string):
"""
Qt warning messages are intercepted by this handler.
On some operating systems, warning messages might be displayed
even if the actual message does not apply. This filter adds a
blacklist for messages that are being printed fo... | [
"def",
"qt_message_handler",
"(",
"msg_type",
",",
"msg_log_context",
",",
"msg_string",
")",
":",
"BLACKLIST",
"=",
"[",
"'QMainWidget::resizeDocks: all sizes need to be larger than 0'",
",",
"]",
"if",
"DEV",
"or",
"msg_string",
"not",
"in",
"BLACKLIST",
":",
"print... | Qt warning messages are intercepted by this handler.
On some operating systems, warning messages might be displayed
even if the actual message does not apply. This filter adds a
blacklist for messages that are being printed for no apparent
reason. Anything else will get printed in the internal con... | [
"Qt",
"warning",
"messages",
"are",
"intercepted",
"by",
"this",
"handler",
".",
"On",
"some",
"operating",
"systems",
"warning",
"messages",
"might",
"be",
"displayed",
"even",
"if",
"the",
"actual",
"message",
"does",
"not",
"apply",
".",
"This",
"filter",
... | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L251-L266 |
30,879 | spyder-ide/spyder | spyder/app/mainwindow.py | initialize | def initialize():
"""Initialize Qt, patching sys.exit and eventually setting up ETS"""
# This doesn't create our QApplication, just holds a reference to
# MAIN_APP, created above to show our splash screen as early as
# possible
app = qapplication()
# --- Set application icon
app.set... | python | def initialize():
"""Initialize Qt, patching sys.exit and eventually setting up ETS"""
# This doesn't create our QApplication, just holds a reference to
# MAIN_APP, created above to show our splash screen as early as
# possible
app = qapplication()
# --- Set application icon
app.set... | [
"def",
"initialize",
"(",
")",
":",
"# This doesn't create our QApplication, just holds a reference to\r",
"# MAIN_APP, created above to show our splash screen as early as\r",
"# possible\r",
"app",
"=",
"qapplication",
"(",
")",
"# --- Set application icon\r",
"app",
".",
"setWindow... | Initialize Qt, patching sys.exit and eventually setting up ETS | [
"Initialize",
"Qt",
"patching",
"sys",
".",
"exit",
"and",
"eventually",
"setting",
"up",
"ETS"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L3210-L3253 |
30,880 | spyder-ide/spyder | spyder/app/mainwindow.py | run_spyder | def run_spyder(app, options, args):
"""
Create and show Spyder's main window
Start QApplication event loop
"""
#TODO: insert here
# Main window
main = MainWindow(options)
try:
main.setup()
except BaseException:
if main.console is not None:
try:... | python | def run_spyder(app, options, args):
"""
Create and show Spyder's main window
Start QApplication event loop
"""
#TODO: insert here
# Main window
main = MainWindow(options)
try:
main.setup()
except BaseException:
if main.console is not None:
try:... | [
"def",
"run_spyder",
"(",
"app",
",",
"options",
",",
"args",
")",
":",
"#TODO: insert here\r",
"# Main window\r",
"main",
"=",
"MainWindow",
"(",
"options",
")",
"try",
":",
"main",
".",
"setup",
"(",
")",
"except",
"BaseException",
":",
"if",
"main",
"."... | Create and show Spyder's main window
Start QApplication event loop | [
"Create",
"and",
"show",
"Spyder",
"s",
"main",
"window",
"Start",
"QApplication",
"event",
"loop"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L3274-L3318 |
30,881 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.post_visible_setup | def post_visible_setup(self):
"""Actions to be performed only after the main window's `show` method
was triggered"""
self.restore_scrollbar_position.emit()
# [Workaround for Issue 880]
# QDockWidget objects are not painted if restored as floating
# windows, so we ... | python | def post_visible_setup(self):
"""Actions to be performed only after the main window's `show` method
was triggered"""
self.restore_scrollbar_position.emit()
# [Workaround for Issue 880]
# QDockWidget objects are not painted if restored as floating
# windows, so we ... | [
"def",
"post_visible_setup",
"(",
"self",
")",
":",
"self",
".",
"restore_scrollbar_position",
".",
"emit",
"(",
")",
"# [Workaround for Issue 880]\r",
"# QDockWidget objects are not painted if restored as floating\r",
"# windows, so we must dock them before showing the mainwindow,\r",... | Actions to be performed only after the main window's `show` method
was triggered | [
"Actions",
"to",
"be",
"performed",
"only",
"after",
"the",
"main",
"window",
"s",
"show",
"method",
"was",
"triggered"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1265-L1349 |
30,882 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.set_window_title | def set_window_title(self):
"""Set window title."""
if DEV is not None:
title = u"Spyder %s (Python %s.%s)" % (__version__,
sys.version_info[0],
sys.version_info[1])
else:
... | python | def set_window_title(self):
"""Set window title."""
if DEV is not None:
title = u"Spyder %s (Python %s.%s)" % (__version__,
sys.version_info[0],
sys.version_info[1])
else:
... | [
"def",
"set_window_title",
"(",
"self",
")",
":",
"if",
"DEV",
"is",
"not",
"None",
":",
"title",
"=",
"u\"Spyder %s (Python %s.%s)\"",
"%",
"(",
"__version__",
",",
"sys",
".",
"version_info",
"[",
"0",
"]",
",",
"sys",
".",
"version_info",
"[",
"1",
"]... | Set window title. | [
"Set",
"window",
"title",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1351-L1374 |
30,883 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.report_missing_dependencies | def report_missing_dependencies(self):
"""Show a QMessageBox with a list of missing hard dependencies"""
missing_deps = dependencies.missing_dependencies()
if missing_deps:
QMessageBox.critical(self, _('Error'),
_("<b>You have missing dependencies!</b>"
... | python | def report_missing_dependencies(self):
"""Show a QMessageBox with a list of missing hard dependencies"""
missing_deps = dependencies.missing_dependencies()
if missing_deps:
QMessageBox.critical(self, _('Error'),
_("<b>You have missing dependencies!</b>"
... | [
"def",
"report_missing_dependencies",
"(",
"self",
")",
":",
"missing_deps",
"=",
"dependencies",
".",
"missing_dependencies",
"(",
")",
"if",
"missing_deps",
":",
"QMessageBox",
".",
"critical",
"(",
"self",
",",
"_",
"(",
"'Error'",
")",
",",
"_",
"(",
"\"... | Show a QMessageBox with a list of missing hard dependencies | [
"Show",
"a",
"QMessageBox",
"with",
"a",
"list",
"of",
"missing",
"hard",
"dependencies"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1376-L1393 |
30,884 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.get_window_settings | def get_window_settings(self):
"""Return current window settings
Symetric to the 'set_window_settings' setter"""
window_size = (self.window_size.width(), self.window_size.height())
is_fullscreen = self.isFullScreen()
if is_fullscreen:
is_maximized = self.maximiz... | python | def get_window_settings(self):
"""Return current window settings
Symetric to the 'set_window_settings' setter"""
window_size = (self.window_size.width(), self.window_size.height())
is_fullscreen = self.isFullScreen()
if is_fullscreen:
is_maximized = self.maximiz... | [
"def",
"get_window_settings",
"(",
"self",
")",
":",
"window_size",
"=",
"(",
"self",
".",
"window_size",
".",
"width",
"(",
")",
",",
"self",
".",
"window_size",
".",
"height",
"(",
")",
")",
"is_fullscreen",
"=",
"self",
".",
"isFullScreen",
"(",
")",
... | Return current window settings
Symetric to the 'set_window_settings' setter | [
"Return",
"current",
"window",
"settings",
"Symetric",
"to",
"the",
"set_window_settings",
"setter"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1423-L1437 |
30,885 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.set_window_settings | def set_window_settings(self, hexstate, window_size, prefs_dialog_size,
pos, is_maximized, is_fullscreen):
"""Set window settings
Symetric to the 'get_window_settings' accessor"""
self.setUpdatesEnabled(False)
self.window_size = QSize(window_size[0], wind... | python | def set_window_settings(self, hexstate, window_size, prefs_dialog_size,
pos, is_maximized, is_fullscreen):
"""Set window settings
Symetric to the 'get_window_settings' accessor"""
self.setUpdatesEnabled(False)
self.window_size = QSize(window_size[0], wind... | [
"def",
"set_window_settings",
"(",
"self",
",",
"hexstate",
",",
"window_size",
",",
"prefs_dialog_size",
",",
"pos",
",",
"is_maximized",
",",
"is_fullscreen",
")",
":",
"self",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"self",
".",
"window_size",
"=",
"QS... | Set window settings
Symetric to the 'get_window_settings' accessor | [
"Set",
"window",
"settings",
"Symetric",
"to",
"the",
"get_window_settings",
"accessor"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1439-L1474 |
30,886 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.tabify_plugins | def tabify_plugins(self, first, second):
"""Tabify plugin dockwigdets"""
self.tabifyDockWidget(first.dockwidget, second.dockwidget) | python | def tabify_plugins(self, first, second):
"""Tabify plugin dockwigdets"""
self.tabifyDockWidget(first.dockwidget, second.dockwidget) | [
"def",
"tabify_plugins",
"(",
"self",
",",
"first",
",",
"second",
")",
":",
"self",
".",
"tabifyDockWidget",
"(",
"first",
".",
"dockwidget",
",",
"second",
".",
"dockwidget",
")"
] | Tabify plugin dockwigdets | [
"Tabify",
"plugin",
"dockwigdets"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1499-L1501 |
30,887 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.setup_layout | def setup_layout(self, default=False):
"""Setup window layout"""
prefix = 'window' + '/'
settings = self.load_window_settings(prefix, default)
hexstate = settings[0]
self.first_spyder_run = False
if hexstate is None:
# First Spyder execution:
... | python | def setup_layout(self, default=False):
"""Setup window layout"""
prefix = 'window' + '/'
settings = self.load_window_settings(prefix, default)
hexstate = settings[0]
self.first_spyder_run = False
if hexstate is None:
# First Spyder execution:
... | [
"def",
"setup_layout",
"(",
"self",
",",
"default",
"=",
"False",
")",
":",
"prefix",
"=",
"'window'",
"+",
"'/'",
"settings",
"=",
"self",
".",
"load_window_settings",
"(",
"prefix",
",",
"default",
")",
"hexstate",
"=",
"settings",
"[",
"0",
"]",
"self... | Setup window layout | [
"Setup",
"window",
"layout"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1504-L1551 |
30,888 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.reset_window_layout | def reset_window_layout(self):
"""Reset window layout to default"""
answer = QMessageBox.warning(self, _("Warning"),
_("Window layout will be reset to default settings: "
"this affects window position, size and dockwidgets.\n"
"Do y... | python | def reset_window_layout(self):
"""Reset window layout to default"""
answer = QMessageBox.warning(self, _("Warning"),
_("Window layout will be reset to default settings: "
"this affects window position, size and dockwidgets.\n"
"Do y... | [
"def",
"reset_window_layout",
"(",
"self",
")",
":",
"answer",
"=",
"QMessageBox",
".",
"warning",
"(",
"self",
",",
"_",
"(",
"\"Warning\"",
")",
",",
"_",
"(",
"\"Window layout will be reset to default settings: \"",
"\"this affects window position, size and dockwidgets... | Reset window layout to default | [
"Reset",
"window",
"layout",
"to",
"default"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1903-L1911 |
30,889 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.quick_layout_save | def quick_layout_save(self):
"""Save layout dialog"""
get = CONF.get
set_ = CONF.set
names = get('quick_layouts', 'names')
order = get('quick_layouts', 'order')
active = get('quick_layouts', 'active')
dlg = self.dialog_layout_save(self, names)
... | python | def quick_layout_save(self):
"""Save layout dialog"""
get = CONF.get
set_ = CONF.set
names = get('quick_layouts', 'names')
order = get('quick_layouts', 'order')
active = get('quick_layouts', 'active')
dlg = self.dialog_layout_save(self, names)
... | [
"def",
"quick_layout_save",
"(",
"self",
")",
":",
"get",
"=",
"CONF",
".",
"get",
"set_",
"=",
"CONF",
".",
"set",
"names",
"=",
"get",
"(",
"'quick_layouts'",
",",
"'names'",
")",
"order",
"=",
"get",
"(",
"'quick_layouts'",
",",
"'order'",
")",
"act... | Save layout dialog | [
"Save",
"layout",
"dialog"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1913-L1954 |
30,890 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.quick_layout_settings | def quick_layout_settings(self):
"""Layout settings dialog"""
get = CONF.get
set_ = CONF.set
section = 'quick_layouts'
names = get(section, 'names')
order = get(section, 'order')
active = get(section, 'active')
dlg = self.dialog_layout_settin... | python | def quick_layout_settings(self):
"""Layout settings dialog"""
get = CONF.get
set_ = CONF.set
section = 'quick_layouts'
names = get(section, 'names')
order = get(section, 'order')
active = get(section, 'active')
dlg = self.dialog_layout_settin... | [
"def",
"quick_layout_settings",
"(",
"self",
")",
":",
"get",
"=",
"CONF",
".",
"get",
"set_",
"=",
"CONF",
".",
"set",
"section",
"=",
"'quick_layouts'",
"names",
"=",
"get",
"(",
"section",
",",
"'names'",
")",
"order",
"=",
"get",
"(",
"section",
",... | Layout settings dialog | [
"Layout",
"settings",
"dialog"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L1956-L1972 |
30,891 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow._update_show_toolbars_action | def _update_show_toolbars_action(self):
"""Update the text displayed in the menu entry."""
if self.toolbars_visible:
text = _("Hide toolbars")
tip = _("Hide toolbars")
else:
text = _("Show toolbars")
tip = _("Show toolbars")
self.sh... | python | def _update_show_toolbars_action(self):
"""Update the text displayed in the menu entry."""
if self.toolbars_visible:
text = _("Hide toolbars")
tip = _("Hide toolbars")
else:
text = _("Show toolbars")
tip = _("Show toolbars")
self.sh... | [
"def",
"_update_show_toolbars_action",
"(",
"self",
")",
":",
"if",
"self",
".",
"toolbars_visible",
":",
"text",
"=",
"_",
"(",
"\"Hide toolbars\"",
")",
"tip",
"=",
"_",
"(",
"\"Hide toolbars\"",
")",
"else",
":",
"text",
"=",
"_",
"(",
"\"Show toolbars\""... | Update the text displayed in the menu entry. | [
"Update",
"the",
"text",
"displayed",
"in",
"the",
"menu",
"entry",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2017-L2026 |
30,892 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.save_visible_toolbars | def save_visible_toolbars(self):
"""Saves the name of the visible toolbars in the .ini file."""
toolbars = []
for toolbar in self.visible_toolbars:
toolbars.append(toolbar.objectName())
CONF.set('main', 'last_visible_toolbars', toolbars) | python | def save_visible_toolbars(self):
"""Saves the name of the visible toolbars in the .ini file."""
toolbars = []
for toolbar in self.visible_toolbars:
toolbars.append(toolbar.objectName())
CONF.set('main', 'last_visible_toolbars', toolbars) | [
"def",
"save_visible_toolbars",
"(",
"self",
")",
":",
"toolbars",
"=",
"[",
"]",
"for",
"toolbar",
"in",
"self",
".",
"visible_toolbars",
":",
"toolbars",
".",
"append",
"(",
"toolbar",
".",
"objectName",
"(",
")",
")",
"CONF",
".",
"set",
"(",
"'main'"... | Saves the name of the visible toolbars in the .ini file. | [
"Saves",
"the",
"name",
"of",
"the",
"visible",
"toolbars",
"in",
"the",
".",
"ini",
"file",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2028-L2033 |
30,893 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.get_visible_toolbars | def get_visible_toolbars(self):
"""Collects the visible toolbars."""
toolbars = []
for toolbar in self.toolbarslist:
if toolbar.toggleViewAction().isChecked():
toolbars.append(toolbar)
self.visible_toolbars = toolbars | python | def get_visible_toolbars(self):
"""Collects the visible toolbars."""
toolbars = []
for toolbar in self.toolbarslist:
if toolbar.toggleViewAction().isChecked():
toolbars.append(toolbar)
self.visible_toolbars = toolbars | [
"def",
"get_visible_toolbars",
"(",
"self",
")",
":",
"toolbars",
"=",
"[",
"]",
"for",
"toolbar",
"in",
"self",
".",
"toolbarslist",
":",
"if",
"toolbar",
".",
"toggleViewAction",
"(",
")",
".",
"isChecked",
"(",
")",
":",
"toolbars",
".",
"append",
"("... | Collects the visible toolbars. | [
"Collects",
"the",
"visible",
"toolbars",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2035-L2041 |
30,894 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.valid_project | def valid_project(self):
"""Handle an invalid active project."""
try:
path = self.projects.get_active_project_path()
except AttributeError:
return
if bool(path):
if not self.projects.is_valid_project(path):
if path:
... | python | def valid_project(self):
"""Handle an invalid active project."""
try:
path = self.projects.get_active_project_path()
except AttributeError:
return
if bool(path):
if not self.projects.is_valid_project(path):
if path:
... | [
"def",
"valid_project",
"(",
"self",
")",
":",
"try",
":",
"path",
"=",
"self",
".",
"projects",
".",
"get_active_project_path",
"(",
")",
"except",
"AttributeError",
":",
"return",
"if",
"bool",
"(",
"path",
")",
":",
"if",
"not",
"self",
".",
"projects... | Handle an invalid active project. | [
"Handle",
"an",
"invalid",
"active",
"project",
"."
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2086-L2102 |
30,895 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.show_shortcuts | def show_shortcuts(self, menu):
"""Show action shortcuts in menu"""
for element in getattr(self, menu + '_menu_actions'):
if element and isinstance(element, QAction):
if element._shown_shortcut is not None:
element.setShortcut(element._shown_shortcut) | python | def show_shortcuts(self, menu):
"""Show action shortcuts in menu"""
for element in getattr(self, menu + '_menu_actions'):
if element and isinstance(element, QAction):
if element._shown_shortcut is not None:
element.setShortcut(element._shown_shortcut) | [
"def",
"show_shortcuts",
"(",
"self",
",",
"menu",
")",
":",
"for",
"element",
"in",
"getattr",
"(",
"self",
",",
"menu",
"+",
"'_menu_actions'",
")",
":",
"if",
"element",
"and",
"isinstance",
"(",
"element",
",",
"QAction",
")",
":",
"if",
"element",
... | Show action shortcuts in menu | [
"Show",
"action",
"shortcuts",
"in",
"menu"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2113-L2118 |
30,896 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.hide_shortcuts | def hide_shortcuts(self, menu):
"""Hide action shortcuts in menu"""
for element in getattr(self, menu + '_menu_actions'):
if element and isinstance(element, QAction):
if element._shown_shortcut is not None:
element.setShortcut(QKeySequence()) | python | def hide_shortcuts(self, menu):
"""Hide action shortcuts in menu"""
for element in getattr(self, menu + '_menu_actions'):
if element and isinstance(element, QAction):
if element._shown_shortcut is not None:
element.setShortcut(QKeySequence()) | [
"def",
"hide_shortcuts",
"(",
"self",
",",
"menu",
")",
":",
"for",
"element",
"in",
"getattr",
"(",
"self",
",",
"menu",
"+",
"'_menu_actions'",
")",
":",
"if",
"element",
"and",
"isinstance",
"(",
"element",
",",
"QAction",
")",
":",
"if",
"element",
... | Hide action shortcuts in menu | [
"Hide",
"action",
"shortcuts",
"in",
"menu"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2120-L2125 |
30,897 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.update_edit_menu | def update_edit_menu(self):
"""Update edit menu"""
widget, textedit_properties = self.get_focus_widget_properties()
if textedit_properties is None: # widget is not an editor/console
return
# !!! Below this line, widget is expected to be a QPlainTextEdit
# in... | python | def update_edit_menu(self):
"""Update edit menu"""
widget, textedit_properties = self.get_focus_widget_properties()
if textedit_properties is None: # widget is not an editor/console
return
# !!! Below this line, widget is expected to be a QPlainTextEdit
# in... | [
"def",
"update_edit_menu",
"(",
"self",
")",
":",
"widget",
",",
"textedit_properties",
"=",
"self",
".",
"get_focus_widget_properties",
"(",
")",
"if",
"textedit_properties",
"is",
"None",
":",
"# widget is not an editor/console\r",
"return",
"# !!! Below this line, widg... | Update edit menu | [
"Update",
"edit",
"menu"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2143-L2178 |
30,898 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.update_search_menu | def update_search_menu(self):
"""Update search menu"""
# Disabling all actions except the last one
# (which is Find in files) to begin with
for child in self.search_menu.actions()[:-1]:
child.setEnabled(False)
widget, textedit_properties = self.get_focus_widge... | python | def update_search_menu(self):
"""Update search menu"""
# Disabling all actions except the last one
# (which is Find in files) to begin with
for child in self.search_menu.actions()[:-1]:
child.setEnabled(False)
widget, textedit_properties = self.get_focus_widge... | [
"def",
"update_search_menu",
"(",
"self",
")",
":",
"# Disabling all actions except the last one\r",
"# (which is Find in files) to begin with\r",
"for",
"child",
"in",
"self",
".",
"search_menu",
".",
"actions",
"(",
")",
"[",
":",
"-",
"1",
"]",
":",
"child",
".",... | Update search menu | [
"Update",
"search",
"menu"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2180-L2204 |
30,899 | spyder-ide/spyder | spyder/app/mainwindow.py | MainWindow.set_splash | def set_splash(self, message):
"""Set splash message"""
if self.splash is None:
return
if message:
logger.info(message)
self.splash.show()
self.splash.showMessage(message, Qt.AlignBottom | Qt.AlignCenter |
Qt.AlignAb... | python | def set_splash(self, message):
"""Set splash message"""
if self.splash is None:
return
if message:
logger.info(message)
self.splash.show()
self.splash.showMessage(message, Qt.AlignBottom | Qt.AlignCenter |
Qt.AlignAb... | [
"def",
"set_splash",
"(",
"self",
",",
"message",
")",
":",
"if",
"self",
".",
"splash",
"is",
"None",
":",
"return",
"if",
"message",
":",
"logger",
".",
"info",
"(",
"message",
")",
"self",
".",
"splash",
".",
"show",
"(",
")",
"self",
".",
"spla... | Set splash message | [
"Set",
"splash",
"message"
] | f76836ce1b924bcc4efd3f74f2960d26a4e528e0 | https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/app/mainwindow.py#L2255-L2264 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.