Hi Dieter, When I try the following python script the message 'TypeError: unsubscriptable object' appears. Python script container.manage_addProduct['LocalFS'].manage_addLocalFS('test','test','c:\t emp\test3') 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 1, in createLocal - <PythonScript at /Smartstorage/createLocal> - Line 1 Module Products.LocalFS.LocalFS, line 1255, in manage_addLocalFS Module App.FactoryDispatcher, line 103, in manage_main TypeError: unsubscriptable object Regards, Michael ----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Michael Bleijerveld" <michael@bleijerveld.nl> Cc: <zope@zope.org> Sent: Saturday, October 11, 2003 8:53 PM Subject: Re: [Zope] add local filesystem directory with python
Michael Bleijerveld wrote at 2003-10-10 16:13 +0200:
How can I add a local filesystem directory with a python script ?
With a DTML-method or pythonscript I receive the following traceback.
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 1, in crtLFS - <PythonScript at /Maintenance/Smartstorage/crtLFS> - Line 1 AttributeError: manage_addLocalFS
What is wrong ?
You use "manage_addLocalFS" on an object that does not have (nor can acquire) this method.
Modern products usually require:
objectManager.manage_addProduct[productName].constructor(...)
Dieter