Is the problem that you have some jython specific stuff in some modules
imported from cpython? I keep all my files in the same directory
structures for both implementations and either don't import jython only
modules into cpython or use:
if os.name == 'java':
to keep the jython code from causing problems if imported into cpython.
The other approach is to write wrappers around any implementation (c/j)
differences and just use the wrapper which would be coded to import the
correct implementations depending on the interpreter in use. Take a
look at Lib/dbexts.py for an example of an mxODBC/zxJDBC wrapper.
I hope this helps at a least a little.
> -----Original Message-----
> From: jython-users-admin@...
> [mailto:jython-users-admin@...] On Behalf
> Of Ed Korthof
> Sent: Friday, October 25, 2002 7:13 PM
> To: jython-users@...
> Subject: [Jython-users] mixed python and jython use -- where
> to put jython libs?
> Hi --
> We're using both python and jython in our application.
> Obviously, we can use the python code from within jython
> code; but we can't use jython code from within python.
> We tried separating things so that we had:
> (with empty __init__.py files in both package) -- but that
> doesn't work because jython respects python's logic about how
> modules within a package can be written to disk. You can't
> have a package split in two different directories ...
> Anyway, the solutions we're considering are putting all our
> jython files into the same directory structure as the python
> files, or putting them within a different namespace -- something like:
> (we'd then do imports for the jython code as import
> foo.jython.bang and the like.)
> I'm curious -- does anyone else have suggestions as to a
> clean solution for this? The former approach (combining all
> the .py files) seems problematic in that many of them are not
> usable from within python; and the latter seems problematic
> in the package names it produces. (We can't start with
> jython -- that package already exists...)
> thanks --
> This SF.net email is sponsored by: ApacheCon, November 18-21
> in Las Vegas (supported by COMDEX), the only Apache event to
> be fully supported by the ASF. http://www.apachecon.com
> Jython-users mailing list