From: Charlie G. <cha...@gm...> - 2009-09-04 07:41:58
|
On Fri, Sep 4, 2009 at 12:24 AM, Thomas Mortagne<tho...@xw...> wrote: > On Fri, Sep 4, 2009 at 08:44, Charlie Groves<cha...@gm...> wrote: >> >> That should be enabled by default. As of 2.5.0, Jython adds >> __pyclasspath__/ to sys.path, and that serves as a PEP 302 import hook >> to tell it to look for .py and $py.class files on the classpath. As >> long as you have a jar containing those .py files in its root on the >> classpath, Jython should load them. If that isn't the case, filing a >> bug at bugs.jython.org would be appreciated. > > Ok for simple standalone .py files but something like Pygments has sub modules > > - pygments > -- filters > -- formatters > -- lexers > -- styles > > And i can't put all the .py files in the root since each folder > contains a __init__.py files (sorry for maybe dumb questions I'm > really not a Python expert). I'm sorry, I wasn't clear about what I said to put at the root. Put that whole pygments directory structure in the jar file. If you're in the directory with pygments in it, "jar cf pygments.jar pygments" would do the trick. The same holds for the compiled version. compileall.py will put the $py.class files in the proper place in that directory structure. If you make the jar after that, the compiled versions will be used in preference to the source versions. Charlie |