[Zope3-checkins] SVN: Zope3/trunk/doc/DEBUG.txt Finished updating
debugger instructions.
Jim Fulton
jim at zope.com
Fri May 21 06:02:59 EDT 2004
Log message for revision 24845:
Finished updating debugger instructions.
-=-
Modified: Zope3/trunk/doc/DEBUG.txt
===================================================================
--- Zope3/trunk/doc/DEBUG.txt 2004-05-20 21:16:45 UTC (rev 24844)
+++ Zope3/trunk/doc/DEBUG.txt 2004-05-21 10:02:59 UTC (rev 24845)
@@ -18,9 +18,19 @@
zope application::
$ python2.3
- >>> from zope.app import Debugger
- >>> debugger = Debugger('path/to/zodb/', 'path/to/site.zcml')
-
+ >>> from zope.app.debug import Debugger
+ >>> debugger = Debugger()
+
+
+ Note that you can pass a database file name and a site ZCML file
+ to the debugger:
+
+ >>> Debugger('path/to/zodb/', 'path/to/site.zcml')
+
+ But you can generally let the debugger figure out where they are.
+
+ XXX In the future, the debugger should have it's own ZConfig file.
+
Using the Debugger
There are several methods you can call on the application object
@@ -31,7 +41,7 @@
The 'publish' method executes a request as the publisher would
and prints the response headers and body::
- >>> app.publish(path='/folder/content_object')
+ >>> debugger.publish(path='/folder/content_object')
Run
@@ -39,7 +49,7 @@
error handling disabled and without outputting anything. This is
useful for use with Python's post-mortem.
- >>> app.run(path='/folder/content_object')
+ >>> debugger.run(path='/folder/content_object')
# an exception is raised
>>> import pdb; pdb.pm()
# enters the python post-mortem debugger
@@ -50,13 +60,13 @@
debugger, with an extra convenience break point, setup just before
the published object call::
- >>> app.debug(path='/folder/content_object')
+ >>> debugger.debug(path='/folder/content_object')
* Type c<cr> to jump to published object call.
pdb>
Arguments
- All of the application object's debug methods take optional
+ All of the debugger object's debug methods take optional
arguments, the more common/useful ones...
- path - the url path to debug
@@ -70,7 +80,7 @@
to access your objects. If the application object is called, it
opens a database connection and fetches the root object::
- root = app()
+ root = debugger.root()
For example, to list the objects in the root folder:
More information about the Zope3-Checkins
mailing list