[PyCrust-cvs] PyCrust PyWrap.py,NONE,1.1 PyShell.py,1.5,1.6 PyFilling.py,1.6,1.7 PyCrust.py,1.16,1.1
Brought to you by:
pobrien
From: <po...@us...> - 2003-04-04 15:25:25
|
Update of /cvsroot/pycrust/PyCrust In directory sc8-pr-cvs1:/tmp/cvs-serv17086 Added Files: PyWrap.py PyShell.py PyFilling.py PyCrust.py MANUAL.txt Log Message: Renamed files. --- NEW FILE: PyWrap.py --- #!/usr/bin/env python """PyWrap is a command line utility that runs a wxPython program with additional runtime-tools, such as PyCrust.""" __author__ = "Patrick K. O'Brien <po...@or...>" __cvsid__ = "$Id: PyWrap.py,v 1.1 2003/04/04 15:25:05 pobrien Exp $" __revision__ = "$Revision: 1.1 $"[11:-2] import os import sys from wxPython import wx from crust import CrustFrame as Frame try: True except NameError: True = 1==1 False = 1==0 def wrap(app): wx.wxInitAllImageHandlers() frame = Frame() frame.SetSize((750, 525)) frame.Show(True) frame.shell.interp.locals['app'] = app app.MainLoop() def main(argv): if len(argv) < 2: print "Please specify a module name." raise SystemExit name = argv[1] if name[-3:] == '.py': name = name[:-3] module = __import__(name) # Find the App class. App = None d = module.__dict__ for item in d.keys(): try: if issubclass(d[item], wx.wxApp): App = d[item] except (NameError, TypeError): pass if App is None: print "No App class found." raise SystemExit app = App() wrap(app) if __name__ == '__main__': sys.path.insert(0, os.curdir) main(sys.argv) --- NEW FILE: MANUAL.txt --- =============== The Py Manual =============== ------------------------- Py - Served Fresh Daily ------------------------- :Author: Patrick K. O'Brien :Contact: po...@or... :Date: $Date: 2003/04/04 15:25:14 $ :Revision: $Revision: 1.1 $ .. contents:: Introduction ============ This document will show you how to make use of the Py programs and library of modules. What is Py? =========== Py is really several things. Py is a set of standalone programs as well as a library of modules that you can use in your own programs. First, Py contains standalone programs that provide code editors and graphical, Python shell interfaces. Second, Py contains a collections of modules that you can use in your own wxPython applications to provide similar services, either for your own use during development, or as an interface for users of your program. Third, Py containss a wrapper utility, providing you with runtime introspection capabilities for your wxPython programs without having to include PyCrust or PyShell in your program, or alter one line of your code. Py standalone programs ====================== There are several standalone applications in the Py package: * PyAlaCarte * PyAlaMode * PyCrust * PyFilling * PyShell * PyWrap Py modules ========== Py was designed to be modular. That means graphical code is kept separate from non-graphical code, and many of the Py modules can be used by other programs. Likewise, other programs can supply some of the modules needed by Py. For example, you could supply a customized interpreter module and plug it in to the PyCrust standalone application. As long as it supports the minimum functionality required, PyCrust will work just as well with your interpreter as with its default interpreter. Py runtime wrapper ================== The Py wrapper utility (``PyWrap.py``) lets you run an existing wxPython program with a PyCrust frame at the same time. Inside the PyCrust shell, the local variable ``app`` is assigned to your application instance. In this way you can introspect your entire application within the PyCrust shell and the PyCrust namespace viewer. And through the use of the PyCrust decorator classes, PyCrust can display wxPython function and method signatures as well as docstrings for the entire wxPython library. |