self.engines = list()
self.script = list()
self.files = dict()
+ self.verbatim_files = dict()
self.models = dict()
self.workdir = workdir
self.status = "UNKNOWN"
with open(filename, "r") as f:
for line in f:
+ raw_line = line
line = line.strip()
# print(line)
assert len(entries) == 1
continue
+ if entries[0] == "file":
+ mode = "file"
+ assert len(entries) == 2
+ current_verbatim_file = entries[1]
+ assert current_verbatim_file not in self.verbatim_files
+ self.verbatim_files[current_verbatim_file] = list()
+ continue
+
if entries[0] == "files":
mode = "files"
assert len(entries) == 1
assert False
continue
+ if mode == "file":
+ self.verbatim_files[current_verbatim_file].append(raw_line)
+ continue
+
assert False
def taskloop(self):
def copy_src(self):
os.makedirs(self.workdir + "/src")
+ for dstfile, lines in self.verbatim_files.items():
+ dstfile = self.workdir + "/src/" + dstfile
+ self.log("Writing '%s'." % dstfile)
+
+ with open(dstfile, "w") as f:
+ for line in lines:
+ f.write(line)
+
for dstfile, srcfile in self.files.items():
dstfile = self.workdir + "/src/" + dstfile