Notebook Shell based on StyledTextCtrl.
Create Shell instance. |
|
Display information about Py. |
|
Add command to the command history. |
|
Get response from the user using a dialog box. |
|
Display argument spec and docstring in a popup window. |
|
Display auto-completion popup list. |
|
Turn a text block into multiple multi-line commands. |
|
Return |
|
Return true if editing should succeed. |
|
Return true if a paste should succeed. |
|
Delete all text from the slices shell. |
|
Delete the current, unexecuted command. |
|
Copy selection and place it on the clipboard. |
|
Copy selection, including prompts, and place it on the clipboard. |
|
Copy selection, including prompts prefixed with four |
|
Remove selection and place it on the clipboard. |
|
Delete all outputs after an input |
|
EmptyUndoBuffer() |
|
Execute the user’s PYTHONSTARTUP script if they have one. |
|
Replace selection with text and run commands. |
|
Return text with line endings replaced by OS-specific endings. |
|
Extract a command from text which may include a shell prompt. |
|
Create and return a context menu for the slices shell. |
|
Get the start/stop lines for the slice based on any line in the slice |
|
Get the start/stop lines for the slice based on any line in the slice |
|
Extract a multi-line command from the editor. |
|
Return |
|
Insert a new line break. |
|
This testing function ensures that two adjacent markers are valid |
|
Return text without a leading prompt. |
|
MarkerSet is the Set command for MarkerGet |
|
AutoComplete and Calltips manually. |
|
Keypress event handler. |
|
Insert the previous/next command from the history buffer. |
|
Replace with the previous/next command from the history buffer. |
|
Search up the history buffer for the text in front of the cursor. |
|
Free the CPU to do other things. |
|
Key down event handler. |
|
Show possible autocompletion Words from already typed words. |
|
Check for matching braces. |
|
Replace selection with clipboard contents. |
|
Replace selection with clipboard contents, run commands. |
|
Halt execution pending a response from the user. |
|
Process the line of text at which the user hit Enter or Shift+RETURN. |
|
Display proper prompt for the context: ps1, ps2 or ps3. |
|
Send command to the interpreter for execution. |
|
Quit the application. |
|
Return string based on user input. |
|
Replacement for stdin.readline(). |
|
Replacement for stdin.readlines(). |
|
If redirect is true then sys.stderr will go to the shell. |
|
If redirect is true then sys.stdin will come from the shell. |
|
If redirect is true then sys.stdout will go to the shell. |
|
Redo() |
|
Replace selection with command from the history buffer. |
|
ReplaceSelection(text) |
|
Execute command as if it was typed in directly. |
|
Execute all commands in file as if they were typed into the shell. |
|
Create pseudo keywords as part of builtins. |
|
Set focus to the slices shell. |
|
Add ‘slicesshell’ to locals as reference to ShellFacade instance. |
|
Display status information. |
|
Display introductory text in the slices shell. |
|
Deletion of any selected and possibly discontinuous slices. |
|
Undo() |
|
Sets whether text is word wrapped. |
|
Display text in the slices shell. |
|
Replacement for stderr. |
|
Replacement for stdout. |
|
Set the zoom level. |
SlicesShell
(editwindow.EditWindow)¶Notebook Shell based on StyledTextCtrl.
__init__
(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN, introText='', locals=None, InterpClass=None, startupScript=None, execStartupScript=True, showPySlicesTutorial=True, enableShellMode=False, useStockId=True, hideFoldingMargin=False, *args, **kwds)¶Create Shell instance.
about
(self)¶Display information about Py.
addHistory
(self, command)¶Add command to the command history.
ask
(self, prompt='Please enter your response:')¶Get response from the user using a dialog box.
autoCallTipShow
(self, command, insertcalltip = True, forceCallTip = False)¶Display argument spec and docstring in a popup window.
AutoCompActiveCallback
(self)¶autoCompleteShow
(self, command, offset = 0)¶Display auto-completion popup list.
BackspaceWMarkers
(self, force=False)¶BreakTextIntoCommands
(self, text)¶Turn a text block into multiple multi-line commands.
CanCut
(self)¶Return True
if text is selected and can be cut.
CanEdit
(self)¶Return true if editing should succeed.
CanPaste
(self)¶Return true if a paste should succeed.
CleanAllMarkers
(self)¶clear
(self)¶Delete all text from the slices shell.
clearCommand
(self)¶Delete the current, unexecuted command.
clearGroupingMarkers
(self, line_num=None)¶clearHistory
(self)¶clearIOMarkers
(self, line_num=None)¶Copy
(self)¶Copy selection and place it on the clipboard.
CopyWithPrompts
(self)¶Copy selection, including prompts, and place it on the clipboard.
CopyWithPromptsPrefixed
(self)¶Copy selection, including prompts prefixed with four spaces, and place it on the clipboard.
Cut
(self)¶Remove selection and place it on the clipboard.
DeleteOutputSlicesAfter
(self, line_num=None)¶Delete all outputs after an input
destroy
(self)¶DoMarginClick
(self, lineClicked, margin, shiftDown, controlDown)¶EmptyUndoBuffer
(self)¶EmptyUndoBuffer()
Delete the undo history.
ensureSingleGroupingMarker
(self, line_num=None)¶ensureSingleIOMarker
(self, line_num=None)¶execStartupScript
(self, startupScript)¶Execute the user’s PYTHONSTARTUP script if they have one.
Execute
(self, text)¶Replace selection with text and run commands.
fixLineEndings
(self, text)¶Return text with line endings replaced by OS-specific endings.
FoldGroupingSlice
(self, line_num=None)¶FoldIOSlice
(self, line_num=None)¶ForwardDeleteWMarkers
(self)¶getCommand
(self, text=None, rstrip=True)¶Extract a command from text which may include a shell prompt.
The command may not necessarily be valid Python syntax.
GetContextMenu
(self)¶Create and return a context menu for the slices shell. This is used instead of the scintilla default menu in order to correctly respect our immutable buffer.
GetGroupingSlice
(self, line_num=None)¶Get the start/stop lines for the slice based on any line in the slice
GetIOSelection
(self)¶GetIOSlice
(self, line_num=None)¶Get the start/stop lines for the slice based on any line in the slice
getMultilineCommand
(self, rstrip=True)¶Extract a multi-line command from the editor.
The command may not necessarily be valid Python syntax.
hasChanged
(self)¶Return True
if contents have changed.
insertLineBreak
(self)¶Insert a new line break.
IsAllowedPair
(self, m1, m2)¶This testing function ensures that two adjacent markers are valid
LoadPyFileAsSlice
(self, fid)¶LoadPySlicesFile
(self, fid)¶LoadSettings
(self, config)¶lstripPrompt
(self, text)¶Return text without a leading prompt.
MarginSelectAll
(self)¶MarginUnselectAll
(self)¶MarkerSet
(self, line, markerBitsSet)¶MarkerSet is the Set command for MarkerGet
MergeAdjacentSlices
(self)¶OnCallTipAutoCompleteManually
(self, shiftDown)¶AutoComplete and Calltips manually.
OnChar
(self, event)¶Keypress event handler.
Only receives an event if OnKeyDown calls event.Skip() for the corresponding event.
OnContextMenu
(self, evt)¶OnHistoryInsert
(self, step)¶Insert the previous/next command from the history buffer.
OnHistoryReplace
(self, step)¶Replace with the previous/next command from the history buffer.
OnHistorySearch
(self)¶Search up the history buffer for the text in front of the cursor.
OnIdle
(self, event)¶Free the CPU to do other things.
OnKeyDown
(self, event)¶Key down event handler.
OnMarginClick
(self, evt)¶OnShowCompHistory
(self)¶Show possible autocompletion Words from already typed words.
OnUpdateUI
(self, evt)¶Check for matching braces.
Paste
(self)¶Replace selection with clipboard contents.
PasteAndRun
(self)¶Replace selection with clipboard contents, run commands.
pause
(self)¶Halt execution pending a response from the user.
processLine
(self)¶Process the line of text at which the user hit Enter or Shift+RETURN.
prompt
(self)¶Display proper prompt for the context: ps1, ps2 or ps3.
If this is a continuation line, autoindent as necessary.
push
(self, command, silent = False, useMultiCommand=False)¶Send command to the interpreter for execution.
quit
(self)¶Quit the application.
raw_input
(self, prompt='')¶Return string based on user input.
readline
(self)¶Replacement for stdin.readline().
readlines
(self)¶Replacement for stdin.readlines().
redirectStderr
(self, redirect=True)¶If redirect is true then sys.stderr will go to the shell.
redirectStdin
(self, redirect=True)¶If redirect is true then sys.stdin will come from the shell.
redirectStdout
(self, redirect=True)¶If redirect is true then sys.stdout will go to the shell.
Redo
(self)¶Redo()
Redoes the next action on the undo history.
replaceFromHistory
(self, step)¶Replace selection with command from the history buffer.
ReplaceSelection
(self, text, sliceDeletion=False, *args, **kwds)¶ReplaceSelection(text)
Replace the selected text with the argument text.
RestoreFirstMarker
(self)¶run
(self, command, prompt=True, verbose=True)¶Execute command as if it was typed in directly. >>> shell.run(‘print(“this”)’) >>> print(“this”) this >>>
runfile
(self, filename)¶Execute all commands in file as if they were typed into the shell.
SavePySlicesFile
(self, fid)¶SaveSettings
(self, config)¶setBuiltinKeywords
(self)¶Create pseudo keywords as part of builtins.
This sets “close”, “exit” and “quit” to a helpful string.
setFocus
(self)¶Set focus to the slices shell.
setLocalShell
(self)¶Add ‘slicesshell’ to locals as reference to ShellFacade instance.
setStatusText
(self, text)¶Display status information.
showIntro
(self, text='')¶Display introductory text in the slices shell.
SliceSelectionDelete
(self)¶Deletion of any selected and possibly discontinuous slices.
SplitSlice
(self, line_num=None)¶ToggleFoldingMargin
(self, hideFoldingMargin=None)¶ToggleShellMode
(self, enableShellMode=None)¶Undo
(self)¶Undo()
Undo one action in the undo history.
UnFoldGroupingSlice
(self, line_num=None)¶UnFoldIOSlice
(self, line_num=None)¶UpdateUndoHistoryAfter
(self)¶UpdateUndoHistoryBefore
(self, actionType, s, posStart, posEnd, forceNewAction=False)¶wrap
(self, wrap=True)¶Sets whether text is word wrapped.
write
(self, text, type='Input', silent=False)¶Display text in the slices shell.
Replace line endings with OS-specific endings.
writeErr
(self, text)¶Replacement for stderr.
writeOut
(self, text)¶Replacement for stdout.
zoom
(self, points=0)¶Set the zoom level.
This number of points is added to the size of all fonts. It may be positive to magnify or negative to reduce.