You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(38) |
Nov
(98) |
Dec
(58) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(114) |
Feb
(123) |
Mar
(96) |
Apr
(66) |
May
(84) |
Jun
(72) |
Jul
(128) |
Aug
(126) |
Sep
(82) |
Oct
(80) |
Nov
(148) |
Dec
(55) |
| 2002 |
Jan
(137) |
Feb
(85) |
Mar
(118) |
Apr
(67) |
May
(71) |
Jun
(28) |
Jul
(69) |
Aug
(48) |
Sep
(83) |
Oct
(79) |
Nov
(54) |
Dec
(32) |
| 2003 |
Jan
(44) |
Feb
(47) |
Mar
(59) |
Apr
(57) |
May
(43) |
Jun
(45) |
Jul
(44) |
Aug
(39) |
Sep
(27) |
Oct
(62) |
Nov
(17) |
Dec
(23) |
| 2004 |
Jan
(41) |
Feb
(51) |
Mar
(38) |
Apr
(30) |
May
(25) |
Jun
(12) |
Jul
(11) |
Aug
(27) |
Sep
(16) |
Oct
(56) |
Nov
(23) |
Dec
(29) |
| 2005 |
Jan
(75) |
Feb
(82) |
Mar
(50) |
Apr
(77) |
May
(19) |
Jun
(104) |
Jul
(47) |
Aug
(42) |
Sep
(28) |
Oct
(143) |
Nov
(62) |
Dec
(13) |
| 2006 |
Jan
(20) |
Feb
(10) |
Mar
(59) |
Apr
(45) |
May
(25) |
Jun
(129) |
Jul
(162) |
Aug
(91) |
Sep
(15) |
Oct
(39) |
Nov
(186) |
Dec
(191) |
| 2007 |
Jan
(134) |
Feb
(140) |
Mar
(106) |
Apr
(77) |
May
(92) |
Jun
(63) |
Jul
(233) |
Aug
(102) |
Sep
(119) |
Oct
(63) |
Nov
(68) |
Dec
(32) |
| 2008 |
Jan
(69) |
Feb
(91) |
Mar
(129) |
Apr
(44) |
May
(18) |
Jun
(53) |
Jul
(50) |
Aug
(25) |
Sep
(11) |
Oct
(28) |
Nov
(67) |
Dec
(36) |
| 2009 |
Jan
(20) |
Feb
(24) |
Mar
(66) |
Apr
(53) |
May
(48) |
Jun
(48) |
Jul
(59) |
Aug
(82) |
Sep
(49) |
Oct
(30) |
Nov
(16) |
Dec
(16) |
| 2010 |
Jan
(52) |
Feb
(25) |
Mar
(36) |
Apr
(34) |
May
(14) |
Jun
(15) |
Jul
(14) |
Aug
(16) |
Sep
(23) |
Oct
(6) |
Nov
(4) |
Dec
(5) |
| 2011 |
Jan
(4) |
Feb
(22) |
Mar
(45) |
Apr
(9) |
May
(8) |
Jun
(13) |
Jul
(12) |
Aug
(4) |
Sep
(6) |
Oct
(10) |
Nov
(21) |
Dec
(5) |
| 2012 |
Jan
(6) |
Feb
(9) |
Mar
(25) |
Apr
(6) |
May
(4) |
Jun
(23) |
Jul
(6) |
Aug
(18) |
Sep
(21) |
Oct
(34) |
Nov
(19) |
Dec
(25) |
| 2013 |
Jan
(8) |
Feb
(34) |
Mar
(35) |
Apr
(4) |
May
(11) |
Jun
(4) |
Jul
(7) |
Aug
(5) |
Sep
(20) |
Oct
(12) |
Nov
(11) |
Dec
(7) |
| 2014 |
Jan
(10) |
Feb
(18) |
Mar
(50) |
Apr
(26) |
May
(53) |
Jun
(21) |
Jul
(12) |
Aug
(39) |
Sep
(43) |
Oct
(26) |
Nov
(8) |
Dec
(6) |
| 2015 |
Jan
(18) |
Feb
(32) |
Mar
(31) |
Apr
(42) |
May
(38) |
Jun
(13) |
Jul
(6) |
Aug
(11) |
Sep
(29) |
Oct
(25) |
Nov
(10) |
Dec
(11) |
| 2016 |
Jan
(24) |
Feb
(12) |
Mar
(13) |
Apr
(15) |
May
(22) |
Jun
(8) |
Jul
(12) |
Aug
(25) |
Sep
(8) |
Oct
(6) |
Nov
(13) |
Dec
(7) |
| 2017 |
Jan
(6) |
Feb
(29) |
Mar
(32) |
Apr
(8) |
May
(82) |
Jun
(42) |
Jul
(20) |
Aug
(17) |
Sep
(27) |
Oct
(14) |
Nov
(22) |
Dec
(6) |
| 2018 |
Jan
(12) |
Feb
(9) |
Mar
(22) |
Apr
(19) |
May
(14) |
Jun
(9) |
Jul
(9) |
Aug
(22) |
Sep
(22) |
Oct
(12) |
Nov
(13) |
Dec
(8) |
| 2019 |
Jan
(22) |
Feb
(3) |
Mar
(30) |
Apr
(20) |
May
(20) |
Jun
(6) |
Jul
(15) |
Aug
(25) |
Sep
(11) |
Oct
(24) |
Nov
(11) |
Dec
(6) |
| 2020 |
Jan
(9) |
Feb
(12) |
Mar
(29) |
Apr
(10) |
May
(22) |
Jun
(11) |
Jul
(15) |
Aug
(5) |
Sep
(6) |
Oct
(7) |
Nov
(7) |
Dec
(13) |
| 2021 |
Jan
(21) |
Feb
(5) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(7) |
Jul
(6) |
Aug
(8) |
Sep
(5) |
Oct
(9) |
Nov
(5) |
Dec
(6) |
| 2022 |
Jan
(5) |
Feb
(4) |
Mar
(8) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(10) |
Aug
(6) |
Sep
(7) |
Oct
(4) |
Nov
(4) |
Dec
(6) |
| 2023 |
Jan
(5) |
Feb
(5) |
Mar
(6) |
Apr
(4) |
May
(5) |
Jun
(6) |
Jul
(5) |
Aug
(5) |
Sep
(5) |
Oct
(5) |
Nov
(7) |
Dec
(8) |
| 2024 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2025 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2026 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Schmidmeier, A. <Arn...@si...> - 2001-01-10 11:00:40
|
> -----Ursprungliche Nachricht----- > Von: bc...@wo... [mailto:bc...@wo...] > Gesendet: Mittwoch, 10. Januar 2001 10:23 > An: jyt...@li... > Cc: Ype Kingma > Betreff: Re: [Jython-dev] Protected Java attributes in Python > subclasses > <snip> > > If you wanted to assign some value to sys.argv from PythonInterpreter, > you can call PySystemState.initialize(Properties, Properties, > String[]) > method. The values in the last string array are assigned to sys.argv. > However, this call will be ignore once the jython runtime is > initialized. > > (Perhaps we should consider adding a PythonInterpreter.initialize(..) > method that just calls one of the PySystemState.initialize > methods. That > way the initialization methods becomes more visible.) I would suggest to add an additional constructor. PythonInterpreter(Properties,Properties,String []) *********************************************************************** * *********************************************************************** Arno Schmidmeier Sirius Software GmbH Kolpingring 18 82041 Oberhaching Tel. 089/6136760 E-Mail Arn...@si... Fax 089/61367633 Internet www.sirius-eos.com |
|
From: <bc...@wo...> - 2001-01-10 09:25:01
|
[Brian Zimmer] >I've enclosed a patch to add the method getfqdn() to Lib/socket.py. >It's new Python 2.0. Thanks. I'll add it to the beta2 release. For the next time, please use a context or unified diff. Such a diff is a lot easier to apply. regards, finn |
|
From: <bc...@wo...> - 2001-01-10 09:24:31
|
[George.Sorial] >Is there a difference between Jython and JPython. I believe I read >somewhere that there was no difference. Apart from a different name, hundreds of fixed bugs, dozens of new features and the lack of 100% pure Java certification, they are exactly the same <wink>. Think of Jython 2.0 as the next version of JPython 1.1. Look at the NEWS file if you really care about all the tiny differences. regards, finn |
|
From: <bc...@wo...> - 2001-01-10 09:23:47
|
[Ype Kingma] >In Jython, when subclassing from a Java class, the protected >attributes of the Java class are not available. Protected fields are not made available. Protected methods are normally available from within python subclasses. One exception exist: final protected methods are not available with the Class.method syntax, but can be accessed as self.super__method. >This is different in a Java subclass. >Why? Mostly because the actual need haven't been so high. There are also some technical issues that have to be solved first. The access to a protected field must occur from with the subclass. In jython that means from the generated proxy class. >In case this actually should be changed: which code in the Jython >source is providing this feature? For the methods, look at org.python.compiler.JavaMaker.addMethod which are selecting which method from the java superclass should be available in the proxy. For protected fields we would have to create public getter/setter methods in the proxy class for each field. That must be done in a way that does not interfere with any existing getter/setter methods. >I know about the registry entry for accessing protected and private >attributes, but that is doing too much as I don't need private >fields. > >(I tried to access the protected pySystemState in PythonInterpreter.java >in a Jython subclass, which didn't work. >I worked around it by temporarily changing >the current system's argv while invoking the interpreter.) Subclassing PythonInterpreter from python? Kinda funny way of using jython IMHO. If you wanted to assign some value to sys.argv from PythonInterpreter, you can call PySystemState.initialize(Properties, Properties, String[]) method. The values in the last string array are assigned to sys.argv. However, this call will be ignore once the jython runtime is initialized. (Perhaps we should consider adding a PythonInterpreter.initialize(..) method that just calls one of the PySystemState.initialize methods. That way the initialization methods becomes more visible.) regards, finn |
|
From: <Geo...@ub...> - 2001-01-09 23:25:34
|
Is there a difference between Jython and JPython=3F I believe I read somewhere that there was no difference. Thanks, George Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. |
|
From: Ype K. <yk...@xs...> - 2001-01-09 21:13:47
|
Dear developers, In Jython, when subclassing from a Java class, the protected attributes of the Java class are not available. This is different in a Java subclass. Why? In case this actually should be changed: which code in the Jython source is providing this feature? I know about the registry entry for accessing protected and private attributes, but that is doing too much as I don't need private fields. (I tried to access the protected pySystemState in PythonInterpreter.java in a Jython subclass, which didn't work. I worked around it by temporarily changing the current system's argv while invoking the interpreter.) Thanks for you time, Ype |
|
From: ivan <iv...@ko...> - 2001-01-09 04:10:44
|
I was playing around with "anydbm" module, and I could not get it to work.
Basically it seems that it needs "whichdb" module. I was unable to find it
in the \lib directory as well. However, "dumbdbm" seems to be working.
Should I be using it instead of "anydbm"?
my code:
>>> import anydbm
>>> tmpDB = anydbm.open("testing", 'w')
Traceback (innermost last):
File "<console>", line 1, in ?
File "D:\jython\Lib\anydbm.py", line 71, in open
ImportError: no module named whichdb
Thanks,
any feedback is appreciated
_I
|
|
From: Garcia, M. <mg...@Bu...> - 2001-01-09 00:11:33
|
Thanks for your advice. For my purposes (writing an EJB test client) I think I'll just leave the respectJavaAccessibility to false even though this may not be the preferred technique. In the future I'll try to keep the setting to true by using this technique. Can I find any documentation at SourceForge pertaining to Jython's handling of private and protected members? thanks again. sincerely, Michael -----Original Message----- From: Robert W. Bill To: jyt...@li... Cc: Garcia, Michael Sent: 1/8/01 6:53 PM Subject: Re: [Jython-dev] Re: Problem calling protected method [Adam Burke] > You are very much on the right track. > > This is an FAQ: <snip> > > If you want to leave respectJavaAccessibility = true, could you inherit > from java.util.Calendar and expose the functionality that way? It may > require adding a public method that simply does > return self.x() Or use the lazy way, avoid the abstract class, and inherit from GregorianCalendar, i.e.- >>>from java.util import GregorianCalendar >>>class myTime(GregorianCalendar): ... def ms(self): ... return self.getTimeInMillis() ... >>>t = test() >>>t.ms() 978997877490L >>> If you still have respectJavaAccessibility = true, you can confirm protected status with: >>>g = GregorianCalendar() >>>g.getTimeInMillis() Traceback (innermost last): File "<console>", line 1, in ? AttributeError: getTimeInMillis (I actually sent this earlier, but received an service unavailable error- I apologize if I'm repeating myself...again :) cheers, -Robert |
|
From: Robert W. B. <rb...@di...> - 2001-01-08 23:55:47
|
[Adam Burke] > You are very much on the right track. > > This is an FAQ: <snip> > > If you want to leave respectJavaAccessibility = true, could you inherit > from java.util.Calendar and expose the functionality that way? It may > require adding a public method that simply does > return self.x() Or use the lazy way, avoid the abstract class, and inherit from GregorianCalendar, i.e.- >>>from java.util import GregorianCalendar >>>class myTime(GregorianCalendar): ... def ms(self): ... return self.getTimeInMillis() ... >>>t = test() >>>t.ms() 978997877490L >>> If you still have respectJavaAccessibility = true, you can confirm protected status with: >>>g = GregorianCalendar() >>>g.getTimeInMillis() Traceback (innermost last): File "<console>", line 1, in ? AttributeError: getTimeInMillis (I actually sent this earlier, but received an service unavailable error- I apologize if I'm repeating myself...again :) cheers, -Robert |
|
From: Adam B. <ada...@gb...> - 2001-01-08 23:38:52
|
You are very much on the right track. This is an FAQ: FAQ index: http://jython.sourceforge.net/cgi-bin/faqw.py?req=index 3.3. I'm trying to execute a 'protected' or 'private' Java Instance Method or attribute in a Java package. How can I get access? By default, as in Java, these methods are protected from external access, but there may be reasons, such as test scaffolding scripts, that this feature is not wanted. In the [jython home]/registry file: # Setting this to false will allow Jython to provide access to # non-public fields, methods, and constructors of Java objects. python.security.respectJavaAccessibility = false --- If you want to leave respectJavaAccessibility = true, could you inherit from java.util.Calendar and expose the functionality that way? It may require adding a public method that simply does return self.x() Hope this helps Adam Burke www.gbst.com Garcia, Michael wrote: > > I am trying to call a protected method in the java.util.Calendar class > and am getting: > > >>> l = cal.getTimeInMillis() > Traceback (innermost last): > File "<console>", line 1, in ? > AttributeError: getTimeInMillis > > Why am I getting this AttributeError? I suspect that it has to do with > python.security.respectJavaAccessibility = true. Do I have to set it to > false to get this to work or am I missing something so that I can leave > respectJavaAccessibility set to true? > > thank you, > Mick |
|
From: Garcia, M. <mg...@Bu...> - 2001-01-08 17:38:02
|
I am trying to call a protected method in the java.util.Calendar class and am getting: >>> l = cal.getTimeInMillis() Traceback (innermost last): File "<console>", line 1, in ? AttributeError: getTimeInMillis Why am I getting this AttributeError? I suspect that it has to do with python.security.respectJavaAccessibility = true. Do I have to set it to false to get this to work or am I missing something so that I can leave respectJavaAccessibility set to true? thank you, Mick |
|
From: <bc...@wo...> - 2001-01-08 15:24:42
|
On Mon, 8 Jan 2001 14:06:02 +0100, you wrote: >Hello, >I have a small question. >A standard Jython installation uses some information from the Jython >registry-file. >If I embedd the Jython interpreter in a application, the registry file will >might not be accessible any more. Instead you can manually initialize the jython runtime by calling PySystemState.initialize(preProperties, postProperties, argv): - preProperties is useally System.getProperties(). - postProperties can be a java.util.Properties with your own property values. - argv will be copied to sys.argv >So is the registryfile executed as a python script, >or is it read in as a java.util.Properties table? Both registry files (<python.home>/registry & <user.home>/.jython) are java.util.Properties files. >Can I place Jython command in there? No. >Can I reread the registry file? No. You can't meaningfully modify the sys.registry object either. After the property files are read (and merged with Properties arguments to PySystemState.initialize()) the static fields in org.python.core.Options is initialized. The rest of the jython runtime are looking at these fields when it needs some configuration information. >if yes How can I do that? > >Assume I have multiple interpreter embedded in one JVM. Do they all share >the same registry information? They all share the static values of the org.python.core.Options fields. regards. finn |
|
From: Schmidmeier, A. <Arn...@si...> - 2001-01-08 12:59:22
|
Hello, I have a small question. A standard Jython installation uses some information from the Jython registry-file. If I embedd the Jython interpreter in a application, the registry file will might not be accessible any more. So is the registryfile executed as a python script, or is it read in as a java.util.Properties table? Can I place Jython command in there? Can I reread the registry file? if yes How can I do that? Assume I have multiple interpreter embedded in one JVM. Do they all share the same registry information? Thanks Arno Schmidmeier *********************************************************************** * *********************************************************************** Arno Schmidmeier Sirius Software GmbH Kolpingring 18 82041 Oberhaching Tel. 089/6136760 E-Mail Arn...@si... Fax 089/61367633 Internet www.sirius-eos.com |
|
From: <bc...@wo...> - 2001-01-07 20:42:33
|
[brian zimmer]
>I was trying to use the following syntax in Jython but I get an exception:
>
>>>> t = {}
>>>> exec open(filename) in t
>
>Traceback (innermost last):
> File "install.py", line 381, in ?
> File "install.py", line 47, in run
> File "install.py", line 71, in detectComponents
> File "install.py", line 89, in readProperties
>TypeError: exec: argument 1 must be string or code object
>
>This works in CPython and appears to be part of the spec:
>
>"The first expression should evaluate to either a string, an open file
>object, or a code object. ... If it is an open file, the file is parsed
>until EOF and executed."
>
>http://python.org/doc/current/ref/exec.html
Yep, and jython should support this as well.
>Additionally, in CPython 2.0, if the file is closed it is re-opened and
>executed.
I can't reproduce this behaviour in CPython 2.0. Instead it appears that
CPython treats a closed file as an empty file (no exception is thrown).
Do you have an example that show that the file is reopened?
>Given this, I've enclosed a working diff which mimics the exact behaviour of
>CPython 2.0.
If I'm correct regarding the reopen thing, I would rather do something
like:
if (fp.closed)
return;
contents = fp.read().toString();
to avoid the "I/O operation on closed file" exception.
regards,
finn
|
|
From: brian z. <bz...@zi...> - 2001-01-07 14:43:36
|
I was trying to use the following syntax in Jython but I get an exception:
>>> t = {}
>>> exec open(filename) in t
Traceback (innermost last):
File "install.py", line 381, in ?
File "install.py", line 47, in run
File "install.py", line 71, in detectComponents
File "install.py", line 89, in readProperties
TypeError: exec: argument 1 must be string or code object
This works in CPython and appears to be part of the spec:
"The first expression should evaluate to either a string, an open file
object, or a code object. ... If it is an open file, the file is parsed
until EOF and executed."
http://python.org/doc/current/ref/exec.html
Additionally, in CPython 2.0, if the file is closed it is re-opened and
executed.
I also tested whether StringIO could be substited for a file and it appears
to fail:
>>> from StringIO import StringIO
>>> s = StringIO("a = 'x'")
>>> s
<StringIO.StringIO instance at 007E1C1C>
>>> t = {}
>>> exec s in t
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: exec 1st arg must be string, code or file object
>>>
Given this, I've enclosed a working diff which mimics the exact behaviour of
CPython 2.0.
thanks,
brian
|
|
From: Gurunath R. (EWU) <EW...@am...> - 2001-01-04 20:48:27
|
Hi, I am developing a scripting interface and one major roadblock to using Jython seems to be the lack of static functions in jython classes. It would be good if this can be incorporated in future jython releases. Thanks, Guruunath R Gurunath R. (858) 332 6263 |
|
From: <bc...@wo...> - 2001-01-04 18:48:23
|
>> I just hoped there were a better way. Does any know if there is? > >I have not tried this but is it not possible to achieve the same >through the Class reflection methods: > getClasses > getDeclaredClasses > and getDeclaringClass? >They are all since 1.1 and seem at first sight to do the needed things. Yes, the name of getDeclaringClass() will allow me to recreate a compiler friendly version of the innerclass name. Thanks. regards, finn |
|
From: Samuele P. <pe...@in...> - 2001-01-04 18:29:15
|
Hi. > I have made a patch which will retrieve the class as a resource and > parse the bytecode to find the "InnerClasses" attributes. From the > "InnerClasses" that correspond to this_class, I can get the outerclass > and the innerclass names. > > I just hoped there were a better way. Does any know if there is? I have not tried this but is it not possible to achieve the same through the Class reflection methods: getClasses getDeclaredClasses and getDeclaringClass? They are all since 1.1 and seem at first sight to do the needed things. regards, Samuele Pedroni. |
|
From: <bc...@wo...> - 2001-01-04 15:54:45
|
[Seshu Nimmala] >However, since the glob module doesn't form part of jython.jar, how could this >be supplied to user/customer (not that I'm intending, but just curious to know!) The usual way is by using some kind of installer (InstallShield, Wyse, LiftOff, ...) and copy the required python modules to the custumer computer. Perhaps you can also use jythonc to freeze the application with the --deep option. All dependent modules will then be frozen together with the application and can be placed in a .jar file. regards, finn |
|
From: <bc...@wo...> - 2001-01-04 15:13:16
|
[In a bug report we got:]
>For example. If jython class Log inherits javax.swing.text.PlainDocument
>we get this code:
>
>public javax.swing.text.AbstractDocument$AbstractElement
>createDefaultRoot() {
> return super.createDefaultRoot();
where the '$' in the inner class name confuses the java compiler in
JDK1.3. Does anyone know how we can get a more compiler friendly class
name (When replacing the '$' with a '.', even JDK1.3 is happy). Keep in
mind that a $ is valid (if somewhat unlikely) character in class names.
I have made a patch which will retrieve the class as a resource and
parse the bytecode to find the "InnerClasses" attributes. From the
"InnerClasses" that correspond to this_class, I can get the outerclass
and the innerclass names.
I just hoped there were a better way. Does any know if there is?
regards,
finn
|
|
From: Seshu N. <Ses...@sd...> - 2001-01-04 01:51:49
|
Robert,
Thank you very much for suggesting more than one way to solve this issue.
As you rightly guessed, I moved the jar file elsewhere and .py files in
installed lib directory are not seen by the Interpreter. Copying the lib files
(such as glob.py) into right location solved the problem!
Your code examples are really good to understand the issue.
However, since the glob module doesn't form part of jython.jar, how could this
be supplied to user/customer (not that I'm intending, but just curious to know!)
Thanks,
Seshu
"Robert W. Bill" wrote:
> Seshu Nimmala wrote:
> > Thanks finn. I downloaded the latest jython-2.0b1 and it
> > imports the glob/re modules as stand-alone execution (at
> > command line).
> >
> > However, the glob module still cannot be imported when tried
> > as below in Java code:
> > Is there any special command to be used or something like
> > special setting for PYTHONPATH or someother env
> > variables to be used to run this Java source:
> > Any help will be appreciated.
> > Thanks.
> > __________________________________________
> > import org.python.util.PythonInterpreter;
> > import org.python.core.*;
> > import java.util.*;
> >
> > public class
> > PythonInterpreterTest{
> > PythonInterpreter interp =
> > new PythonInterpreter();
> > public void test() throws PyException {
> > :
> > interp.exec("import glob"); //Cannot import glob here
> > interp.exec("files = glob.glob('*.java')");
> > }
> > }
> > __________________________________________________
>
> Hello Seshu,
> I tried a slightly modified version of your code
> and it worked fine (in jython-2.0b1). Here's what I used:
> ==========================================================
> import org.python.util.PythonInterpreter;
> import org.python.core.*;
>
> public class
> test{
> public static void main(String[] args) throws PyException {
> PythonInterpreter interp =
> new PythonInterpreter();
> interp.exec("import glob");
> interp.exec("files = glob.glob('*.java')");
> interp.exec("print files");
> }
> }
> ===========================================================
> When I run this I get the output:
> ['test.java']
>
> I'm curious what happens when you run something like this:
> ==========================================================
> import org.python.util.PythonInterpreter;
> import org.python.core.*;
>
> public class
> test{
> public static void main(String[] args) throws PyException {
> PythonInterpreter interp =
> new PythonInterpreter();
> interp.exec("import sys");
> interp.exec("print sys.path");
> }
> }
> ===============================================================
>
> For me, I get the following path, which is good because that is where
> glob.py is:
> ['.', '/usr/local/jython-2.0b1/Lib']
>
> This is just a guess, but I suspect that this path will be wrong for
> you. Could you have moved jython.jar out of it's installation
> directory? You can try running your test with-
> "java -Dpython.home=/path/to/jythondir test"
>
> You can guaruntee that this path is correct by initializing a sys.path
> list in your java file. This example is from Finn Bock (tnx Finn for
> your amazing work)-
>
> Properties props = new Properties();
> props.setProperty("python.path", "/home/modules:scripts");
> PySystemState.initialize(System.getProperties(), props,
> new String[] {""});
>
> The value for python.path must follow the operating system conventions
> for the PATH environment var (':' separator for unix, ';' for windows)
>
> regards,
> Robert
|
|
From: Robert W. B. <rb...@di...> - 2001-01-04 00:26:37
|
Seshu Nimmala wrote:
> Thanks finn. I downloaded the latest jython-2.0b1 and it
> imports the glob/re modules as stand-alone execution (at
> command line).
>
> However, the glob module still cannot be imported when tried
> as below in Java code:
> Is there any special command to be used or something like
> special setting for PYTHONPATH or someother env
> variables to be used to run this Java source:
> Any help will be appreciated.
> Thanks.
> __________________________________________
> import org.python.util.PythonInterpreter;
> import org.python.core.*;
> import java.util.*;
>
> public class
> PythonInterpreterTest{
> PythonInterpreter interp =
> new PythonInterpreter();
> public void test() throws PyException {
> :
> interp.exec("import glob"); //Cannot import glob here
> interp.exec("files = glob.glob('*.java')");
> }
> }
> __________________________________________________
Hello Seshu,
I tried a slightly modified version of your code
and it worked fine (in jython-2.0b1). Here's what I used:
==========================================================
import org.python.util.PythonInterpreter;
import org.python.core.*;
public class
test{
public static void main(String[] args) throws PyException {
PythonInterpreter interp =
new PythonInterpreter();
interp.exec("import glob");
interp.exec("files = glob.glob('*.java')");
interp.exec("print files");
}
}
===========================================================
When I run this I get the output:
['test.java']
I'm curious what happens when you run something like this:
==========================================================
import org.python.util.PythonInterpreter;
import org.python.core.*;
public class
test{
public static void main(String[] args) throws PyException {
PythonInterpreter interp =
new PythonInterpreter();
interp.exec("import sys");
interp.exec("print sys.path");
}
}
===============================================================
For me, I get the following path, which is good because that is where
glob.py is:
['.', '/usr/local/jython-2.0b1/Lib']
This is just a guess, but I suspect that this path will be wrong for
you. Could you have moved jython.jar out of it's installation
directory? You can try running your test with-
"java -Dpython.home=/path/to/jythondir test"
You can guaruntee that this path is correct by initializing a sys.path
list in your java file. This example is from Finn Bock (tnx Finn for
your amazing work)-
Properties props = new Properties();
props.setProperty("python.path", "/home/modules:scripts");
PySystemState.initialize(System.getProperties(), props,
new String[] {""});
The value for python.path must follow the operating system conventions
for the PATH environment var (':' separator for unix, ';' for windows)
regards,
Robert
|
|
From: Seshu N. <ses...@sd...> - 2001-01-03 22:56:56
|
Thanks finn. I downloaded the latest jython-2.0b1 and it
imports the glob/re modules as stand-alone execution (at
command line).
However, the glob module still cannot be imported when tried
as below in Java code:
Is there any special command to be used or something like
special setting for PYTHONPATH or someother env
variables to be used to run this Java source:
Any help will be appreciated.
Thanks.
__________________________________________
import org.python.util.PythonInterpreter;
import org.python.core.*;
import java.util.*;
public class
PythonInterpreterTest{
PythonInterpreter interp =
new PythonInterpreter();
public void test() throws PyException {
:
interp.exec("import glob"); //Cannot import glob here
interp.exec("files = glob.glob('*.java')");
}
}
__________________________________________________
[Seshu Nimmala]
>I'm not able to import "glob" module or "re" module for use in jython.
>I'm using jython-2.0a2.
>Is it a bug or a current limitation?
It was a bug in alpha2. The re.py from CPython2.0 wasn't included in the
installer. It is fixed in beta1.
regards,
finn
>
|
|
From: <bc...@wo...> - 2001-01-03 20:55:30
|
[Seshu Nimmala] >I'm not able to import "glob" module or "re" module for use in jython. >I'm using jython-2.0a2. >Is it a bug or a current limitation? It was a bug in alpha2. The re.py from CPython2.0 wasn't included in the installer. It is fixed in beta1. regards, finn |
|
From: Ivan K. <iv...@ko...> - 2001-01-03 20:48:12
|
speaking of unsupported modules.. prior to the release of the final version of jython, it would be nice to have a list of all of the supported modules. Also, it would be great to somehow coordinate the integration/functionality/unit testing of those modules, or at least to see a list of modules that have been or haven't been tested. Thanks, _I -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of Seshu Nimmala Sent: Wednesday, January 03, 2001 12:14 PM To: jyt...@li... Cc: ses...@sd... Subject: [Jython-dev] Jython glob/re modules Hi, I'm not able to import "glob" module or "re" module for use in jython. I'm using jython-2.0a2. Is it a bug or a current limitation? Thanks, Seshu _______________________________________________ Jython-dev mailing list Jyt...@li... http://lists.sourceforge.net/mailman/listinfo/jython-dev |