diff --git a/pyface/i_python_shell.py b/pyface/i_python_shell.py index ed16df54d..58e4cfe75 100644 --- a/pyface/i_python_shell.py +++ b/pyface/i_python_shell.py @@ -14,7 +14,7 @@ """ The interface for an interactive Python shell. """ # Enthought library imports. -from traits.api import Event +from traits.api import Event, String # Local imports. from pyface.key_pressed_event import KeyPressedEvent @@ -32,6 +32,8 @@ class IPythonShell(IWidget): #: A key has been pressed. key_pressed = Event(KeyPressedEvent) + welcome_message = String + ########################################################################### # 'IPythonShell' interface. ########################################################################### diff --git a/pyface/ui/qt4/python_shell.py b/pyface/ui/qt4/python_shell.py index 65cb0f04d..149af1dbc 100644 --- a/pyface/ui/qt4/python_shell.py +++ b/pyface/ui/qt4/python_shell.py @@ -22,7 +22,7 @@ from pygments.lexers import PythonLexer # Enthought library imports. -from traits.api import Event, provides +from traits.api import Event, provides, String from traits.util.clean_strings import python_name # Local imports. @@ -46,6 +46,8 @@ class PythonShell(MPythonShell, Widget): command_executed = Event + welcome_message = String + key_pressed = Event(KeyPressedEvent) #-------------------------------------------------------------------------- @@ -423,7 +425,7 @@ def _get_banner(self): """ banner = 'Python %s on %s\nType "help", "copyright", "credits" or ' \ '"license" for more information.' - return banner % (sys.version, sys.platform) + return banner % (sys.version, sys.platform) + self.welcome_message def _get_context(self, cursor=None): """ Gets the context for the specified cursor (or the current cursor diff --git a/pyface/ui/wx/python_shell.py b/pyface/ui/wx/python_shell.py index 423a8380e..9ee73db72 100644 --- a/pyface/ui/wx/python_shell.py +++ b/pyface/ui/wx/python_shell.py @@ -24,7 +24,7 @@ import wx # Enthought library imports. -from traits.api import Event, provides +from traits.api import Event, provides, String # Private Enthought library imports. from traits.util.clean_strings import python_name @@ -49,6 +49,8 @@ class PythonShell(MPythonShell, Widget): key_pressed = Event(KeyPressedEvent) + welcome_message = String + ########################################################################### # 'object' interface. ########################################################################### @@ -167,7 +169,7 @@ def set_history(self, history, history_index): ########################################################################### def _create_control(self, parent): - shell = PyShell(parent, -1) + shell = PyShell(parent, -1, introText=self.welcome_message) # Listen for key press events. wx.EVT_CHAR(shell, self._wx_on_char)