Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
(1) |
2
(12) |
3
(3) |
4
(4) |
5
(6) |
6
|
7
(2) |
8
(6) |
9
(13) |
10
(7) |
11
(3) |
12
(10) |
13
(5) |
14
(1) |
15
(9) |
16
(1) |
17
(9) |
18
(8) |
19
(4) |
20
(1) |
21
|
22
(1) |
23
|
24
|
25
|
26
(3) |
27
|
28
|
29
(1) |
30
(14) |
31
(6) |
|
|
|
From: Santosh Tiwari <tiwaris@gm...> - 2010-03-10 14:40:12
|
Digging deeper into the code, it appears to me that if I am using the PythonInterpreter in separate threads, I should have a new system state for each instance that is in a separate thread. On Wed, Mar 10, 2010 at 9:28 AM, Santosh Tiwari <tiwaris@...> wrote: > So, it is generally a good idea to *always* create a new PySystemState and > pass it to the constructor when creating a new instance of PythonInterpreter > if we want the two instances to be completely independent. Am I right? > > Can somebody approve or disapprove of my statement? > > > On Wed, Mar 10, 2010 at 9:27 AM, Santosh Tiwari <tiwaris@...> wrote: > >> So, it is generally a good idea to *always* create a new PySystemState >> and pass it to the constructor when creating a new instance of >> PythonInterpreter if we want the two instances to be completely independent. >> >> >> >> >> On Wed, Mar 10, 2010 at 6:05 AM, <john.m.baker@...> wrote: >> >>> Right. I had previously created a PythonInterpreter and need to create >>> a new one with a separate state for each stdout stream: >>> >>> PythonInterpreter.initialize(System.getProperties(), null, new >>> String[0]); >>> PySystemState systemState = new PySystemState(); >>> pi = new PythonInterpreter(null, systemState); >>> pi.setOut(outputStream); >>> pi.setErr(outputStream); >>> >>> I think PythonInterpreter could be improved by making that more obvious, >>> or by creating two versions of it - one which uses a 'shared state' and >>> another which creates a new PySystemState each time it's constructed. >>> >>> >> > > > -- > Santosh Tiwari > tiwaris@... > -- Santosh Tiwari tiwaris@... |
From: <john.m.baker@no...> - 2010-03-10 14:40:01
|
I think it's too easy for anyone new to the framework to believe an instance of PythonInterpreter is a new fresh not-connected to anything previous instance. It would make more sense to make PythonInterpreter totally independent, and create another class that makes use of this 'shared' state, and have that very well documented (what's shared, threadsafeness, etc.) From: Santosh Tiwari [mailto:tiwaris@...] Sent: 10 March 2010 14:27 To: Baker, John (IT/UK); jython-users@... Subject: Re: [Jython-users] Redirecting stdout from PythonInterpreter So, it is generally a good idea to always create a new PySystemState and pass it to the constructor when creating a new instance of PythonInterpreter if we want the two instances to be completely independent. On Wed, Mar 10, 2010 at 6:05 AM, <john.m.baker@...> wrote: Right. I had previously created a PythonInterpreter and need to create a new one with a separate state for each stdout stream: PythonInterpreter.initialize(System.getProperties(), null, new String[0]); PySystemState systemState = new PySystemState(); pi = new PythonInterpreter(null, systemState); pi.setOut(outputStream); pi.setErr(outputStream); I think PythonInterpreter could be improved by making that more obvious, or by creating two versions of it - one which uses a 'shared state' and another which creates a new PySystemState each time it's constructed. 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 |
From: Santosh Tiwari <tiwaris@gm...> - 2010-03-10 14:28:16
|
So, it is generally a good idea to *always* create a new PySystemState and pass it to the constructor when creating a new instance of PythonInterpreter if we want the two instances to be completely independent. Am I right? Can somebody approve or disapprove of my statement? On Wed, Mar 10, 2010 at 9:27 AM, Santosh Tiwari <tiwaris@...> wrote: > So, it is generally a good idea to *always* create a new PySystemState and > pass it to the constructor when creating a new instance of PythonInterpreter > if we want the two instances to be completely independent. > > > > > On Wed, Mar 10, 2010 at 6:05 AM, <john.m.baker@...> wrote: > >> Right. I had previously created a PythonInterpreter and need to create >> a new one with a separate state for each stdout stream: >> >> PythonInterpreter.initialize(System.getProperties(), null, new >> String[0]); >> PySystemState systemState = new PySystemState(); >> pi = new PythonInterpreter(null, systemState); >> pi.setOut(outputStream); >> pi.setErr(outputStream); >> >> I think PythonInterpreter could be improved by making that more obvious, >> or by creating two versions of it - one which uses a 'shared state' and >> another which creates a new PySystemState each time it's constructed. >> >> > -- Santosh Tiwari tiwaris@... |
From: Santosh Tiwari <tiwaris@gm...> - 2010-03-10 14:27:14
|
So, it is generally a good idea to *always* create a new PySystemState and pass it to the constructor when creating a new instance of PythonInterpreter if we want the two instances to be completely independent. On Wed, Mar 10, 2010 at 6:05 AM, <john.m.baker@...> wrote: > Right. I had previously created a PythonInterpreter and need to create > a new one with a separate state for each stdout stream: > > PythonInterpreter.initialize(System.getProperties(), null, new > String[0]); > PySystemState systemState = new PySystemState(); > pi = new PythonInterpreter(null, systemState); > pi.setOut(outputStream); > pi.setErr(outputStream); > > I think PythonInterpreter could be improved by making that more obvious, > or by creating two versions of it - one which uses a 'shared state' and > another which creates a new PySystemState each time it's constructed. > > |
From: <john.m.baker@no...> - 2010-03-10 11:05:55
|
Right. I had previously created a PythonInterpreter and need to create a new one with a separate state for each stdout stream: PythonInterpreter.initialize(System.getProperties(), null, new String[0]); PySystemState systemState = new PySystemState(); pi = new PythonInterpreter(null, systemState); pi.setOut(outputStream); pi.setErr(outputStream); I think PythonInterpreter could be improved by making that more obvious, or by creating two versions of it - one which uses a 'shared state' and another which creates a new PySystemState each time it's constructed. > -----Original Message----- > From: Baker, John (IT/UK) > Sent: 10 March 2010 10:11 > To: Baker, John (IT/UK); jython-dev@...; jython- > users@... > Subject: RE: [Jython-users] Redirecting stdout from PythonInterpreter > > Interestingly, the debugger shows me that the PySystemState has a > variable stdout which points at the FileOutputStream, and __stdout__ > which points to a PyFile, writing to a TextIOWrapper. > > > -----Original Message----- > > From: Baker, John (IT/UK) > > Sent: 10 March 2010 09:38 > > To: jython-dev@...; jython-users@... > > Subject: Re: [Jython-users] Redirecting stdout from PythonInterpreter > > > > I need to create a servlet, unfortunately. However, this is all a > bit > > weird. If I run a standalone application, I can send the output to a > > file, but if I do this: > > > > File x = File.createTempFile("jfarm", null); > > log.info("Writing to temp file "+x.getPath()); > > fos = new FileOutputStream(x); > > pi.setOut(fos); > > pi.setErr(fos); > > > > In the servlet, the file is created but remains empty and the output > > goes to stdout! > > > > The PythonInterpreter is created prior to that and is a new instance, > > although a few will have been created so if there are any statics > > inside > > PythonInterpreter then perhaps the fault lies elsewhere.. > > > > > -----Original Message----- > > > From: Alan Kennedy [mailto:jython-dev@...] > > > Sent: 09 March 2010 17:28 > > > To: jython-users@... > > > Subject: Re: [Jython-users] Redirecting stdout from > PythonInterpreter > > > > > > [Alan] > > > >> You haven't shown us the definition of outputStream. Is it a > > > >> FileOutputStream? Some other form of OuputStream? > > > > > > [John] > > > > It's request.getOutputStream() - I am assuming that if I set that > > on > > > pi, > > > > it will write to the output stream of a servlet request. > > > > Perhaps it's a poor assumption ? :-) > > > > > > I presume you mean response.getOutputStream()? > > > > > > http://java.sun.com/products/servlet/2.5/docs/servlet-2_5- > > > mr2/javax/servlet/ServletResponse.html#getOutputStream%28%29 > > > > > > response.getOutputStream() should return a ServletOutputStream, > which > > > is a subclass of java.io.OutputStream, so it should be acceptable > as > > a > > > parameter to setOut(). So I'm not sure why it wouldn't be working. > > > > > > Things to note include > > > > > > 1. The setOut method is actually a method of PySystemState, which > is > > > by default shared by all interpreters that are created without an > > > explicit PySystemState parameter. See the source of modjy for how > to > > > do the PySystemState/PythonInterpreter dance, on lines 105 to 108. > > > > > > > > > http://fisheye3.atlassian.com/browse/jython/trunk/jython/src/com/xhaus/ > > > modjy/ModjyJServlet.java?r=6866 > > > > > > Although if you're only creating a single interpreter, that > shouldn't > > > make any difference. > > > > > > 2. I would not consider it good practice to handle output this way: > > > what happens if you get an exception part way through generating > your > > > output? > > > > > > Instead, I would recommend that you use either of the two python > > > Servlet mechanisms provided with jython, i.e. > > > > > > A: Modjy, the Servlets->WSGI gateway. The documentation refers to > > > Tomcat throughout. > > > > > > http://modjy.xhaus.com > > > > > > Using WSGI with modjy makes writing applications as simple as > follows > > > (using the standard demo configuration) > > > > > > def handler(environ, start_response_callable): > > > start_response_callable("200 OK", [('content-type', > 'text/html')]) > > > return ["<html><h1>Hello World!</h1></html>"] > > > > > > See the "modjy_webapp" directory in the Demo directory of a jython > > > installation. > > > > > > B: org.python.util.PyServlet > > > > > > > > > http://fisheye3.atlassian.com/browse/jython/trunk/jython/src/org/python > > > /util/PyServlet.java > > > > > > Both of these mechanisms have already defined the handling of > output > > > and errors, and are known to work. > > > > > > Regards, > > > > > > Alan. > > > > > > > > > > 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 > > > > > > --------------------------------------------------------------------- > -- > > ------- > > Download Intel® Parallel Studio Eval > > Try the new software tools for yourself. Speed compiling, find bugs > > proactively, and fine-tune applications for parallel performance. > > See why Intel Parallel Studio got high marks during beta. > > http://p.sf.net/sfu/intel-sw-dev > > _______________________________________________ > > Jython-users mailing list > > Jython-users@... > > https://lists.sourceforge.net/lists/listinfo/jython-users 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 |
From: <john.m.baker@no...> - 2010-03-10 10:11:01
|
Interestingly, the debugger shows me that the PySystemState has a variable stdout which points at the FileOutputStream, and __stdout__ which points to a PyFile, writing to a TextIOWrapper. > -----Original Message----- > From: Baker, John (IT/UK) > Sent: 10 March 2010 09:38 > To: jython-dev@...; jython-users@... > Subject: Re: [Jython-users] Redirecting stdout from PythonInterpreter > > I need to create a servlet, unfortunately. However, this is all a bit > weird. If I run a standalone application, I can send the output to a > file, but if I do this: > > File x = File.createTempFile("jfarm", null); > log.info("Writing to temp file "+x.getPath()); > fos = new FileOutputStream(x); > pi.setOut(fos); > pi.setErr(fos); > > In the servlet, the file is created but remains empty and the output > goes to stdout! > > The PythonInterpreter is created prior to that and is a new instance, > although a few will have been created so if there are any statics > inside > PythonInterpreter then perhaps the fault lies elsewhere.. > > > -----Original Message----- > > From: Alan Kennedy [mailto:jython-dev@...] > > Sent: 09 March 2010 17:28 > > To: jython-users@... > > Subject: Re: [Jython-users] Redirecting stdout from PythonInterpreter > > > > [Alan] > > >> You haven't shown us the definition of outputStream. Is it a > > >> FileOutputStream? Some other form of OuputStream? > > > > [John] > > > It's request.getOutputStream() - I am assuming that if I set that > on > > pi, > > > it will write to the output stream of a servlet request. > > > Perhaps it's a poor assumption ? :-) > > > > I presume you mean response.getOutputStream()? > > > > http://java.sun.com/products/servlet/2.5/docs/servlet-2_5- > > mr2/javax/servlet/ServletResponse.html#getOutputStream%28%29 > > > > response.getOutputStream() should return a ServletOutputStream, which > > is a subclass of java.io.OutputStream, so it should be acceptable as > a > > parameter to setOut(). So I'm not sure why it wouldn't be working. > > > > Things to note include > > > > 1. The setOut method is actually a method of PySystemState, which is > > by default shared by all interpreters that are created without an > > explicit PySystemState parameter. See the source of modjy for how to > > do the PySystemState/PythonInterpreter dance, on lines 105 to 108. > > > > > http://fisheye3.atlassian.com/browse/jython/trunk/jython/src/com/xhaus/ > > modjy/ModjyJServlet.java?r=6866 > > > > Although if you're only creating a single interpreter, that shouldn't > > make any difference. > > > > 2. I would not consider it good practice to handle output this way: > > what happens if you get an exception part way through generating your > > output? > > > > Instead, I would recommend that you use either of the two python > > Servlet mechanisms provided with jython, i.e. > > > > A: Modjy, the Servlets->WSGI gateway. The documentation refers to > > Tomcat throughout. > > > > http://modjy.xhaus.com > > > > Using WSGI with modjy makes writing applications as simple as follows > > (using the standard demo configuration) > > > > def handler(environ, start_response_callable): > > start_response_callable("200 OK", [('content-type', 'text/html')]) > > return ["<html><h1>Hello World!</h1></html>"] > > > > See the "modjy_webapp" directory in the Demo directory of a jython > > installation. > > > > B: org.python.util.PyServlet > > > > > http://fisheye3.atlassian.com/browse/jython/trunk/jython/src/org/python > > /util/PyServlet.java > > > > Both of these mechanisms have already defined the handling of output > > and errors, and are known to work. > > > > Regards, > > > > Alan. > > > > > 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 > > > ----------------------------------------------------------------------- > ------- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Jython-users mailing list > Jython-users@... > https://lists.sourceforge.net/lists/listinfo/jython-users 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 |
From: <john.m.baker@no...> - 2010-03-10 09:37:48
|
I need to create a servlet, unfortunately. However, this is all a bit weird. If I run a standalone application, I can send the output to a file, but if I do this: File x = File.createTempFile("jfarm", null); log.info("Writing to temp file "+x.getPath()); fos = new FileOutputStream(x); pi.setOut(fos); pi.setErr(fos); In the servlet, the file is created but remains empty and the output goes to stdout! The PythonInterpreter is created prior to that and is a new instance, although a few will have been created so if there are any statics inside PythonInterpreter then perhaps the fault lies elsewhere.. > -----Original Message----- > From: Alan Kennedy [mailto:jython-dev@...] > Sent: 09 March 2010 17:28 > To: jython-users@... > Subject: Re: [Jython-users] Redirecting stdout from PythonInterpreter > > [Alan] > >> You haven't shown us the definition of outputStream. Is it a > >> FileOutputStream? Some other form of OuputStream? > > [John] > > It's request.getOutputStream() - I am assuming that if I set that on > pi, > > it will write to the output stream of a servlet request. > > Perhaps it's a poor assumption ? :-) > > I presume you mean response.getOutputStream()? > > http://java.sun.com/products/servlet/2.5/docs/servlet-2_5- > mr2/javax/servlet/ServletResponse.html#getOutputStream%28%29 > > response.getOutputStream() should return a ServletOutputStream, which > is a subclass of java.io.OutputStream, so it should be acceptable as a > parameter to setOut(). So I'm not sure why it wouldn't be working. > > Things to note include > > 1. The setOut method is actually a method of PySystemState, which is > by default shared by all interpreters that are created without an > explicit PySystemState parameter. See the source of modjy for how to > do the PySystemState/PythonInterpreter dance, on lines 105 to 108. > > http://fisheye3.atlassian.com/browse/jython/trunk/jython/src/com/xhaus/ > modjy/ModjyJServlet.java?r=6866 > > Although if you're only creating a single interpreter, that shouldn't > make any difference. > > 2. I would not consider it good practice to handle output this way: > what happens if you get an exception part way through generating your > output? > > Instead, I would recommend that you use either of the two python > Servlet mechanisms provided with jython, i.e. > > A: Modjy, the Servlets->WSGI gateway. The documentation refers to > Tomcat throughout. > > http://modjy.xhaus.com > > Using WSGI with modjy makes writing applications as simple as follows > (using the standard demo configuration) > > def handler(environ, start_response_callable): > start_response_callable("200 OK", [('content-type', 'text/html')]) > return ["<html><h1>Hello World!</h1></html>"] > > See the "modjy_webapp" directory in the Demo directory of a jython > installation. > > B: org.python.util.PyServlet > > http://fisheye3.atlassian.com/browse/jython/trunk/jython/src/org/python > /util/PyServlet.java > > Both of these mechanisms have already defined the handling of output > and errors, and are known to work. > > Regards, > > Alan. 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 |