]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/PyCrust.py
d2281ce306115af88470c670f7c02523c75b2fd3
[wxWidgets.git] / wxPython / wxPython / lib / PyCrust / PyCrust.py
1 #!/usr/bin/env python
2 """PyCrust is a python shell and namespace browser application."""
3
4 __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
5 __cvsid__ = "$Id$"
6 __date__ = "July 1, 2001"
7 __version__ = "$Revision$"[11:-2]
8
9 from wxPython.wx import *
10 from crust import CrustFrame
11
12
13 class App(wxApp):
14 """PyCrust standalone application."""
15
16 def OnInit(self):
17 locals = {'__app__': 'PyCrust Standalone Application'}
18 self.crustFrame = CrustFrame(locals=locals)
19 self.crustFrame.Show(true)
20 # Set focus to the shell editor.
21 self.crustFrame.crust.shell.SetFocus()
22 self.SetTopWindow(self.crustFrame)
23 # Add the application object to the sys module's namespace.
24 # This allows a shell user to do:
25 # >>> import sys
26 # >>> sys.application.whatever
27 import sys
28 sys.application = self
29 return true
30
31
32 def main():
33 application = App(0)
34 application.MainLoop()
35
36 if __name__ == '__main__':
37 main()
38