[Zope3-Users] IPluggableAuthentication -- 'new
style' authentication problem
Tom Dossis
td at yoma.com.au
Thu Oct 13 19:01:13 EDT 2005
Christian Lueck wrote:
> Note: Since I don't know how to get into a site's context with the
> debugger (zopectl debug) ...
Hi Christian, here's some code to get the root object of a zope3/zeo site...
>>> from ZODB import DB
>>> from ZEO.ClientStorage import ClientStorage
>>> from zope.app.debug import Debugger
>>>
>>> zeohost = 'localhost'
>>> zeoport = 8131
>>> sitezcml = 'etc/site.zcml'
>>>
>>> db = DB(ClientStorage((zeohost,zeoport)))
>>> root = Debugger(db, sitezcml).root()
>>>
>>> root
<zope.app.folder.folder.Folder object at 0x411f04ac>
>>>
>>> list(root)
[u'td']
>>>
>>> site = root['td']
If you make changes to objects via the python interactive session and
want to see them from your browser...
>>> import transaction
>>> transaction.commit()
For a non-zeo zope3 site, it's simply..
>>> db = 'var/Data.fs'
>>> sitezcml = 'etc/site.zcml'
>>> root = Debugger(db, sitezcml).root()
Note: The above references to the db and sitezcml are relative to your
instance. And of course don't forget to include zope and your stuff in
your PYTHONPATH
More information about the Zope3-users
mailing list