projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
some people disliked the asterisks in wxDebugReport dialog, removed (patch 1491869)
[wxWidgets.git]
/
wxPython
/
wx
/
py
/
shell.py
diff --git
a/wxPython/wx/py/shell.py
b/wxPython/wx/py/shell.py
index e45ff175ee2d844ee129894310b24f7de00eb41c..fe60b38221bd8c3dc6a8a3ff8b160390d1c713d9 100644
(file)
--- a/
wxPython/wx/py/shell.py
+++ b/
wxPython/wx/py/shell.py
@@
-147,10
+147,9
@@
Ctrl+[ Decrease font size.
Ctrl+= Default font size.
Ctrl-Space Show Auto Completion.
Ctrl-Alt-Space Show Call Tip.
Ctrl+= Default font size.
Ctrl-Space Show Auto Completion.
Ctrl-Alt-Space Show Call Tip.
-Alt+Shift+C Clear Screen.
Shift+Enter Complete Text from History.
Shift+Enter Complete Text from History.
-Ctrl+F Search
(backwards) TODO: regexp-wholeWords-...
-
Ctrl+G
Search next
+Ctrl+F Search
+
F3
Search next
Ctrl+H "hide" lines containing selection / "unhide"
F12 on/off "free-edit" mode
"""
Ctrl+H "hide" lines containing selection / "unhide"
F12 on/off "free-edit" mode
"""
@@
-169,6
+168,7
@@
class ShellFacade:
d = self.__dict__
d['other'] = other
d['helpText'] = HELP_TEXT
d = self.__dict__
d['other'] = other
d['helpText'] = HELP_TEXT
+ d['this'] = other.this
def help(self):
"""Display some useful information about how to use the shell."""
def help(self):
"""Display some useful information about how to use the shell."""
@@
-321,6
+321,11
@@
class Shell(editwindow.EditWindow):
wx.CallAfter(self.ScrollToLine, 0)
wx.CallAfter(self.ScrollToLine, 0)
+ def clearHistory(self):
+ self.history = []
+ self.historyIndex = -1
+ dispatcher.send(signal="Shell.clearHistory")
+
def destroy(self):
del self.interp
def destroy(self):
del self.interp
@@
-349,7
+354,7
@@
class Shell(editwindow.EditWindow):
def setBuiltinKeywords(self):
"""Create pseudo keywords as part of builtins.
def setBuiltinKeywords(self):
"""Create pseudo keywords as part of builtins.
- This sets
`close`, `exit` and `quit`
to a helpful string.
+ This sets
"close", "exit" and "quit"
to a helpful string.
"""
import __builtin__
__builtin__.close = __builtin__.exit = __builtin__.quit = \
"""
import __builtin__
__builtin__.close = __builtin__.exit = __builtin__.quit = \
@@
-412,11
+417,11
@@
Platform: %s""" % \
# commands/responses.
if not self.CanEdit():
return
# commands/responses.
if not self.CanEdit():
return
- key = event.KeyCode()
+ key = event.
Get
KeyCode()
currpos = self.GetCurrentPos()
stoppos = self.promptPosEnd
# Return (Enter) needs to be ignored in this handler.
currpos = self.GetCurrentPos()
stoppos = self.promptPosEnd
# Return (Enter) needs to be ignored in this handler.
- if key
== wx.WXK_RETURN
:
+ if key
in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]
:
pass
elif key in self.autoCompleteKeys:
# Usually the dot (period) key activates auto completion.
pass
elif key in self.autoCompleteKeys:
# Usually the dot (period) key activates auto completion.
@@
-447,7
+452,7
@@
Platform: %s""" % \
def OnKeyDown(self, event):
"""Key down event handler."""
def OnKeyDown(self, event):
"""Key down event handler."""
- key = event.KeyCode()
+ key = event.
Get
KeyCode()
# If the auto-complete window is up let it do its thing.
if self.AutoCompActive():
event.Skip()
# If the auto-complete window is up let it do its thing.
if self.AutoCompActive():
event.Skip()
@@
-512,17
+517,17
@@
Platform: %s""" % \
# Return (Enter) is used to submit a command to the
# interpreter.
# Return (Enter) is used to submit a command to the
# interpreter.
- if (not controlDown and not shiftDown and not altDown) and key
== wx.WXK_RETURN
:
+ if (not controlDown and not shiftDown and not altDown) and key
in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]
:
if self.CallTipActive():
self.CallTipCancel()
self.processLine()
# Complete Text (from already typed words)
if self.CallTipActive():
self.CallTipCancel()
self.processLine()
# Complete Text (from already typed words)
- elif shiftDown and key
== wx.WXK_RETURN
:
+ elif shiftDown and key
in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]
:
self.OnShowCompHistory()
# Ctrl+Return (Ctrl+Enter) is used to insert a line break.
self.OnShowCompHistory()
# Ctrl+Return (Ctrl+Enter) is used to insert a line break.
- elif controlDown and key
== wx.WXK_RETURN
:
+ elif controlDown and key
in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]
:
if self.CallTipActive():
self.CallTipCancel()
if currpos == endpos:
if self.CallTipActive():
self.CallTipCancel()
if currpos == endpos:
@@
-541,6
+546,10
@@
Platform: %s""" % \
else:
self.clearCommand()
else:
self.clearCommand()
+ # Clear the current command
+ elif key == wx.WXK_BACK and controlDown and shiftDown:
+ self.clearCommand()
+
# Increase font size.
elif controlDown and key in (ord(']'), wx.WXK_NUMPAD_ADD):
dispatcher.send(signal='FontIncrease')
# Increase font size.
elif controlDown and key in (ord(']'), wx.WXK_NUMPAD_ADD):
dispatcher.send(signal='FontIncrease')
@@
-914,6
+923,7
@@
Platform: %s""" % \
if command != '' \
and (len(self.history) == 0 or command != self.history[0]):
self.history.insert(0, command)
if command != '' \
and (len(self.history) == 0 or command != self.history[0]):
self.history.insert(0, command)
+ dispatcher.send(signal="Shell.addHistory", command=command)
def write(self, text):
"""Display text in the shell.
def write(self, text):
"""Display text in the shell.