Notebook Shell based on StyledTextCtrl.
__init__ |
Create Shell instance. |
about |
Display information about Py. |
addHistory |
Add command to the command history. |
ask |
Get response from the user using a dialog box. |
autoCallTipShow |
Display argument spec and docstring in a popup window. |
AutoCompActiveCallback |
|
autoCompleteShow |
Display auto-completion popup list. |
BackspaceWMarkers |
|
BreakTextIntoCommands |
Turn a text block into multiple multi-line commands. |
CanCut |
|
CanEdit |
Return true if editing should succeed. |
CanPaste |
Return true if a paste should succeed. |
CleanAllMarkers |
|
clear |
Delete all text from the slices shell. |
clearCommand |
Delete the current, unexecuted command. |
clearGroupingMarkers |
|
clearHistory |
|
clearIOMarkers |
|
Copy |
Copy selection and place it on the clipboard. |
CopyWithPrompts |
Copy selection, including prompts, and place it on the clipboard. |
CopyWithPromptsPrefixed |
Copy selection, including prompts prefixed with four |
Cut |
Remove selection and place it on the clipboard. |
DeleteOutputSlicesAfter |
Delete all outputs after an input |
destroy |
|
DoMarginClick |
|
EmptyUndoBuffer |
|
ensureSingleGroupingMarker |
|
ensureSingleIOMarker |
|
execStartupScript |
Execute the user’s PYTHONSTARTUP script if they have one. |
Execute |
Replace selection with text and run commands. |
fixLineEndings |
Return text with line endings replaced by OS-specific endings. |
FoldGroupingSlice |
|
FoldIOSlice |
|
ForwardDeleteWMarkers |
|
getCommand |
Extract a command from text which may include a shell prompt. |
GetContextMenu |
Create and return a context menu for the slices shell. |
GetGroupingSlice |
Get the start/stop lines for the slice based on any line in the slice |
GetIOSelection |
|
GetIOSlice |
Get the start/stop lines for the slice based on any line in the slice |
getMultilineCommand |
Extract a multi-line command from the editor. |
hasChanged |
Return True if contents have changed. |
insertLineBreak |
Insert a new line break. |
IsAllowedPair |
This testing function ensures that two adjacent markers are valid |
LoadPyFileAsSlice |
|
LoadPySlicesFile |
|
LoadSettings |
|
lstripPrompt |
Return text without a leading prompt. |
MarginSelectAll |
|
MarginUnselectAll |
|
MarkerSet |
MarkerSet is the Set command for MarkerGet |
MergeAdjacentSlices |
|
OnCallTipAutoCompleteManually |
AutoComplete and Calltips manually. |
OnChar |
Keypress event handler. |
OnContextMenu |
|
OnHistoryInsert |
Insert the previous/next command from the history buffer. |
OnHistoryReplace |
Replace with the previous/next command from the history buffer. |
OnHistorySearch |
Search up the history buffer for the text in front of the cursor. |
OnIdle |
Free the CPU to do other things. |
OnKeyDown |
Key down event handler. |
OnMarginClick |
|
OnShowCompHistory |
Show possible autocompletion Words from already typed words. |
OnUpdateUI |
|
Paste |
Replace selection with clipboard contents. |
PasteAndRun |
Replace selection with clipboard contents, run commands. |
pause |
Halt execution pending a response from the user. |
processLine |
Process the line of text at which the user hit Enter or Shift+RETURN. |
prompt |
Display proper prompt for the context: ps1, ps2 or ps3. |
push |
Send command to the interpreter for execution. |
quit |
Quit the application. |
raw_input |
Return string based on user input. |
readline |
Replacement for stdin.readline(). |
readlines |
Replacement for stdin.readlines(). |
redirectStderr |
If redirect is true then sys.stderr will go to the shell. |
redirectStdin |
If redirect is true then sys.stdin will come from the shell. |
redirectStdout |
If redirect is true then sys.stdout will go to the shell. |
Redo |
|
replaceFromHistory |
Replace selection with command from the history buffer. |
ReplaceSelection |
|
RestoreFirstMarker |
|
run |
Execute command as if it was typed in directly. |
runfile |
Execute all commands in file as if they were typed into the shell. |
SavePySlicesFile |
|
SaveSettings |
|
setBuiltinKeywords |
Create pseudo keywords as part of builtins. |
setFocus |
Set focus to the slices shell. |
setLocalShell |
Add ‘slicesshell’ to locals as reference to ShellFacade instance. |
setStatusText |
Display status information. |
showIntro |
Display introductory text in the slices shell. |
SliceSelectionDelete |
Deletion of any selected and possibly discontinuous slices. |
SplitSlice |
|
ToggleFoldingMargin |
|
ToggleShellMode |
|
Undo |
|
UnFoldGroupingSlice |
|
UnFoldIOSlice |
|
UpdateUndoHistoryAfter |
|
UpdateUndoHistoryBefore |
|
wrap |
Sets whether text is word wrapped. |
write |
Display text in the slices shell. |
writeErr |
Replacement for stderr. |
writeOut |
Replacement for stdout. |
zoom |
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, 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)¶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)¶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)¶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)¶replaceFromHistory
(self, step)¶Replace selection with command from the history buffer.
ReplaceSelection
(self, text, sliceDeletion=False, *args, **kwds)¶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)¶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.