Dear List,
I have an external method and now I developed I new module in a
separated file and then I am trying to make my external method to
import it but I am failing here. Where should place my module file in
order to be found by my external method?
I tried to place it in the same folder of my
--On 13. Februar 2007 12:53:25 + Alan [EMAIL PROTECTED] wrote:
Dear List,
I have an external method and now I developed I new module in a
separated file and then I am trying to make my external method to
import it but I am failing here. Where should place my module file in
order to be
Thanks Andreas, I am trying with:
if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)
where myPath should be '[Zope installation folder]/instance/import'.
So my question now is: is there a variable inside Zope which can
returns the 'import' path?
Many thanks in advance.
Cheers,
Alan
--On 13. Februar 2007 13:10:17 + Alan [EMAIL PROTECTED] wrote:
Thanks Andreas, I am trying with:
if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)
What's the sense of this code? sys.path is usually *never* empty.
You should really look at the Python docs and learn where Python
- Original Message -
From: Alan [EMAIL PROTECTED]
To: Andreas Jung [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Tuesday, February 13, 2007 8:10 AM
Subject: Re: [Zope] External Method importing modules
Thanks Andreas, I am trying with:
if sys.path.count(myPath) == 0: sys.path.insert(0
Well, I did it:
from App.config import getConfiguration
extPath = getConfiguration().instancehome+'/Extensions'
if sys.path.count(extPath) == 0: sys.path.insert(0, extPath)
And it worked for what I wanted.
On 13/02/07, Alan [EMAIL PROTECTED] wrote:
On 13/02/07, Andreas Jung [EMAIL PROTECTED]
Alan wrote at 2007-2-13 13:10 +:
if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)
where myPath should be '[Zope installation folder]/instance/import'.
So my question now is: is there a variable inside Zope which can
returns the 'import' path?
Formerly, the ExternalMethod