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
......@@ -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)
p=subprocess.Popen(kat_exec, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
cmd.append('--perf-timing')
cmd.append('--no-backspace')
cmd.append(katfile.name)
p=subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
err = ""
for line in iter(p.stderr.readline, ""):
......@@ -500,4 +499,4 @@ class kat(object):
setattr(self, '__comp_' + comp.name, comp)
def __get_component(self, name):
return getattr(self, '__comp_' + name)
\ No newline at end of file
return getattr(self, '__comp_' + name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment