Updated image construction code to also use subprocess.Popen.

This commit is contained in:
Cas Cremers
2010-05-16 00:13:33 +02:00
parent 1f75f73cb0
commit d1b334765b
2 changed files with 13 additions and 7 deletions

View File

@@ -25,6 +25,7 @@
""" Import externals """
import os.path
from subprocess import Popen,PIPE
#---------------------------------------------------------------------------
@@ -70,7 +71,9 @@ def cmdpushwrite(cmd,data,fname):
"""
fp = open(fname,'w')
# execute command
cin,cout = os.popen2(cmd,'b')
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE)
(cin,cout) = (p.stdin, p.stdout)
cin.write(data)
cin.close()
for l in cout.read():