]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/PyCrustApp.py
036e368002eacbc27cfbb7a05b188f84e2a0e271
2 """PyCrustApp is a python shell and namespace browser 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 """PyCrust standalone application."""
28 from wxPython
import wx
29 wx
.wxInitAllImageHandlers()
30 locals = __main__
.__dict
__
31 from crust
import CrustFrame
32 self
.frame
= CrustFrame(locals=locals)
33 self
.frame
.SetSize((800, 600))
35 self
.SetTopWindow(self
.frame
)
36 # Add the application object to the sys module's namespace.
37 # This allows a shell user to do:
39 # >>> sys.app.whatever
45 The main() function needs to handle being imported, such as with the
46 pycrust script that wxPython installs:
50 from wxPython.lib.PyCrust.PyCrustApp import main
56 md
= __main__
.__dict
__
60 if key
not in keepers
:
63 if md
.has_key('App') and md
['App'] is App
:
65 if md
.has_key('__main__') and md
['__main__'] is __main__
:
69 if __name__
== '__main__':