[Zope-dev] Re: [Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py External methods can now live outside of Products based python packages.

Rocky Burt rocky at serverzen.com
Thu May 4 07:14:39 EDT 2006


On Thu, 2006-04-05 at 08:23 -0230, Rocky Burt wrote:
> On Thu, 2006-04-05 at 10:43 +0200, Stefan H. Holek wrote:
> > Note that Zope2.app() opens a new ZODB connection which you need to  
> > close at some point. I suggest something along the lines of:
> > 
> > 	app = Zope2.app()
> >          try:
> > 		products = app.Control_Panel.Products
> > 		...
> > 	finally:
> > 		app._p_jar.close()
> > 
> > I am also wondering if this code would break if a product was removed  
> > from the file system, but still had its persistent part hanging  
> > around in Control_Panel.Products.
> 
> Hmm... good points, I'll look into this.

Actually, this brings up something I've been wondering about.  Everytime
I call Zope2.app() inside a test case it gives me a new obj with a reset
Control_Panel.  Am I doing something wrong here?  Perhaps there's a
better way to go about this?

- Rocky



-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server -- http://www.serverzen.net




More information about the Zope-Dev mailing list