Justin Deoliveira | 2 Nov 01:58
Favicon
Gravatar

Re: distributing jar files with distutils

Hi,

Thanks for the reply. You are indeed correct that it was a class loader 
issue. Digging a bit deeper I found my problem already has a bug report 
open for it:

http://bugs.jython.org/issue1373

As described on the issue I refactored SyspathJavaLoader a bit and it 
fixes my problem. However following the "how to submit a patch" 
guidelines leads me here:

http://jython.org/patches/

But I get a 404. Is the patch tracker down? Or are the patch guidelines 
out of date?

And about Jump it looks *very* promising. I will definitely be looking 
into that for distribution of my app. Thanks for the tip.

-Justin

Leo Soto M. wrote:
> On Sat, Oct 24, 2009 at 5:40 PM, Justin Deoliveira <jdeolive <at> opengeo.org> wrote:
>> Hello all,
>>
>> First off I just want to say how great my experience with Jython has
>> been. Everything has worked transparently thus far and I have not had to
>> yet post to the list.
>>
(Continue reading)

Daniel Baktiar | 2 Nov 06:28
Picon
Gravatar

Re: from and with keywords

Hi John,


Could you elaborate more on how you install Jython on your environment?
The first line looks like you are invoking jython from your default CPython instead of Jython.
The line 1: #!/usr/bin/python

Could you invoke Jython from your shell/command prompt with that setting?

Regards,
Daniel

2009/10/31 <john.m.baker <at> nomura.com>
I've copied the jython.jar file into my project but I guess I need the Lib directory too?  Does it go on the classpath?  Does Jython look in the current working directory?



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users



--
Daniel Baktiar - JEEwish & Pythoneer
(http://dbaktiar.wordpress.com)
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
john.m.baker | 2 Nov 09:40
Favicon

Re: from and with keywords

Hello,

 

I unzipped the jython package and I can run the jython jar using java –jar jython.jar.  The interpreter works fine.

 

What the instructions lack is how to copy the jython jar and resources elsewhere.  I don’t want to ship the entire jython zip file with my project; I want to place the relevant parts into a war file.

 

The #!/usr/bin/python is irrelevant – it’s there because the script has it, but it still doesn’t work without it.

 

The answer seems to lie in the lib directory – could you tell me how Jython loads resources from it?

 

Thanks,

 


John

 

From: Daniel Baktiar [mailto:dbaktiar <at> gmail.com]
Sent: 02 November 2009 05:28
To: jython-users <at> lists.sourceforge.net
Subject: Re: [Jython-users] from and with keywords

 

Hi John,

 

Could you elaborate more on how you install Jython on your environment?

The first line looks like you are invoking jython from your default CPython instead of Jython.

The line 1: #!/usr/bin/python

 

Could you invoke Jython from your shell/command prompt with that setting?

 

Regards,

Daniel

2009/10/31 <john.m.baker <at> nomura.com>

I've copied the jython.jar file into my project but I guess I need the Lib directory too?  Does it go on the classpath?  Does Jython look in the current working directory?



 



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Jason R Briggs | 2 Nov 10:22
Picon

Re: from and with keywords

If you're deploying in a war, then stick the Lib directory in the "classes" dir (for example), and then point the python path at that directory with something vaguely like:

Properties props = new Properties();
String jythonPath = libDir.getFile().getCanonicalPath();
props.put("python.path", jythonPath);
PythonInterpreter.initialize(System.getProperties(), props, null);

In my case, "libDir" is a prop injected by spring:

<property name="libDir" value="classpath:Lib" />

So you'll need to grab the canonical path according to whatever framework you're working within.

Dunno if that helps?

J

On Mon, Nov 2, 2009 at 8:40 AM, <john.m.baker <at> nomura.com> wrote:

Hello,

 

I unzipped the jython package and I can run the jython jar using java –jar jython.jar.  The interpreter works fine.

 

What the instructions lack is how to copy the jython jar and resources elsewhere.  I don’t want to ship the entire jython zip file with my project; I want to place the relevant parts into a war file.

 

The #!/usr/bin/python is irrelevant – it’s there because the script has it, but it still doesn’t work without it.

 

The answer seems to lie in the lib directory – could you tell me how Jython loads resources from it?

 

Thanks,

 


John

 

From: Daniel Baktiar [mailto:dbaktiar <at> gmail.com]
Sent: 02 November 2009 05:28
To: jython-users <at> lists.sourceforge.net


Subject: Re: [Jython-users] from and with keywords

 

Hi John,

 

Could you elaborate more on how you install Jython on your environment?

The first line looks like you are invoking jython from your default CPython instead of Jython.

The line 1: #!/usr/bin/python

 

Could you invoke Jython from your shell/command prompt with that setting?

 

Regards,

Daniel

2009/10/31 <john.m.baker <at> nomura.com>

I've copied the jython.jar file into my project but I guess I need the Lib directory too?  Does it go on the classpath?  Does Jython look in the current working directory?



 



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users


Use caution:
Category:
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
john.m.baker | 2 Nov 10:34
Favicon

pwd module on Windows

Hi,

Whats the best way to cope with these errors:

ImportError: pwd module not supported on Windows

If its not supported, what should I do to do something like this:

  currentuser= pwd.getpwuid(os.geteuid())[0]

I appreciate this isnt really Jython specific, but I suspect someone has some thoughts on writing cross OS Python!

Thanks,

John



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Jason R Briggs | 2 Nov 10:49
Picon

Re: from and with keywords

Yes you can (but that means you can only use java libraries, rather than python modules).  However your question was where to put resources -- and that's how I do it... ;-)

If you need to use the __future__ mod, you'll need to bundle the Lib dir.

On Mon, Nov 2, 2009 at 9:24 AM, <john.m.baker <at> nomura.com> wrote:

Surely we can deploy the standalone jar and nothing else?

 

From: Jason R Briggs [mailto:jasonrbriggs <at> gmail.com]
Sent: 02 November 2009 09:22
To: Baker, John (IT/UK); jython-users <at> lists.sourceforge.net


Subject: Re: [Jython-users] from and with keywords

 

If you're deploying in a war, then stick the Lib directory in the "classes" dir (for example), and then point the python path at that directory with something vaguely like:

Properties props = new Properties();
String jythonPath = libDir.getFile().getCanonicalPath();
props.put("python.path", jythonPath);
PythonInterpreter.initialize(System.getProperties(), props, null);

In my case, "libDir" is a prop injected by spring:

<property name="libDir" value="classpath:Lib" />

So you'll need to grab the canonical path according to whatever framework you're working within.

Dunno if that helps?

J

On Mon, Nov 2, 2009 at 8:40 AM, <john.m.baker <at> nomura.com> wrote:

Hello,

 

I unzipped the jython package and I can run the jython jar using java –jar jython.jar.  The interpreter works fine.

 

What the instructions lack is how to copy the jython jar and resources elsewhere.  I don’t want to ship the entire jython zip file with my project; I want to place the relevant parts into a war file.

 

The #!/usr/bin/python is irrelevant – it’s there because the script has it, but it still doesn’t work without it.

 

The answer seems to lie in the lib directory – could you tell me how Jython loads resources from it?

 

Thanks,

 


John


Use caution:
Category:
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
john.m.baker | 2 Nov 10:52
Favicon

Re: from and with keywords

I’m confused. J  So, what’s the difference between the Java libraries and the Python modules?  My understanding was that Jython makes use of the Python modules, shipped in the Lib directory.  And, my problem was that the Lib directory wasn’t in the jar hence the jar wasn’t portable (i.e. I couldn’t put it in a web app and use it). 

 

You seem to be suggesting that I can use the jar without the Lib directory bundled within it, and some other set of external modules?

 

From: Jason R Briggs [mailto:jasonrbriggs <at> gmail.com]
Sent: 02 November 2009 09:49
To: Baker, John (IT/UK); jython-users <at> lists.sourceforge.net
Subject: Re: [Jython-users] from and with keywords

 

Yes you can (but that means you can only use java libraries, rather than python modules).  However your question was where to put resources -- and that's how I do it... ;-)

If you need to use the __future__ mod, you'll need to bundle the Lib dir.

On Mon, Nov 2, 2009 at 9:24 AM, <john.m.baker <at> nomura.com> wrote:

Surely we can deploy the standalone jar and nothing else?

 

From: Jason R Briggs [mailto:jasonrbriggs <at> gmail.com]
Sent: 02 November 2009 09:22
To: Baker, John (IT/UK); jython-users <at> lists.sourceforge.net


Subject: Re: [Jython-users] from and with keywords

 

If you're deploying in a war, then stick the Lib directory in the "classes" dir (for example), and then point the python path at that directory with something vaguely like:

Properties props = new Properties();
String jythonPath = libDir.getFile().getCanonicalPath();
props.put("python.path", jythonPath);
PythonInterpreter.initialize(System.getProperties(), props, null);

In my case, "libDir" is a prop injected by spring:

<property name="libDir" value="classpath:Lib" />

So you'll need to grab the canonical path according to whatever framework you're working within.

Dunno if that helps?

J

On Mon, Nov 2, 2009 at 8:40 AM, <john.m.baker <at> nomura.com> wrote:

Hello,

 

I unzipped the jython package and I can run the jython jar using java –jar jython.jar.  The interpreter works fine.

 

What the instructions lack is how to copy the jython jar and resources elsewhere.  I don’t want to ship the entire jython zip file with my project; I want to place the relevant parts into a war file.

 

The #!/usr/bin/python is irrelevant – it’s there because the script has it, but it still doesn’t work without it.

 

The answer seems to lie in the lib directory – could you tell me how Jython loads resources from it?

 

Thanks,

 


John

 

Use caution:

Category:



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Alex Grönholm | 2 Nov 10:53
Picon
Gravatar

Re: from and with keywords

Jason R Briggs kirjoitti:
> If you're deploying in a war, then stick the Lib directory in the 
> "classes" dir (for example), and then point the python path at that 
> directory with something vaguely like:
>
> Properties props = new Properties();
> String jythonPath = libDir.getFile().getCanonicalPath();
> props.put("python.path", jythonPath);
> PythonInterpreter.initialize(System.getProperties(), props, null);
>
> In my case, "libDir" is a prop injected by spring:
>
> <property name="libDir" value="classpath:Lib" />
>
> So you'll need to grab the canonical path according to whatever 
> framework you're working within.
>
> Dunno if that helps?
>
> J
>
> On Mon, Nov 2, 2009 at 8:40 AM, <john.m.baker <at> nomura.com 
> <mailto:john.m.baker <at> nomura.com>> wrote:
>
>     Hello,
>
>      
>
>     I unzipped the jython package and I can run the jython jar using
>     java –jar jython.jar.  The interpreter works fine.
>
>      
>
>     What the instructions lack is how to copy the jython jar and
>     resources elsewhere.  I don’t want to ship the entire jython zip
>     file with my project; I want to place the relevant parts into a
>     war file.
>
>      
>
>     The #!/usr/bin/python is irrelevant – it’s there because the
>     script has it, but it still doesn’t work without it.
>
>      
>
>     The answer seems to lie in the lib directory – could you tell me
>     how Jython loads resources from it?
>
>      
>
>     Thanks,
>
>      
>
>
>     John
>
>      
>
>     *From:* Daniel Baktiar [mailto:dbaktiar <at> gmail.com
>     <mailto:dbaktiar <at> gmail.com>]
>     *Sent:* 02 November 2009 05:28
>     *To:* jython-users <at> lists.sourceforge.net
>     <mailto:jython-users <at> lists.sourceforge.net>
>
>     *Subject:* Re: [Jython-users] from and with keywords
>
>      
>
>     Hi John,
>
>      
>
>     Could you elaborate more on how you install Jython on your
>     environment?
>
>     The first line looks like you are invoking jython from your
>     default CPython instead of Jython.
>
>     The line 1: #!/usr/bin/python
>
>      
>
>     Could you invoke Jython from your shell/command prompt with that
>     setting?
>
>      
>
>     Regards,
>
>     Daniel
>
>     2009/10/31 <john.m.baker <at> nomura.com <mailto:john.m.baker <at> nomura.com>>
>
>     I've copied the jython.jar file into my project but I guess I need
>     the Lib directory too?  Does it go on the classpath?  Does Jython
>     look in the current working directory?
>
>
>
>      
>
>
>
>     This e-mail (including any attachments) is confidential, may contain
>     proprietary or privileged information and is intended for the named
>     recipient(s) only. Unintended recipients are prohibited from
>     taking action
>     on the basis of information in this e-mail and must delete all
>     copies.
>     Nomura will not accept responsibility or liability for the
>     accuracy or
>     completeness of, or the presence of any virus or disabling code
>     in, this
>     e-mail. If verification is sought please request a hard copy. Any
>     reference
>     to the terms of executed transactions should be treated as
>     preliminary only
>     and subject to formal written confirmation by Nomura. Nomura
>     reserves the
>     right to monitor e-mail communications through its networks (in
>     accordance
>     with applicable laws). No confidentiality or privilege is waived
>     or lost by
>     Nomura by any mistransmission of this e-mail. Any reference to
>     "Nomura" is
>     a reference to any entity in the Nomura Holdings, Inc. group.
>     Please read
>     our Electronic Communications Legal Notice which forms part of
>     this e-mail:
>     http://www.Nomura.com/email_disclaimer.htm
>
>     ------------------------------------------------------------------------------
>     Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>     is the only developer event you need to attend this year.
>     Jumpstart your
>     developing skills, take BlackBerry mobile applications to market
>     and stay
>     ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>     http://p.sf.net/sfu/devconference
>     _______________________________________________
>     Jython-users mailing list
>     Jython-users <at> lists.sourceforge.net
>     <mailto:Jython-users <at> lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/jython-users
>
>
> *Use caution:*
> Category:
> More info >>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> ------------------------------------------------------------------------
>
> _______________________________________________
> Jython-users mailing list
> Jython-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>   

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
john.m.baker | 2 Nov 11:03
Favicon

Re: pwd module on Windows

And now I’m looking about for a solution, where by I need to check the operating system (I have other requirements to avoid running code that is platform specific – it makes calls to rsync etc.!), platform.system() returns ‘Java’, so it’s difficult to tell what is the underlying operating system.

 

Any thoughts?

 

From: Baker, John (IT/UK)
Sent: 02 November 2009 09:35
To: jython-users <at> lists.sourceforge.net
Subject: [Jython-users] pwd module on Windows

 

Hi,

What’s the best way to cope with these errors:

ImportError: pwd module not supported on Windows

If it’s not supported, what should I do to do something like this:

  currentuser= pwd.getpwuid(os.geteuid())[0]

I appreciate this isn’t really Jython specific, but I suspect someone has some thoughts on writing cross OS Python!

Thanks,

John

 



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
john.m.baker | 2 Nov 12:34
Favicon

Re: from and with keywords

Jason,

 

If I have my own library, that I’d usually point at through a .pth file in the site-packages directory, should I point to it through the python.path environment var?

 

I’ve just tried using the code sample below and it failed...

 

 

john

 

From: Jason R Briggs [mailto:jasonrbriggs <at> gmail.com]
Sent: 02 November 2009 09:22
To: Baker, John (IT/UK); jython-users <at> lists.sourceforge.net
Subject: Re: [Jython-users] from and with keywords

 

If you're deploying in a war, then stick the Lib directory in the "classes" dir (for example), and then point the python path at that directory with something vaguely like:

Properties props = new Properties();
String jythonPath = libDir.getFile().getCanonicalPath();
props.put("python.path", jythonPath);
PythonInterpreter.initialize(System.getProperties(), props, null);

In my case, "libDir" is a prop injected by spring:

<property name="libDir" value="classpath:Lib" />

So you'll need to grab the canonical path according to whatever framework you're working within.

Dunno if that helps?

J

 



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users

Gmane