Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2007-05-31 11:42:54 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2007-05-31 11:42:54 +0400
commit1badf04923cfbe0007a7497ee9085ca732d19d4e (patch)
tree19edd8b3b0cdbef787854162807b880e449a485f /tools
parent270ab2fe18889616355a6c69e1905c32cf11df7f (diff)
=== SCons ===
FINALLY! With this commit command-length problems are History. Thanks go to xuru from #scons for giving the nice pointer. src is now again one lib, and further libsplitting should be rather unnecessary, unless we somehow reach the 37K limit (for internally used CreateProcess, by subprocess module)
Diffstat (limited to 'tools')
-rwxr-xr-xtools/btools.py53
1 files changed, 24 insertions, 29 deletions
diff --git a/tools/btools.py b/tools/btools.py
index fba884ed09b..cf936a95e26 100755
--- a/tools/btools.py
+++ b/tools/btools.py
@@ -1,7 +1,9 @@
-import sys
-import StringIO
+import os
+import os.path
import SCons.Options
import SCons.Options.BoolOption
+import subprocess
+import string
Options = SCons.Options
BoolOption = SCons.Options.BoolOption
@@ -84,33 +86,26 @@ def validate_targets(targs, bc):
print '\t'+bc.WARNING+'Invalid target: '+bc.ENDC+t
return oklist
-
-
-class idBuffering:
- def buffered_spawn( self, sh, escape, cmd, args, env ):
- stderr = StringIO.StringIO()
- stdout = StringIO.StringIO()
- command_string = ''
- for i in args:
- if ( len( command_string ) ):
- command_string += ' '
- command_string += i
- try:
- retval = self.env['PSPAWN']( sh, escape, cmd, args, env, stdout, stderr )
- except OSError, x:
- if x.errno != 10:
- raise x
- print 'OSError ignored on command: %s' % command_string
- retval = 0
- sys.stdout.write( stdout.getvalue() )
- sys.stderr.write( stderr.getvalue() )
- return retval
-
-# get a clean error output when running multiple jobs
-def SetupBufferedOutput( env ):
- buf = idBuffering()
- buf.env = env
- env['SPAWN'] = buf.buffered_spawn
+class ourSpawn:
+ def ourspawn(self, sh, escape, cmd, args, env):
+ newargs = string.join(args[1:], ' ')
+ cmdline = cmd + " " + newargs
+ startupinfo = subprocess.STARTUPINFO()
+ startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+ proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False)
+ data, err = proc.communicate()
+ rv = proc.wait()
+ if rv:
+ print "====="
+ print err
+ print "====="
+ return rv
+
+def SetupSpawn( env ):
+ buf = ourSpawn()
+ buf.ourenv = env
+ env['SPAWN'] = buf.ourspawn
def read_opts(cfg, args):