Skip to content
Snippets Groups Projects
Commit db500256 authored by Andreas Freise's avatar Andreas Freise
Browse files

fixing a number of subtle errors which kept this from running on my machine,...

fixing a number of subtle errors which kept this from running on my machine, such as temporary file without name, subprocess call with encapsualted flags.
parent 14d52205
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ class kat(object):
def loadKatFile(self, katfile):
with open(katfile) as f:
parseCommands(f.readlines())
self.parseCommands(f.readlines())
def parseCommands(self, commands):
blockComment = False
......@@ -197,18 +197,17 @@ class kat(object):
raise MissingFinesse()
# create a kat file which we will write the script into
katfile = tempfile.TemporaryFile(suffix=".kat")
katfile = tempfile.NamedTemporaryFile(suffix=".kat")
katfile.writelines(r.katScript)
katfile.flush()
flags = "--perl1 "
cmd=[kat_exec, '--perl1']
if self.__time_code:
flags = flags + " --perf-timing --no-backspace"
kat_exec = "{0} {1} {2}".format(kat_exec, flags, katfile.name)
cmd.append('--perf-timing')
cmd.append('--no-backspace')
p=subprocess.Popen(kat_exec, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
cmd.append(katfile.name)
p=subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
err = ""
for line in iter(p.stderr.readline, ""):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment