running a External Method via ZEO
Hi. I've spent about 2 hours trying to get this to work. This is *so* frustrating I can not begin to tell you. I have a External Method. A pre-populate Data.fs. I merely want to execute this external method. But the problem is I can not get the INSTANCE_HOME and SOFTWARE_HOME "Products" folders to import into the same namespace. I guess Zope is doing some really magical *!4@ to get everything available in the Products namespace. could someone please explain to me this magic? running: import os import sys sys.path.append('/var/zope/zope/lib/python') sys.path.append('/var/zope/test') os.environ['INSTANCE_HOME']='/var/zope/test' os.environ['ZOPE_HOME']='/var/zope/zope' def main(): import ZODB import ZEO.ClientStorage, os, string import OFS.Application import App.ProductContext host=os.environ.get('ZEO_SERVER_NAME', '') port=string.atoi(os.environ.get('ZEO_SERVER_PORT','21894')) MB = 1024**2 Storage=ZEO.ClientStorage.ClientStorage((host, port), client='us.plone.org', name='plonedotorg') zodb=ZODB.DB(Storage) connection=zodb.open() root=connection.root() import pdb; pdb.set_trace() app=root['Application'] app.reset() connection.close() if __name__=='__main__': main() I get: Traceback (most recent call last): File "reset_test.py", line 32, in ? main() File "reset_test.py", line 28, in main app.reset() File "/var/zope/Zope-2.6.2b3- src/lib/python/Products/ExternalMethod/ExternalMethod.py", line 231, in __call__ return apply(f,(self.aq_parent.this(),)+args,kw) File "/var/zope/test/Extensions/daily.py", line 30, in reset_env Portal.manage_addSite(self, 'plone.org') File "/var/zope/test/Products/CMFPlone/Portal.py", line 361, in manage_addSite p = gen.create(self, id.strip(), create_userfolder) File "/var/zope/test/Products/CMFPlone/Portal.py", line 344, in create self.setup(p, create_userfolder) File "/var/zope/test/Products/CMFDefault/Portal.py", line 285, in setup self.setupTools(p) File "/var/zope/test/Products/CMFPlone/Portal.py", line 310, in setupTools addCMFPloneTool = p.manage_addProduct['CMFPlone'].manage_addTool AttributeError: manage_addTool thanks, alan
alan runyan wrote:
I get: Traceback (most recent call last): File "reset_test.py", line 32, in ? main() File "reset_test.py", line 28, in main app.reset() File "/var/zope/Zope-2.6.2b3- src/lib/python/Products/ExternalMethod/ExternalMethod.py", line 231, in __call__ return apply(f,(self.aq_parent.this(),)+args,kw) File "/var/zope/test/Extensions/daily.py", line 30, in reset_env Portal.manage_addSite(self, 'plone.org') File "/var/zope/test/Products/CMFPlone/Portal.py", line 361, in manage_addSite p = gen.create(self, id.strip(), create_userfolder) File "/var/zope/test/Products/CMFPlone/Portal.py", line 344, in create self.setup(p, create_userfolder) File "/var/zope/test/Products/CMFDefault/Portal.py", line 285, in setup self.setupTools(p) File "/var/zope/test/Products/CMFPlone/Portal.py", line 310, in setupTools addCMFPloneTool = p.manage_addProduct['CMFPlone'].manage_addTool AttributeError: manage_addTool
What is p when this happens? Chris
participants (2)
-
alan runyan -
Chris Withers