for raw_line in f:
output_line = raw_line
for srch_str in ["seldonio/apife","seldonio/cluster-manager", "seldonio/engine"]:
if raw_line.find(srch_str + ":") > 0:
output_line = get_output_line(raw_line, srch_str)
ftmp.write(output_line)
if debug:
print("created {tmpfpath}".format(**locals()))
After Change
with open(tmpfpath, "w") as ftmp:
for raw_line in f:
output_line = raw_line
if output_line.startswith("// @optionalParam seldonVersion"):
output_line = "// @optionalParam seldonVersion string "+seldon_core_version+" Seldon version\n"
ftmp.write(output_line)
if debug: