diff --git a/gui/Gui/Makeimage.py b/gui/Gui/Makeimage.py index daae2cd..c0d5a8f 100644 --- a/gui/Gui/Makeimage.py +++ b/gui/Gui/Makeimage.py @@ -25,10 +25,12 @@ import wx import os import sys +from subprocess import Popen, PIPE #--------------------------------------------------------------------------- """ Import scyther components """ +from Scyther import Misc as MiscScyther """ Import scyther-gui components """ import Temporary @@ -126,22 +128,23 @@ def makeImageDot(dotdata,attackthread=None): (fd2,fpname2) = Temporary.tempcleaned(ext) f = os.fdopen(fd2,'w') + # Set up command cmd = "dot -T%s" % (type) # execute command - cin,cout = os.popen2(cmd,'b') + p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE) if attackthread: - writeGraph(attackthread,dotdata,cin) + writeGraph(attackthread,dotdata,p.stdin) else: - cin.write(dotdata) + p.stdin.write(dotdata) - cin.close() + p.stdin.close() - for l in cout.read(): + for l in p.stdout.read(): f.write(l) - cout.close() + p.stdout.close() f.flush() f.close() diff --git a/gui/Gui/Misc.py b/gui/Gui/Misc.py index be161d3..0ee4a82 100644 --- a/gui/Gui/Misc.py +++ b/gui/Gui/Misc.py @@ -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():