Skip to content
Snippets Groups Projects
Commit 3cbb790f authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

reset related bugfix in htc_file.py

parent 00f234d3
No related branches found
No related tags found
No related merge requests found
......@@ -40,10 +40,14 @@ class HTCFile(HTCContents, HTCDefaults):
initial_comments = None
_contents = None
def __init__(self, filename=None, modelpath="../"):
self.modelpath = modelpath
if filename is not None:
self.modelpath = os.path.realpath(os.path.join(os.path.dirname(filename), modelpath))
self.filename = filename
else:
self.modelpath = modelpath
self.filename = filename
#assert 'simulation' in self.contents, "%s could not be loaded. 'simulation' section missing" % filename
......@@ -53,10 +57,8 @@ class HTCFile(HTCContents, HTCDefaults):
self.htc_inputfiles = []
self.contents = OrderedDict()
if self.filename is None:
self.filename = 'empty.htc'
lines = self.empty_htc.split("\n")
else:
self.modelpath = os.path.realpath(os.path.join(os.path.dirname(self.filename), self.modelpath))
lines = self.readlines(self.filename)
lines = [l.strip() for l in lines]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment