10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-12-22 04:13:33 +01:00

Fixed bug with subst

This commit is contained in:
Anthony Scemama 2020-01-27 18:50:24 +01:00
parent 8b773a9d45
commit 5fda8abb51
3 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@ -272,7 +272,7 @@ def print_options():
import subprocess import subprocess
for k in keys: for k in keys:
description = options[k][1] description = options[k][1]
p1 = subprocess.Popen(["fold", "-s", "-w", "40"],stdout=subprocess.PIPE,stdin=subprocess.PIPE) p1 = subprocess.Popen(["fold", "-s", "-w", "40"],stdout=subprocess.PIPE,stdin=subprocess.PIPE, encoding='utf8')
description = p1.communicate(description)[0] description = p1.communicate(description)[0]
description = description.replace('\n','\n'.ljust(27)) description = description.replace('\n','\n'.ljust(27))
print(("-%s, --%s"%(k,options[k][0])).ljust(25), description+'\n') print(("-%s, --%s"%(k,options[k][0])).ljust(25), description+'\n')

View File

@ -311,7 +311,7 @@ def execute_templates(text):
script += "for d in v:\n t0 = str(template)\n" script += "for d in v:\n t0 = str(template)\n"
for v in variables: for v in variables:
script += " t0 = t0.replace('%s',d['%s'])\n"%(v,v) script += " t0 = t0.replace('%s',d['%s'])\n"%(v,v)
script += " print t0\n" script += " print(t0)\n"
# Write script file # Write script file
scriptname = "%s%s_template_%d"%(irpdir,line.filename,line.i) scriptname = "%s%s_template_%d"%(irpdir,line.filename,line.i)
file = open(scriptname,'w') file = open(scriptname,'w')