To summarize: How do I import modules in an External Method's .py file?

I have an external method that points to a .py file that has an import
statement at the top.  The import statement loads another module of mine
(CProject.py).  I've placed both files (pwToxml.py and CProject.py) in the
Zope/Extensions directory.  When I try to create an external method on the
pTox.py file with the following parameters:
ID = pTox
Function Name = pTox
Python Module File = pwToxml
I get the following error:
Error Type: ImportError
Error Value: No module named CProject
Traceback (innermost last):
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 222, in
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 187, in
  File /usr/local/Zope/lib/python/Zope/__init__.py, line 221, in
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 171, in
  File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
    (Object: manage_addExternalMethod)
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 112, in
    (Object: manage_addExternalMethod)
  File /usr/local/Zope/lib/python/Products/ExternalMethod/ExternalMethod.py,
line 130, in manage_addExternalMethod
  File /usr/local/Zope/lib/python/Products/ExternalMethod/ExternalMethod.py,
line 178, in __init__
    (Object: pTox)
  File /usr/local/Zope/lib/python/Products/ExternalMethod/ExternalMethod.py,
line 201, in manage_edit
    (Object: pTox)
  File /usr/local/Zope/lib/python/Products/ExternalMethod/ExternalMethod.py,
line 210, in getFunction
    (Object: pTox)
  File /usr/local/Zope/lib/python/App/Extensions.py, line 217, in getObject
    (Info: ('/usr/local/Zope/Extensions/pwToxml.py', 'pwToxml'))
  File /usr/local/Zope/Extensions/pwToxml.py, line 1, in ?
ImportError: (see above)

I checked the sys.path for my Python installation and placed the CProject.py
file there, but I still get the same error.

Here's the top of my pwToxml.py file:

import CProject, string

def pTox(self, REQUEST):
    """Function to map pw to CProject Objects"""
    dictData = REQUEST.form.items()
    strTemp = ""
    strError = "Error Retrieving Dictionary Value"

Thanks for any help you can provide.

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to