mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2025-01-12 22:18:29 +01:00
Simplify fileName building
This commit is contained in:
parent
caf0ef124f
commit
5226082616
@ -185,7 +185,10 @@ class dataFileBase(object):
|
|||||||
subpath=datadir/self.GetFileType().name.lower()
|
subpath=datadir/self.GetFileType().name.lower()
|
||||||
if not subpath.exists():
|
if not subpath.exists():
|
||||||
subpath.mkdir()
|
subpath.mkdir()
|
||||||
fileName="{}_{}.dat".format(self.molecule.lower().replace(" ","_"),self.method.name) if self.method.basis==None else "{}_{}_{}.dat".format(self.molecule.lower().replace(" ","_"),self.method.name,self.method.basis)
|
fileNameComp=[self.molecule.lower().replace(" ","_"),self.method.name]
|
||||||
|
if self.method.basis:
|
||||||
|
fileNameComp.append(self.method.basis)
|
||||||
|
fileName="_".join(fileNameComp)+".dat"
|
||||||
file=subpath/fileName
|
file=subpath/fileName
|
||||||
if not file.exists():
|
if not file.exists():
|
||||||
with file.open("w") as f:
|
with file.open("w") as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user