Update build_GrampsWin32.py Popen commands to use .communicate()

svn: r19720
This commit is contained in:
Stephen George 2012-05-31 04:35:23 +00:00
parent 83099375e3
commit e5a9d652fa

View File

@ -102,13 +102,8 @@ class buildbase(gobject.GObject):
log.debug( "Running: %s" % cmd ) log.debug( "Running: %s" % cmd )
proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
status = proc.wait() (out, err) = proc.communicate()
output = string.strip(proc.stdout.read()) output = string.strip(out)
err = proc.stderr.read()
proc.stderr.close()
proc.stdout.close()
del proc
log.debug( output ) log.debug( output )
if err: if err:
for line in err.split('\n'): for line in err.split('\n'):
@ -130,13 +125,8 @@ class buildbase(gobject.GObject):
log.info( "Running: %s" % cmd) log.info( "Running: %s" % cmd)
proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
status = proc.wait() (out, err) = proc.communicate()
output = string.strip(proc.stdout.read()) output = string.strip(out)
err = proc.stderr.read()
proc.stderr.close()
proc.stdout.close()
del proc
log.info( output ) log.info( output )
if err: if err:
log.error(err) log.error(err)
@ -186,13 +176,8 @@ class buildbase(gobject.GObject):
os.environ['GRAMPS_OUT_DIR'] = os.path.abspath(self.out_dir) os.environ['GRAMPS_OUT_DIR'] = os.path.abspath(self.out_dir)
proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
status = proc.wait() (out, err) = proc.communicate()
output = string.strip(proc.stdout.read()) output = string.strip(out)
err = proc.stderr.read()
proc.stderr.close()
proc.stdout.close()
del proc
log.info( output ) log.info( output )
if err: if err:
log.error(err) log.error(err)
@ -273,13 +258,9 @@ class buildbase(gobject.GObject):
#log.debug( cmd ) #log.debug( cmd )
proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
status = proc.wait() (out, err) = proc.communicate()
output = string.strip(proc.stdout.read()) output = string.strip(out)
err = proc.stderr.read() log.info( output )
proc.stderr.close()
proc.stdout.close()
del proc
# log.debug( output ) Nothing coming out here, statistics come out stderr ?? # log.debug( output ) Nothing coming out here, statistics come out stderr ??
if err: if err:
log.info(err) # statistics comming out stderr log.info(err) # statistics comming out stderr
@ -340,13 +321,9 @@ class buildbase(gobject.GObject):
log.debug(cmd) log.debug(cmd)
proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
status = proc.wait() (out, err) = proc.communicate()
output = string.strip(proc.stdout.read()) output = string.strip(out)
err = proc.stderr.read() log.info( output )
proc.stderr.close()
proc.stdout.close()
del proc
if err: if err:
log.error(err) log.error(err)
if sys.platform == 'win32': #'not recognized' in err: if sys.platform == 'win32': #'not recognized' in err:
@ -384,13 +361,9 @@ class buildbase(gobject.GObject):
cmd = '%s /VERSION' % MAKENSIS_exe cmd = '%s /VERSION' % MAKENSIS_exe
proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
status = proc.wait() (out, err) = proc.communicate()
output = string.strip(proc.stdout.read()) output = string.strip(out)
err = proc.stderr.read() log.info( output )
proc.stderr.close()
proc.stdout.close()
del proc
if err: if err:
log.error(err) log.error(err)
log.error('....makensis.exe not found on path') log.error('....makensis.exe not found on path')
@ -402,13 +375,9 @@ class buildbase(gobject.GObject):
cmd = os.path.join(msg_dir, 'msgfmt.exe') cmd = os.path.join(msg_dir, 'msgfmt.exe')
proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) proc = subprocess.Popen( cmd, shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
status = proc.wait() (out, err) = proc.communicate()
output = string.strip(proc.stdout.read()) output = string.strip(out)
err = proc.stderr.read() log.info( output )
proc.stderr.close()
proc.stdout.close()
del proc
if not err.startswith(cmd): if not err.startswith(cmd):
#log.error(err) #log.error(err)
log.error('msgfmt.exe not found on path') log.error('msgfmt.exe not found on path')