X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e773f79b191e77649b07f527a08405863a1cb117..40e5ebbf98728d627e4d3c9e3a57f28f5bb8fcb9:/wxPython/wx/py/shell.py diff --git a/wxPython/wx/py/shell.py b/wxPython/wx/py/shell.py index dbd4c268dd..ec8d7f4dae 100644 --- a/wxPython/wx/py/shell.py +++ b/wxPython/wx/py/shell.py @@ -168,6 +168,7 @@ class ShellFacade: 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.""" @@ -342,18 +343,19 @@ class Shell(editwindow.EditWindow): def showIntro(self, text=''): """Display introductory text in the shell.""" if text: - if not text.endswith(os.linesep): - text += os.linesep self.write(text) try: - self.write(self.interp.introText) + if self.interp.introText: + if text and not text.endswith(os.linesep): + self.write(os.linesep) + self.write(self.interp.introText) except AttributeError: pass 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 = \ @@ -416,7 +418,7 @@ Platform: %s""" % \ # commands/responses. if not self.CanEdit(): return - key = event.KeyCode() + key = event.GetKeyCode() currpos = self.GetCurrentPos() stoppos = self.promptPosEnd # Return (Enter) needs to be ignored in this handler. @@ -451,7 +453,7 @@ Platform: %s""" % \ def OnKeyDown(self, event): """Key down event handler.""" - key = event.KeyCode() + key = event.GetKeyCode() # If the auto-complete window is up let it do its thing. if self.AutoCompActive(): event.Skip()