Problems programatically creating an instance of LocalFS
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) ------------------------------------------------- Exception traceback Time 2003/06/27 21:26:41.610 GMT-7 User Name (User Id) allison (allison) Request URL http://xxx.yyy.com/createLFS Exception Type TypeError Exception Value unsubscriptable object Traceback (innermost last): * Module ZPublisher.Publish, line 98, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 39, in call_object * Module Shared.DC.Scripts.Bindings, line 252, in __call__ * Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec * Module Products.PythonScripts.PythonScript, line 315, in _exec * Module Script (Python), line 6, in createLFS <PythonScript at /createLFS> Line 6 * Module Products.LocalFS.LocalFS, line 1353, in manage_addLocalFS * Module App.FactoryDispatcher, line 103, in manage_main TypeError: unsubscriptable object -----------------
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. bye Jerome Alet
Jerome, 10E6 thanks. That and a typo elsewhere were the problems. :-) On Sat, 28 Jun 2003, Jerome Alet wrote:
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.
bye
Jerome Alet
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)
Good point. Another thinks which would improve the product would be to have a simple way to add new mime-types. I always feel a bit strange editing changes into products knowing that it will bite me in the end, so to speak. On Sat, 28 Jun 2003, Paul Winkler wrote:
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)
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Dennis Allison wrote at 2003-6-28 12:49 -0700:
Good point. Another thinks which would improve the product would be to have a simple way to add new mime-types. I always feel a bit strange editing changes into products knowing that it will bite me in the end, so to speak.
I know (from personal experience) that the author does not mind to incorparate patches (at least in principle) ;-) I also know that the author abandoned the product for some time because he himself did no longer use it. Maintaining a product purely for others is something one should not expect. Nevertheless, he later released a new version later. Thus, the active users of "LocalFS" must actively help the author to improve the product (in a way that he has not much work with it). Otherwise, the product will probably stay as it is now ;-) Dieter
participants (4)
-
Dennis Allison -
Dieter Maurer -
Jerome Alet -
Paul Winkler