From: Phil S. <psu...@es...> - 2002-03-05 14:42:00
|
Actually, there is some hope for chdir in the JPE project. I finally got this to build last week (the stable-beta-7 build) and my second test was to see if I could use it to chdir from java by calling chdir in python. IIRC it worked. Building JPE was a bear but I have been corresponding with Frederic and he tells me the head CVS version (at least as of about last Tuesday) uses a new, cleaner build system. An unholy marriage of jython and JPE might bring interesting results in the future. For instance, a new os module similar to jnios could be implemented by delegating problematic calls to the CPython os module. Or, less seamlessly, you could just Another option is to use JPE instead of Jython, but as far as I can tell, JPE is much less seamless than jython; I doubt you'd want to trade jython for JPE in most cases, but if you are tring to write 'scripty' stuff using JPE directly would be great. -----Original Message----- From: Dinu Gherman [mailto:gh...@da...] Sent: Tuesday, February 26, 2002 10:46 AM To: Finn Bock Cc: jyt...@li... Subject: Re: [Jython-users] OSError: [Errno 0] chdir not supported in Java? Finn Bock <bc...@wo...>: > As Samuele has explained, we can't do a chdir in 100% java and we will > *never* include JNI code with the jython distribution. Thanks for the clarification! I got the same explanation from Samuele over private email. Thanks, Samuele! > But we could (as we already do for the readline module) include support > code that require the presence of a JNI module to work. So if anybody > needed chdir() or chmod() or the full stat() values badly enough, she > could create a copy of the javaos.py module that used one of the JNI > module (there are several such candidates). > > We could then add a mechanisme to jython (in the registry) that allowed > users to choose either the existing 100% pure java version of "os" or > one the JNI alternatives. > > The fact that I haven't maintained jnios for quite a while should be a > good indication that I don't need chdir() myself. I'll check soon if I really need chdir or if I can replace it somehow... In fact, what I'm trying to do is port the ReportLab toolkit to Jython, and chdir is what seems to prevent the test suite (and some tools and demos) from working. So, my frustration is maybe more with Java than with Jython and surely I should have better investigated the issues instead of showing my Java ignorance. Sorry for that! What I'd suggest is some sort of collection of "porting stories" (Python to Jython) and/or issues to expect when doing this kind of thing. I'm not sure the FAQ is the best place for that, but maybe I'm wrong. OTOH, maybe it is too much to ask from Python programmers to code in a Jython-friendly way? Well, at least it would be helpful to know where to expect potential pitfalls. What do people think? The good news is that many parts of ReportLab seem to be working ok, especially the vector graphics stuff (after fixing the list builtin function)! Regards, Dinu _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |