|
From: Phil S. <psu...@es...> - 2001-11-01 15:33:24
|
Yeah, I'm doing that. I'm writing three tasks: 1) a jython task. This is like the ant <script> task but it has several improvements: - handles indented jython scripts. - massages stack traces to make line numbers relative to the ant build file, rather than relative to the start of the script within the build file - auto-imports some packages (right now, os, os.path, sys, string, re) - interetes to hear if others think this is a good/evil feature - saves typing <jython> vs <script language="jpython"> The jython task is working. 2) jythonc task - haven't started yet, hopefully tonight. 3) jytaskdef task - define an ant task from within an ant build file. You write some jython code with (at the minimum) an execute(self) method; this code gets embedded in a jython class that extends org.apache.an.main.Task; this gets compiled with jythonc; then the task is defined and available everywhere in the build script. I do not expect that the ant developers will like/want to maintain task #3... however I think it will be very useful. Anyway, I'll submit the tasks to the jython group when they're ready. -----Original Message----- From: bc...@wo... [mailto:bc...@wo...] Sent: Thursday, November 01, 2001 10:14 AM To: jyt...@li... Subject: Re: [Jython-dev] jythons module os [Phil Surette] >I was hoping to do a lazy initialization thing. > >I'm open to suggestions as to how to do it... >I haven't actually written anything yet and I'm working >on writing some jython tasks for ant first. On that note, if anyone feels like writing an ant task to invoke the jythonc compiler it would be quite a usefull. >My thoughts were to create a class that implements all the >dictionary things - __getitem__ etc - and populate >the dictionary the first time any of these are called. Good. Maybe we should add a system property to completely disable all attempt to fill os.environment. I can image there is environments where a security manager does not allow calls to Runtime.exec(). >By cribbing from ant I should be able to put in support >for a read-only environment for unices and win32. That's fine for a start. Beyond win&unix we have to let users send patches for their own platforms anyway. Does anyone know how ant decide that it is running on unix? >I haven't thought writing through yet, but I figure >reading will hit a large percentage of the use cases. Writing is normally done by inserting values in the os.environment dict and using that dict for the os.system() call. We can't possibly do any better in core jython. regards, finn _______________________________________________ Jython-dev mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-dev |