What is the RIGHT way to patch python modules for jython?

Martin von Loewis loewis at informatik.hu-berlin.de
Mon Jan 7 12:40:08 EST 2002


Steve Cohen <cohsteve at attbi.com> writes:

> 1)  What is the RIGHT way to patch python modules to allow special hooks 
> needed for jython?  I assume the import statements must be within 
> conditionals, right?  

Right. It would be even more desirable if you can find changes that
make cmd work out of the box, such as introducing a readline module in
Jython.

> Anything else I need to be aware of?  Code samples?

Just grep the standard library for "java".

> 2)  Jython works by referring to a registry file.  Does python also do 
> this?  If not, is there a way to independently reference system 
> properties regardless of whether they come from a registry file, 
> enviroment variables, or some other source?

What do you mean by registry file? How is that related to the cmd.py
changes?

In general, you give the source of configuration information when
accessing it, e.g. os.environ, or _winreg. So if you want to read Java
properties, you should specify them explicitly. You couldn't confuse
them with environment names, anyway, since they have completely
different conventions.

Regards,
Martin



More information about the Python-list mailing list