[Zope] Problems programatically creating an instance of LocalFS

Paul Winkler pw_lists@slinkp.com
Sat, 28 Jun 2003 13:02:55 -0400


> > On Fri, Jun 27, 2003 at 10:30:51PM -0700, Dennis Allison wrote:
> > > 
> > > I am pretty sure the reason I cannot create a LocalFS instance 
> > > is something stupid, but I can't seem to track it down.  Any help
> > > would be appreciated.
> > > 
> > > I am using Version 1.0 of LocalFS which I believe is the latest,
> > > Script(Python), and Zope 2.6.1.
> > > 
> > > # code fragment to create the LocalFS instance
> > > p = container.manage_addProduct['LocalFS']
> > > p = p.manage_addLocalFS
> > > p( id, title=title, basepath=basepath)
> > 
> > I guess that's because REQUEST is None, try to add it to the p(id ...) 
> > line.

IMHO this is a bug in LocalFS. manage_addFoo should not require
a non-None request.  

a fix is to change the last line of manage_addLocalFS to this
common idiom:

    if REQUEST is not None:
            return self.manage_main(self, REQUEST)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's MC HALF GRAMMAR!
(random hero from isometric.spaceninja.com)