Josh Juneau | 1 Jan 18:10
Picon

Jython Monthly - Issue #37 - December 2009

The Jython Monthly newsletter for December 2009 is now available.  The Jython podcast will be released during the week of January 4th, 2010.



Happy Holidays!

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
john.m.baker | 5 Jan 15:00
Favicon

Passing None into a function

Hello,

How do I pass None into a function call?  I want to do:  myfunc(test, None) and this doesnt seem quite right:

            PyObject[] params = new PyObject[] {

                  new PyString(test),

                  PyNone.TYPE)

            };

            PyObject result = f.__call__(params);

Thank for your feedback.

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
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Tobias Ivarsson | 5 Jan 16:24
Picon
Gravatar

Re: Passing None into a function

org.python.core.Py.None should give you the object you expect.

On Tue, Jan 5, 2010 at 3:00 PM, <john.m.baker <at> nomura.com> wrote:

Hello,

How do I pass None into a function call?  I want to do:  myfunc(test, None) and this doesnt seem quite right:

            PyObject[] params = new PyObject[] {

                  new PyString(test),

                  PyNone.TYPE)

            };

            PyObject result = f.__call__(params);

Thank for your feedback.

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:

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Frank Wierzbicki | 5 Jan 16:51
Picon
Gravatar

Repoze.bfg and Jython weblog post

Here's a nice recipe for getting Repoze.bfg working on Jython:

http://ediaz.me/2010/01/repoze-bfg-on-jython-2-5/

-Frank

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
john.m.baker | 7 Jan 11:47
Favicon

Setting environment variables

Hello,

How do I set an environment variable for the PythonInterpreter?  Ive tried this but it doesnt work:  

      Properties p = System.getProperties();

      p.setProperty("MY_VAR,abc);

      PythonInterpreter.initialize(p, null, null); 

      PythonInterpreter pi = new PythonInterpreter(); 

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
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Aljoša Mohorović | 7 Jan 12:33
Picon
Gravatar

doj - MEDIA_ROOT in dev mode not working

i'm using this snippet to serve media files during development:
---
if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
    )
---

all i get is "Permission denied: /media/" although "jython manage.py
runserver" is running under same user/owner as media folder.
i did a quick "print settings.MEDIA_ROOT" and it points to proper folder.

any idea what i'm doing wrong?

Aljosa Mohorovic

p.s.
anybody knows how i can search mailing list archives?
user interface on sourceforge is useless, don't know how you manage to
host jython there.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Alex Grönholm | 7 Jan 12:38
Picon
Gravatar

Re: doj - MEDIA_ROOT in dev mode not working

7.1.2010 13:33, Aljoša Mohorović kirjoitti:
> i'm using this snippet to serve media files during development:
> ---
> if settings.DEBUG:
>      urlpatterns += patterns('',
>          (r'^media/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root': settings.MEDIA_ROOT}),
>      )
> ---
>
> all i get is "Permission denied: /media/" although "jython manage.py
> runserver" is running under same user/owner as media folder.
> i did a quick "print settings.MEDIA_ROOT" and it points to proper folder.
>
> any idea what i'm doing wrong?
>    
Out of curiosity, why are you running Django on Jython?
> Aljosa Mohorovic
>
> p.s.
> anybody knows how i can search mailing list archives?
> user interface on sourceforge is useless, don't know how you manage to
> host jython there.
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Jython-users mailing list
> Jython-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>    

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Aljoša Mohorović | 7 Jan 12:49
Picon
Gravatar

Re: doj - MEDIA_ROOT in dev mode not working

2010/1/7 Alex Grönholm <alex.gronholm <at> nextday.fi>:
> Out of curiosity, why are you running Django on Jython?

i'm trying to port spring/hibernate application to jython because it's
hosted on java based client owned infrastructure.
since i do daily python/django development it seemed as a smart move
to try this combination.

Aljosa

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Picon
Favicon

Re: bug in jython jsr223 implemetation?

Hi Nicholas
By any chance do you have anything that I can test - I have the jython 2.5.1 jar. If you have the modified class files I can just add them in my local and do the test.
 
thanks
Anamitra

--- On Wed, 12/9/09, Anamitra Bhattacharyya <ana_mitra <at> yahoo.com> wrote:

From: Anamitra Bhattacharyya <ana_mitra <at> yahoo.com>
Subject: Re: [Jython-users] bug in jython jsr223 implemetation?
To: jython-users <at> lists.sourceforge.net, "Nicholas Riley" <njriley <at> illinois.edu>
Date: Wednesday, December 9, 2009, 2:33 PM


Hi Nicholas
that's great - I can definitely wait for couple of weeks - I would be more than willing to test the code that you fix whenever u are ready with it. I will try to code as per we discussed then [not having to implement a pool of CompiledScript is a great relief].
Thanks for your help - do pls let me know whenever u have it ready for a test.
 
thanks
Anamitra
--- On Wed, 12/9/09, Nicholas Riley <njriley <at> illinois.edu> wrote:

From: Nicholas Riley <njriley <at> illinois.edu>
Subject: Re: [Jython-users] bug in jython jsr223 implemetation?
To: jython-users <at> lists.sourceforge.net
Date: Wednesday, December 9, 2009, 1:53 PM

In article <462905.91284.qm <at> web112103.mail.gq1.yahoo.com>,
Anamitra Bhattacharyya <ana_mitra <at> yahoo.com> wrote:

> System.out.println(a+"+"+b+"="+cs.getEngine().get("c")); - u sould see 4+5=13
> and 2+3=9 etc instead of nulls. BTW the rhino implementation says its
> "MULTITHREADED" too and still is giving correct out for this test. So do you
> think what I am trying to do is not valid as per the jsr 223 spec? OR there
> is some problem with the jython implementation of jsr223. Because if its the
> former - then I will have to use a pool of CompiledScript objects and that
> significantly complicates the implementation. If its the latter then I am
> ready to make an exception for jython and code to the jython api ditching
> jsr223 for jython - if u say the jython apis [PythonInterpreter etc] would
> work for this. All I want
>  to achieve is -
>  
> 1>compile a script and cache it
> 2>have multiple threads execute that and I use the Binding object as my
> transport for IN and OUT params to the script.

It's just a problem with the Jython implementation the JSR 223 (and
PythonInterpreter, for that matter) front ends.  There's nothing in
Jython itself that stops this from working.  At the time I was working
on the JSR 223 implementation, I didn't understand the use case you are
describing.  Now I do and I'll handle it.

If you can wait a couple of weeks I will get it fixed, otherwise I
suggest you just create your own per-thread locals/global Python
dictionaries (which are what the Bindings end up getting mapped to) and
use them.  If you look at the source code for PythonInterpreter it
should be clear what to do, otherwise please ask on the list.
--
Nicholas Riley <njriley <at> illinois.edu>


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users


-----Inline Attachment Follows-----

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev

-----Inline Attachment Follows-----

_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Leo Soto M. | 7 Jan 23:06
Picon
Gravatar

Re: doj - MEDIA_ROOT in dev mode not working

For everybody reading this in the future, the problem was caused by
ADMIN_MEDIA_PREFIX having the same value as MEDIA_ROOT. That's a
limitation of Django itself (more precisely, of the Django development
server).

--

-- 
Leo Soto M.
http://blog.leosoto.com

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 

Gmane