]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/PyShellApp.py
2ef7aae07fefc4801a924b1fba96f84863965d8f
2 """PyShellApp is a python shell application."""
4 # The next two lines, and the other code below that makes use of
5 # ``__main__`` and ``original``, serve the purpose of cleaning up the
6 # main namespace to look as much as possible like the regular Python
9 original
= __main__
.__dict
__.keys()
11 __author__
= "Patrick K. O'Brien <pobrien@orbtech.com>"
13 __revision__
= "$Revision$"[11:-2]
15 from wxPython
import wx
25 """PyShell standalone application."""
28 from wxPython
import wx
29 wx
.wxInitAllImageHandlers()
30 locals = __main__
.__dict
__
31 from shell
import ShellFrame
32 self
.frame
= ShellFrame(locals=locals)
33 self
.frame
.SetSize((750, 525))
35 self
.SetTopWindow(self
.frame
)
36 self
.frame
.shell
.SetFocus()
37 # Add the application object to the sys module's namespace.
38 # This allows a shell user to do:
40 # >>> sys.app.whatever
46 The main() function needs to handle being imported, such as with the
47 pycrust script that wxPython installs:
51 from wxPython.lib.PyCrust.PyCrustApp import main
57 md
= __main__
.__dict
__
61 if key
not in keepers
:
64 if md
.has_key('App') and md
['App'] is App
:
66 if md
.has_key('__main__') and md
['__main__'] is __main__
:
70 if __name__
== '__main__':