You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by aj...@apache.org on 2005/03/21 19:20:05 UTC
svn commit: r158497 - in gump/trunk/python/gump: core/language/java.py
util/process/launcher.py
Author: ajack
Date: Mon Mar 21 10:20:05 2005
New Revision: 158497
URL: http://svn.apache.org/viewcvs?view=rev&rev=158497
Log:
Capture stdout on Linux (with new invoke mechanism)
Modified:
gump/trunk/python/gump/core/language/java.py
gump/trunk/python/gump/util/process/launcher.py
Modified: gump/trunk/python/gump/core/language/java.py
URL: http://svn.apache.org/viewcvs/gump/trunk/python/gump/core/language/java.py?view=diff&r1=158496&r2=158497
==============================================================================
--- gump/trunk/python/gump/core/language/java.py (original)
+++ gump/trunk/python/gump/core/language/java.py Mon Mar 21 10:20:05 2005
@@ -233,9 +233,9 @@
if ( ( ( 1 == depth ) and \
(inherit in [ gump.core.model.depend.INHERIT_ALL, gump.core.model.depend.INHERIT_HARD ]) \
or \
- (inherit==gump.core.model.depend.INHERIT_RUNTIME and subdependency.isRuntime()) ) \
+ (inherit == gump.core.model.depend.INHERIT_RUNTIME and subdependency.isRuntime()) ) \
or \
- ( inherit == gump.core.model.depend.INHERIT_OUTPUTS ) ) :
+ ( inherit in [ gump.core.model.depend.INHERIT_OUTPUTS ] ) ) :
(subcp, subbcp) = self._getDependOutputList(project,subdependency,visited,depth+1,debug)
self._importClasspaths(classpath,bootclasspath,subcp,subbcp)
elif debug:
Modified: gump/trunk/python/gump/util/process/launcher.py
URL: http://svn.apache.org/viewcvs/gump/trunk/python/gump/util/process/launcher.py?view=diff&r1=158496&r2=158497
==============================================================================
--- gump/trunk/python/gump/util/process/launcher.py (original)
+++ gump/trunk/python/gump/util/process/launcher.py Mon Mar 21 10:20:05 2005
@@ -63,6 +63,8 @@
f = open(execFile, 'w')
# The CMD
f.write( 'CMD: %s\n' % (execString))
+ # The OUTPUT
+ f.write( 'OUTPUT: %s\n' % (outputFile))
# Dump the TMP
if tmp: f.write( 'TMP: %s\n' % (tmp))
# Dump the cwd (if specified)
@@ -133,7 +135,7 @@
else:
# Run another python process (to crap into it's ENV not the main, multi-threaded, one.)
- fullExec = sys.executable + ' ' + LAUNCHER + ' ' + execFile + ' >>' + str(outputFile) + ' 2>&1'
+ fullExec = sys.executable + ' ' + LAUNCHER + ' ' + execFile
#log.debug('Executing: ' + execString)
#log.debug(' Exec: ' + str(execFile))
@@ -233,6 +235,7 @@
# print 'KEY : ' + key + ' -> ' + execInfo[key]
cmd = execInfo['CMD']
+ outputFile = execInfo['OUTPUT']
cwd = None
if execInfo.has_key('CWD'): cwd = execInfo['CWD']
tmp = execInfo['TMP']
@@ -261,6 +264,9 @@
timer.setDaemon(1)
timer.start()
+ # Allow redirect
+ cmd += ' >>' + str(outputFile) + ' 2>&1'
+
# Run the command
systemReturn = os.system(cmd)
Windows
Posted by Leo Simons <ma...@leosimons.com>.
On 22-03-2005 04:36, "Adam R. B. Jack" <aj...@apache.org> wrote:
>> You know, we should really investigate using popen...
>>
>> http://docs.python.org/lib/module-popen2.html
>
> The main reason this is all a mess, and I'm not using the nice/simple posix
> functions is I couldn't find a portable (to windows) mechanism to pass
> environment (e.g. CLASSPATH) in a thread safe way. Basically it is the
> windows side of Python that makes this ugly. That and I've tinkered so many
> times that I'm sick of looking at it again! ;-) Let's see how this iteration
> takes, and perhaps I'll get inspired to look at it all w/ a 'fresher' pair
> of eyes.
Ed Korthoff suggested that we implement stuff like this twice, once for
posix, and once using the win32 api, since apparently that's the only way to
those things cleanly. The advantage there is that we can look at how various
portable C programs do it (ie httpd), since the python functionality there
is just a very thin wrapper or glue library to the native functionality.
I dunno. I don't know a whole lot about any of this yet, I'm just relaying
advice ;-)
Cheers,
Leo
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org
Re: svn commit: r158497 - in gump/trunk/python/gump: core/language/java.py util/process/launcher.py
Posted by "Adam R. B. Jack" <aj...@apache.org>.
> You know, we should really investigate using popen...
>
> http://docs.python.org/lib/module-popen2.html
>
The main reason this is all a mess, and I'm not using the nice/simple posix
functions is I couldn't find a portable (to windows) mechanism to pass
environment (e.g. CLASSPATH) in a thread safe way. Basically it is the
windows side of Python that makes this ugly. That and I've tinkered so many
times that I'm sick of looking at it again! ;-) Let's see how this iteration
takes, and perhaps I'll get inspired to look at it all w/ a 'fresher' pair
of eyes.
regards
Adam
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org
Re: svn commit: r158497 - in gump/trunk/python/gump:
core/language/java.py util/process/launcher.py
Posted by Leo Simons <ma...@leosimons.com>.
You know, we should really investigate using popen...
http://docs.python.org/lib/module-popen2.html
Cheers!
- Leo
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org