Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def show_warning(self, index):
try:
val_size = index.model().sizes[index.row()]
val_type = index.model().types[index.row()]
except:
return False
if val_type in ['list', 'set', 'tuple', 'dict'] and \
... | [
"\r\n Decide if showing a warning when the user is trying to view\r\n a big variable associated to a Tablemodel index\r\n\r\n This avoids getting the variables' value to know its\r\n size and type, using instead those already computed by\r\n the TableModel.\r\n \r\n ... |
Please provide a description of the function:def createEditor(self, parent, option, index):
if index.column() < 3:
return None
if self.show_warning(index):
answer = QMessageBox.warning(self.parent(), _("Warning"),
_("Opening th... | [
"Overriding method createEditor"
] |
Please provide a description of the function:def setEditorData(self, editor, index):
value = self.get_value(index)
if isinstance(editor, QLineEdit):
if is_binary_string(value):
try:
value = to_text_string(value, 'utf8')
exce... | [
"\r\n Overriding method setEditorData\r\n Model --> Editor\r\n "
] |
Please provide a description of the function:def setModelData(self, editor, model, index):
if not hasattr(model, "set_value"):
# Read-only mode
return
if isinstance(editor, QLineEdit):
value = editor.text()
try:
v... | [
"\r\n Overriding method setModelData\r\n Editor --> Model\r\n "
] |
Please provide a description of the function:def setup_table(self):
self.horizontalHeader().setStretchLastSection(True)
self.adjust_columns()
# Sorting columns
self.setSortingEnabled(True)
self.sortByColumn(0, Qt.AscendingOrder) | [
"Setup table"
] |
Please provide a description of the function:def setup_menu(self, minmax):
if self.minmax_action is not None:
self.minmax_action.setChecked(minmax)
return
resize_action = create_action(self, _("Resize rows to contents"),
... | [
"Setup context menu"
] |
Please provide a description of the function:def refresh_menu(self):
index = self.currentIndex()
condition = index.isValid()
self.edit_action.setEnabled( condition )
self.remove_action.setEnabled( condition )
self.refresh_plot_entries(index) | [
"Refresh context menu"
] |
Please provide a description of the function:def set_data(self, data):
if data is not None:
self.model.set_data(data, self.dictfilter)
self.sortByColumn(0, Qt.AscendingOrder) | [
"Set table data"
] |
Please provide a description of the function:def mousePressEvent(self, event):
if event.button() != Qt.LeftButton:
QTableView.mousePressEvent(self, event)
return
index_clicked = self.indexAt(event.pos())
if index_clicked.isValid():
if index_cli... | [
"Reimplement Qt method"
] |
Please provide a description of the function:def mouseDoubleClickEvent(self, event):
index_clicked = self.indexAt(event.pos())
if index_clicked.isValid():
row = index_clicked.row()
# TODO: Remove hard coded "Value" column number (3 here)
index_clicked =... | [
"Reimplement Qt method"
] |
Please provide a description of the function:def keyPressEvent(self, event):
if event.key() == Qt.Key_Delete:
self.remove_item()
elif event.key() == Qt.Key_F2:
self.rename_item()
elif event == QKeySequence.Copy:
self.copy()
elif event ... | [
"Reimplement Qt methods"
] |
Please provide a description of the function:def contextMenuEvent(self, event):
if self.model.showndata:
self.refresh_menu()
self.menu.popup(event.globalPos())
event.accept()
else:
self.empty_ws_menu.popup(event.globalPos())
ev... | [
"Reimplement Qt method"
] |
Please provide a description of the function:def dragEnterEvent(self, event):
if mimedata2url(event.mimeData()):
event.accept()
else:
event.ignore() | [
"Allow user to drag files"
] |
Please provide a description of the function:def dragMoveEvent(self, event):
if mimedata2url(event.mimeData()):
event.setDropAction(Qt.CopyAction)
event.accept()
else:
event.ignore() | [
"Allow user to move files"
] |
Please provide a description of the function:def dropEvent(self, event):
urls = mimedata2url(event.mimeData())
if urls:
event.setDropAction(Qt.CopyAction)
event.accept()
self.sig_files_dropped.emit(urls)
else:
event.ignore() | [
"Allow user to drop supported files"
] |
Please provide a description of the function:def toggle_minmax(self, state):
self.sig_option_changed.emit('minmax', state)
self.model.minmax = state | [
"Toggle min/max display for numpy arrays"
] |
Please provide a description of the function:def set_dataframe_format(self, new_format):
self.sig_option_changed.emit('dataframe_format', new_format)
self.model.dataframe_format = new_format | [
"\r\n Set format to use in DataframeEditor.\r\n\r\n Args:\r\n new_format (string): e.g. \"%.3f\"\r\n "
] |
Please provide a description of the function:def edit_item(self):
index = self.currentIndex()
if not index.isValid():
return
# TODO: Remove hard coded "Value" column number (3 here)
self.edit(index.child(index.row(), 3)) | [
"Edit item"
] |
Please provide a description of the function:def remove_item(self):
indexes = self.selectedIndexes()
if not indexes:
return
for index in indexes:
if not index.isValid():
return
one = _("Do you want to remove the selected item?")
... | [
"Remove item"
] |
Please provide a description of the function:def copy_item(self, erase_original=False):
indexes = self.selectedIndexes()
if not indexes:
return
idx_rows = unsorted_unique([idx.row() for idx in indexes])
if len(idx_rows) > 1 or not indexes[0].isValid():
... | [
"Copy item"
] |
Please provide a description of the function:def insert_item(self):
index = self.currentIndex()
if not index.isValid():
row = self.model.rowCount()
else:
row = index.row()
data = self.model.get_data()
if isinstance(data, list):
... | [
"Insert item"
] |
Please provide a description of the function:def plot_item(self, funcname):
index = self.currentIndex()
if self.__prepare_plot():
key = self.model.get_key(index)
try:
self.plot(key, funcname)
except (ValueError, TypeError) as error:
... | [
"Plot item"
] |
Please provide a description of the function:def imshow_item(self):
index = self.currentIndex()
if self.__prepare_plot():
key = self.model.get_key(index)
try:
if self.is_image(key):
self.show_image(key)
else:
... | [
"Imshow item"
] |
Please provide a description of the function:def save_array(self):
title = _( "Save array")
if self.array_filename is None:
self.array_filename = getcwd_or_home()
self.redirect_stdio.emit(False)
filename, _selfilter = getsavefilename(self, title,
... | [
"Save array"
] |
Please provide a description of the function:def copy(self):
clipboard = QApplication.clipboard()
clipl = []
for idx in self.selectedIndexes():
if not idx.isValid():
continue
obj = self.delegate.get_value(idx)
# Check if we are... | [
"Copy text to clipboard"
] |
Please provide a description of the function:def import_from_string(self, text, title=None):
data = self.model.get_data()
# Check if data is a dict
if not hasattr(data, "keys"):
return
editor = ImportWizard(self, text, title=title,
... | [
"Import data from string"
] |
Please provide a description of the function:def paste(self):
clipboard = QApplication.clipboard()
cliptext = ''
if clipboard.mimeData().hasText():
cliptext = to_text_string(clipboard.text())
if cliptext.strip():
self.import_from_string(cliptext, t... | [
"Import text/data/code from clipboard"
] |
Please provide a description of the function:def remove_values(self, keys):
data = self.model.get_data()
for key in sorted(keys, reverse=True):
data.pop(key)
self.set_data(data) | [
"Remove values from data"
] |
Please provide a description of the function:def copy_value(self, orig_key, new_key):
data = self.model.get_data()
if isinstance(data, list):
data.append(data[orig_key])
if isinstance(data, set):
data.add(data[orig_key])
else:
data[new... | [
"Copy value"
] |
Please provide a description of the function:def new_value(self, key, value):
data = self.model.get_data()
data[key] = value
self.set_data(data) | [
"Create new value in data"
] |
Please provide a description of the function:def is_list(self, key):
data = self.model.get_data()
return isinstance(data[key], (tuple, list)) | [
"Return True if variable is a list or a tuple"
] |
Please provide a description of the function:def is_set(self, key):
data = self.model.get_data()
return isinstance(data[key], set) | [
"Return True if variable is a set"
] |
Please provide a description of the function:def get_len(self, key):
data = self.model.get_data()
return len(data[key]) | [
"Return sequence length"
] |
Please provide a description of the function:def is_array(self, key):
data = self.model.get_data()
return isinstance(data[key], (ndarray, MaskedArray)) | [
"Return True if variable is a numpy array"
] |
Please provide a description of the function:def is_image(self, key):
data = self.model.get_data()
return isinstance(data[key], Image) | [
"Return True if variable is a PIL.Image image"
] |
Please provide a description of the function:def is_dict(self, key):
data = self.model.get_data()
return isinstance(data[key], dict) | [
"Return True if variable is a dictionary"
] |
Please provide a description of the function:def get_array_shape(self, key):
data = self.model.get_data()
return data[key].shape | [
"Return array's shape"
] |
Please provide a description of the function:def get_array_ndim(self, key):
data = self.model.get_data()
return data[key].ndim | [
"Return array's ndim"
] |
Please provide a description of the function:def oedit(self, key):
data = self.model.get_data()
from spyder.plugins.variableexplorer.widgets.objecteditor import (
oedit)
oedit(data[key]) | [
"Edit item"
] |
Please provide a description of the function:def plot(self, key, funcname):
data = self.model.get_data()
import spyder.pyplot as plt
plt.figure()
getattr(plt, funcname)(data[key])
plt.show() | [
"Plot item"
] |
Please provide a description of the function:def imshow(self, key):
data = self.model.get_data()
import spyder.pyplot as plt
plt.figure()
plt.imshow(data[key])
plt.show() | [
"Show item's image"
] |
Please provide a description of the function:def show_image(self, key):
data = self.model.get_data()
data[key].show() | [
"Show image (item is a PIL image)"
] |
Please provide a description of the function:def refresh_menu(self):
data = self.model.get_data()
index = self.currentIndex()
condition = (not isinstance(data, (tuple, set))) and index.isValid() \
and not self.readonly
self.edit_action.setEnabled( condi... | [
"Refresh context menu"
] |
Please provide a description of the function:def setup(self, data, title='', readonly=False, width=650, remote=False,
icon=None, parent=None):
if isinstance(data, (dict, set)):
# dictionnary, set
self.data_copy = data.copy()
datalen = len(data)
... | [
"Setup editor."
] |
Please provide a description of the function:def save_and_close_enable(self):
if self.btn_save_and_close:
self.btn_save_and_close.setEnabled(True)
self.btn_save_and_close.setAutoDefault(True)
self.btn_save_and_close.setDefault(True) | [
"Handle the data change event to enable the save and close button."
] |
Please provide a description of the function:def get_value(self, name):
value = self.shellwidget.get_value(name)
# Reset temporal variable where value is saved to
# save memory
self.shellwidget._kernel_value = None
return value | [
"Get the value of a variable"
] |
Please provide a description of the function:def new_value(self, name, value):
try:
# We need to enclose values in a list to be able to send
# them to the kernel in Python 2
svalue = [cloudpickle.dumps(value, protocol=PICKLE_PROTOCOL)]
# Needed to... | [
"Create new value in data"
] |
Please provide a description of the function:def remove_values(self, names):
for name in names:
self.shellwidget.remove_value(name)
self.shellwidget.refresh_namespacebrowser() | [
"Remove values from data"
] |
Please provide a description of the function:def copy_value(self, orig_name, new_name):
self.shellwidget.copy_value(orig_name, new_name)
self.shellwidget.refresh_namespacebrowser() | [
"Copy value"
] |
Please provide a description of the function:def plot(self, name, funcname):
sw = self.shellwidget
if sw._reading:
sw.dbg_exec_magic('varexp', '--%s %s' % (funcname, name))
else:
sw.execute("%%varexp --%s %s" % (funcname, name)) | [
"Plot item"
] |
Please provide a description of the function:def imshow(self, name):
sw = self.shellwidget
if sw._reading:
sw.dbg_exec_magic('varexp', '--imshow %s' % name)
else:
sw.execute("%%varexp --imshow %s" % name) | [
"Show item's image"
] |
Please provide a description of the function:def show_image(self, name):
command = "%s.show()" % name
sw = self.shellwidget
if sw._reading:
sw.kernel_client.input(command)
else:
sw.execute(command) | [
"Show image (item is a PIL image)"
] |
Please provide a description of the function:def kernel_id(self):
if self.connection_file is not None:
json_file = osp.basename(self.connection_file)
return json_file.split('.json')[0] | [
"Get kernel id"
] |
Please provide a description of the function:def stderr_file(self):
stderr_file = None
if self.connection_file is not None:
stderr_file = self.kernel_id + '.stderr'
if self.stderr_dir is not None:
stderr_file = osp.join(self.stderr_dir, stderr_file)... | [
"Filename to save kernel stderr output."
] |
Please provide a description of the function:def stderr_handle(self):
if self.stderr_file is not None:
# Needed to prevent any error that could appear.
# See issue 6267
try:
handle = codecs.open(self.stderr_file, 'w', encoding='utf-8')
... | [
"Get handle to stderr_file."
] |
Please provide a description of the function:def remove_stderr_file(self):
try:
# Defer closing the stderr_handle until the client
# is closed because jupyter_client needs it open
# while it tries to restart the kernel
self.stderr_handle.close()
... | [
"Remove stderr_file associated with the client."
] |
Please provide a description of the function:def configure_shellwidget(self, give_focus=True):
if give_focus:
self.get_control().setFocus()
# Set exit callback
self.shellwidget.set_exit_callback()
# To save history
self.shellwidget.executing.connec... | [
"Configure shellwidget after kernel is started"
] |
Please provide a description of the function:def stop_button_click_handler(self):
self.stop_button.setDisabled(True)
# Interrupt computations or stop debugging
if not self.shellwidget._reading:
self.interrupt_kernel()
else:
self.shellwidget.write_t... | [
"Method to handle what to do when the stop button is pressed"
] |
Please provide a description of the function:def show_kernel_error(self, error):
# Replace end of line chars with <br>
eol = sourcecode.get_eol_chars(error)
if eol:
error = error.replace(eol, '<br>')
# Don't break lines in hyphens
# From https://stac... | [
"Show kernel initialization errors in infowidget."
] |
Please provide a description of the function:def get_name(self):
if self.given_name is None:
# Name according to host
if self.hostname is None:
name = _("Console")
else:
name = self.hostname
# Adding id to name
... | [
"Return client name"
] |
Please provide a description of the function:def get_control(self):
# page_control is the widget used for paging
page_control = self.shellwidget._page_control
if page_control and page_control.isVisible():
return page_control
else:
return self.shell... | [
"Return the text widget (or similar) to give focus to"
] |
Please provide a description of the function:def get_options_menu(self):
env_action = create_action(
self,
_("Show environment variables"),
icon=ima.icon('environ'),
triggered=self.shellwidget.get_env
... | [
"Return options menu"
] |
Please provide a description of the function:def get_toolbar_buttons(self):
buttons = []
# Code to add the stop button
if self.stop_button is None:
self.stop_button = create_toolbutton(
self,
text... | [
"Return toolbar buttons list."
] |
Please provide a description of the function:def add_actions_to_context_menu(self, menu):
inspect_action = create_action(self, _("Inspect current object"),
QKeySequence(get_shortcut('console',
'inspect current o... | [
"Add actions to IPython widget context menu"
] |
Please provide a description of the function:def set_font(self, font):
self.shellwidget._control.setFont(font)
self.shellwidget.font = font | [
"Set IPython widget's font"
] |
Please provide a description of the function:def set_color_scheme(self, color_scheme, reset=True):
# Needed to handle not initialized kernel_client
# See issue 6996
try:
self.shellwidget.set_color_scheme(color_scheme, reset)
except AttributeError:
... | [
"Set IPython color scheme."
] |
Please provide a description of the function:def shutdown(self):
if self.get_kernel() is not None and not self.slave:
self.shellwidget.kernel_manager.shutdown_kernel()
if self.shellwidget.kernel_client is not None:
background(self.shellwidget.kernel_client.stop_chan... | [
"Shutdown kernel"
] |
Please provide a description of the function:def restart_kernel(self):
sw = self.shellwidget
if not running_under_pytest() and self.ask_before_restart:
message = _('Are you sure you want to restart the kernel?')
buttons = QMessageBox.Yes | QMessageBox.No
... | [
"\r\n Restart the associated kernel.\r\n\r\n Took this code from the qtconsole project\r\n Licensed under the BSD license\r\n "
] |
Please provide a description of the function:def kernel_restarted_message(self, msg):
if not self.is_error_shown:
# If there are kernel creation errors, jupyter_client will
# try to restart the kernel and qtconsole prints a
# message about it.
# So ... | [
"Show kernel restarted/died messages."
] |
Please provide a description of the function:def reset_namespace(self):
self.shellwidget.reset_namespace(warning=self.reset_warning,
message=True) | [
"Resets the namespace by removing all names defined by the user"
] |
Please provide a description of the function:def show_syspath(self, syspath):
if syspath is not None:
editor = CollectionsEditor(self)
editor.setup(syspath, title="sys.path contents", readonly=True,
width=600, icon=ima.icon('syspath'))
... | [
"Show sys.path contents."
] |
Please provide a description of the function:def show_env(self, env):
self.dialog_manager.show(RemoteEnvDialog(env, parent=self)) | [
"Show environment variables."
] |
Please provide a description of the function:def show_time(self, end=False):
if self.time_label is None:
return
elapsed_time = time.monotonic() - self.t0
# System time changed to past date, so reset start.
if elapsed_time < 0:
self.t0 = time.mono... | [
"Text to show in time_label."
] |
Please provide a description of the function:def set_elapsed_time_visible(self, state):
self.show_elapsed_time = state
if self.time_label is not None:
self.time_label.setVisible(state) | [
"Slot to show/hide elapsed time label."
] |
Please provide a description of the function:def set_info_page(self):
if self.info_page is not None:
self.infowidget.setHtml(
self.info_page,
QUrl.fromLocalFile(self.css_path)
) | [
"Set current info_page."
] |
Please provide a description of the function:def _create_loading_page(self):
loading_template = Template(LOADING)
loading_img = get_image_path('loading_sprites.png')
if os.name == 'nt':
loading_img = loading_img.replace('\\', '/')
message = _("Connecting to ker... | [
"Create html page to show while the kernel is starting"
] |
Please provide a description of the function:def _create_blank_page(self):
loading_template = Template(BLANK)
page = loading_template.substitute(css_path=self.css_path)
return page | [
"Create html page to show while the kernel is starting"
] |
Please provide a description of the function:def _show_loading_page(self):
self.shellwidget.hide()
self.infowidget.show()
self.info_page = self.loading_page
self.set_info_page() | [
"Show animation while the kernel is loading."
] |
Please provide a description of the function:def _hide_loading_page(self):
self.infowidget.hide()
self.shellwidget.show()
self.info_page = self.blank_page
self.set_info_page()
self.shellwidget.sig_prompt_ready.disconnect(self._hide_loading_page) | [
"Hide animation shown while the kernel is loading."
] |
Please provide a description of the function:def _read_stderr(self):
# We need to read stderr_file as bytes to be able to
# detect its encoding with chardet
f = open(self.stderr_file, 'rb')
try:
stderr_text = f.read()
# This is needed to avoid ... | [
"Read the stderr file of the kernel."
] |
Please provide a description of the function:def _show_mpl_backend_errors(self):
if not self.external_kernel:
self.shellwidget.silent_execute(
"get_ipython().kernel._show_mpl_backend_errors()")
self.shellwidget.sig_prompt_ready.disconnect(
self.... | [
"\r\n Show possible errors when setting the selected Matplotlib backend.\r\n "
] |
Please provide a description of the function:def _calculate_position(self, at_line=None, at_position=None,
at_point=None):
# Check that no option or only one option is given:
if [at_line, at_position, at_point].count(None) < 2:
raise Exception('Provi... | [
"\r\n Calculate a global point position `QPoint(x, y)`, for a given\r\n line, local cursor position, or local point.\r\n "
] |
Please provide a description of the function:def _update_stylesheet(self, widget):
if is_dark_interface():
css = qdarkstyle.load_stylesheet_from_environment()
widget.setStyleSheet(css)
palette = widget.palette()
background = palette.color(palette.Wi... | [
"Update the background stylesheet to make it lighter."
] |
Please provide a description of the function:def _format_text(self, title, text, color, ellide=False):
template = '''
<div style=\'font-family: "{font_family}";
font-size: {title_size}pt;
color: {color}\'>
<b>{title}</b>
... | [
"\r\n Create HTML template for calltips and tooltips.\r\n\r\n This will display title and text as separate sections and add `...`\r\n if `ellide` is True and the text is too long.\r\n "
] |
Please provide a description of the function:def _format_signature(self, signature, doc='', parameter='',
parameter_doc='', color=_DEFAULT_TITLE_COLOR,
is_python=False):
active_parameter_template = (
'<span style=\'font-family:"{font_... | [
"\r\n Create HTML template for signature.\r\n\r\n This template will include indent after the method name, a highlight\r\n color for the active parameter and highlights for special chars.\r\n ",
"\r\n Handle substitution of active parameter template.\r\n\r\n This ... |
Please provide a description of the function:def show_calltip(self, signature, doc='', parameter='', parameter_doc='',
color=_DEFAULT_TITLE_COLOR, is_python=False):
# Find position of calltip
point = self._calculate_position()
# Format text
tiptext, ... | [
"\r\n Show calltip.\r\n\r\n Calltips look like tooltips but will not disappear if mouse hovers\r\n them. They are useful for displaying signature information on methods\r\n and functions.\r\n "
] |
Please provide a description of the function:def show_tooltip(self, title, text, color=_DEFAULT_TITLE_COLOR,
at_line=None, at_position=None, at_point=None):
if text is not None and len(text) != 0:
# Find position of calltip
point = self._calculate_posit... | [
"\r\n Show tooltip.\r\n\r\n Tooltips will disappear if mouse hovers them. They are meant for quick\r\n inspections.\r\n "
] |
Please provide a description of the function:def set_eol_chars(self, text):
if not is_text_string(text): # testing for QString (PyQt API#1)
text = to_text_string(text)
eol_chars = sourcecode.get_eol_chars(text)
is_document_modified = eol_chars is not None and self.eol_c... | [
"Set widget end-of-line (EOL) characters from text (analyzes text)"
] |
Please provide a description of the function:def get_text_with_eol(self):
utext = to_text_string(self.toPlainText())
lines = utext.splitlines()
linesep = self.get_line_separator()
txt = linesep.join(lines)
if utext.endswith('\n'):
txt += linesep
... | [
"Same as 'toPlainText', replace '\\n'\r\n by correct end-of-line characters"
] |
Please provide a description of the function:def get_position(self, subject):
cursor = self.textCursor()
if subject == 'cursor':
pass
elif subject == 'sol':
cursor.movePosition(QTextCursor.StartOfBlock)
elif subject == 'eol':
cursor.mo... | [
"Get offset in character for the given subject from the start of\r\n text edit area"
] |
Please provide a description of the function:def set_cursor_position(self, position):
position = self.get_position(position)
cursor = self.textCursor()
cursor.setPosition(position)
self.setTextCursor(cursor)
self.ensureCursorVisible() | [
"Set cursor position"
] |
Please provide a description of the function:def move_cursor(self, chars=0):
direction = QTextCursor.Right if chars > 0 else QTextCursor.Left
for _i in range(abs(chars)):
self.moveCursor(direction, QTextCursor.MoveAnchor) | [
"Move cursor to left or right (unit: characters)"
] |
Please provide a description of the function:def is_cursor_on_first_line(self):
cursor = self.textCursor()
cursor.movePosition(QTextCursor.StartOfBlock)
return cursor.atStart() | [
"Return True if cursor is on the first line"
] |
Please provide a description of the function:def is_cursor_on_last_line(self):
cursor = self.textCursor()
cursor.movePosition(QTextCursor.EndOfBlock)
return cursor.atEnd() | [
"Return True if cursor is on the last line"
] |
Please provide a description of the function:def is_cursor_before(self, position, char_offset=0):
position = self.get_position(position) + char_offset
cursor = self.textCursor()
cursor.movePosition(QTextCursor.End)
if position < cursor.position():
cursor.setPos... | [
"Return True if cursor is before *position*"
] |
Please provide a description of the function:def move_cursor_to_next(self, what='word', direction='left'):
self.__move_cursor_anchor(what, direction, QTextCursor.MoveAnchor) | [
"\r\n Move cursor to next *what* ('word' or 'character')\r\n toward *direction* ('left' or 'right')\r\n "
] |
Please provide a description of the function:def clear_selection(self):
cursor = self.textCursor()
cursor.clearSelection()
self.setTextCursor(cursor) | [
"Clear current selection"
] |
Please provide a description of the function:def extend_selection_to_next(self, what='word', direction='left'):
self.__move_cursor_anchor(what, direction, QTextCursor.KeepAnchor) | [
"\r\n Extend selection to next *what* ('word' or 'character')\r\n toward *direction* ('left' or 'right')\r\n "
] |
Please provide a description of the function:def get_text_line(self, line_nb):
# Taking into account the case when a file ends in an empty line,
# since splitlines doesn't return that line as the last element
# TODO: Make this function more efficient
try:
retur... | [
"Return text line at line number *line_nb*"
] |
Please provide a description of the function:def get_text(self, position_from, position_to):
cursor = self.__select_text(position_from, position_to)
text = to_text_string(cursor.selectedText())
all_text = position_from == 'sof' and position_to == 'eof'
if text and not all_t... | [
"\r\n Return text between *position_from* and *position_to*\r\n Positions may be positions or 'sol', 'eol', 'sof', 'eof' or 'cursor'\r\n "
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.