From 2c9bc60f13ff5144242236eb448ec0ebfa85543a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Sat, 7 Dec 2019 16:07:21 +0100 Subject: [PATCH] Add bracket to escape space where there is spaces (like transition type) --- static/js/data.js | 2 +- tools/lib/data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/data.js b/static/js/data.js index aed68cc2..8dbf3db3 100644 --- a/static/js/data.js +++ b/static/js/data.js @@ -203,7 +203,7 @@ class dataFileBase { } } function readrow(line) { - var vals = line.split(/\s+/); + var vals = line.match(/{[^\}]+}|\S+/g); while (vals.length < 8) { vals.push(null); } diff --git a/tools/lib/data.py b/tools/lib/data.py index 777c5698..07df4bf4 100644 --- a/tools/lib/data.py +++ b/tools/lib/data.py @@ -181,7 +181,7 @@ class dataFileBase(object): ####################### ####################### ################ ################# ####### ################### # Number Spin Symm Number Spin Symm type E_{:5s} Corr %T1 f \n""".format(self.GetFileType().name.lower())) for ex in self.excitations: - mystr=" {:8s}{:7s}{:10s}{:8s}{:6s}{:13s}{:16s}{:8s}{:10s}{:15s}{}\n".format(str(ex.initial.number),str(ex.initial.multiplicity),ex.initial.symetry,str(ex.final.number),str(ex.final.multiplicity),ex.final.symetry,str(ex.type) if ex.type is not None else "_",str(ex.value) if ex.value is not None else "_",str(ex.corrected) if ex.corrected is not None else "_",str(ex.T1) if ex.T1 is not None else "_", str(ex.oscilatorForces) if ex.oscilatorForces is not None else "_") + mystr=" {:8s}{:7s}{:10s}{:8s}{:6s}{:13s}{:16s}{:8s}{:10s}{:15s}{}\n".format(str(ex.initial.number),str(ex.initial.multiplicity),ex.initial.symetry,str(ex.final.number),str(ex.final.multiplicity),ex.final.symetry,"{"+str(ex.type)+"}" if ex.type is not None else "_",str(ex.value) if ex.value is not None else "_",str(ex.corrected) if ex.corrected is not None else "_",str(ex.T1) if ex.T1 is not None else "_", str(ex.oscilatorForces) if ex.oscilatorForces is not None else "_") f.write(mystr) class method: def __init__(self,name, *args):