[Zope] running a External Method via ZEO

Tim Edwards Tim.Edwards at hwe.com.au
Thu Sep 18 21:46:22 EDT 2003


This problem sounds very similar to the one I posted a couple of days ago
with the subject line "[Zope] Running ExternalMethods using ZopeTestCase". I
am trying to run my external methods through a script but no matter what I
do to the Software and Instance home they keep losing their value, and so
the external methods cant be found, and I am also very frustrated by it.

Does anyone have any idea of a workaround for this? Can someone explain how
the External Methods module interacts with the Instance and Software Home
environment variables? What is the difference between setting the
INstance_home environement variable like this:
os.environ['INSTANCE_HOME']='/var/zope/test' and setting the INSTANCE_HOME
variable like this: INSTANCE_HOME = '/some/path'

Tim Edwards

-----Original Message-----
From: alan runyan [mailto:runyaga at runyaga.com]
Sent: Friday, 19 September 2003 11:43 AM
To: zope at zope.org
Subject: [Zope] 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



_______________________________________________
Zope maillist  -  Zope at 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 )



More information about the Zope mailing list