wx.py.shell.Shell¶
Shell based on StyledTextCtrl.
Class Hierarchy¶
Known Superclasses¶
Methods Summary¶
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. |
|
Return true if text is selected and can be cut. |
|
Return true if editing should succeed. |
|
Return true if a paste should succeed. |
|
Delete all text from the 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. |
|
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 shell. |
|
Extract a multi-line command from the editor. |
|
Insert a new line break. |
|
Return text without a leading prompt. |
|
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. |
|
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. |
|
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. |
|
Replace selection with command from the history buffer. |
|
Execute command as if it was typed in directly. |
|
Execute all commands in file as if they were typed into the |
|
Create pseudo keywords as part of builtins. |
|
Set focus to the shell. |
|
Add ‘shell’ to locals as reference to ShellFacade instance. |
|
Display status information. |
|
Display introductory text in the shell. |
|
Sets whether text is word wrapped. |
|
Display text in the shell. |
|
Replacement for stderr. |
|
Replacement for stdout. |
|
Set the zoom level. |
Class API¶
- class Shell(editwindow.EditWindow)¶
Shell based on StyledTextCtrl.
Methods¶
- __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN, introText='', locals=None, InterpClass=None, startupScript=None, execStartupScript=True, useStockId=True, \*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.
- autoCompleteShow(self, command, offset=0)¶
Display auto-completion popup list.
- 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.
- clear(self)¶
Delete all text from the shell.
- clearCommand(self)¶
Delete the current, unexecuted command.
- clearHistory(self)¶
- 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.
- destroy(self)¶
- 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.
- 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 shell. This is used instead of the scintilla default menu in order to correctly respect our immutable buffer.
- getMultilineCommand(self, rstrip=True)¶
Extract a multi-line command from the editor.
The command may not necessarily be valid Python syntax.
- insertLineBreak(self)¶
Insert a new line break.
- LoadSettings(self, config)¶
- lstripPrompt(self, text)¶
Return text without a leading prompt.
- 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.
- OnShowCompHistory(self)¶
Show possible autocompletion Words from already typed words.
- 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.
- 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)¶
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.
- replaceFromHistory(self, step)¶
Replace selection with command from the history buffer.
- 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.
- 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 shell.
- setLocalShell(self)¶
Add ‘shell’ to locals as reference to ShellFacade instance.
- setStatusText(self, text)¶
Display status information.
- showIntro(self, text='')¶
Display introductory text in the shell.
- wrap(self, wrap=True)¶
Sets whether text is word wrapped.
- write(self, text)¶
Display text in the 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.