Skip to content
Snippets Groups Projects
Commit 46218f5a authored by Andreas Freise's avatar Andreas Freise
Browse files

make block writing a bit more readable.

parent 5a013138
No related branches found
No related tags found
No related merge requests found
...@@ -393,7 +393,7 @@ class kat(object): ...@@ -393,7 +393,7 @@ class kat(object):
if values[1] == "FTblock": if values[1] == "FTblock":
newTag = values[2] newTag = values[2]
if self.__currentTag != None and newTag != self.__currentTag: if self.__currentTag != None and self.__currentTag != NO_BLOCK:
warnings.warn("found block {0} before block {1} ended".format(newTag, self.__currentTag)) warnings.warn("found block {0} before block {1} ended".format(newTag, self.__currentTag))
if newTag in self.__blocks: if newTag in self.__blocks:
...@@ -816,7 +816,8 @@ class kat(object): ...@@ -816,7 +816,8 @@ class kat(object):
for key in self.__blocks: for key in self.__blocks:
objs = self.__blocks[key].contents objs = self.__blocks[key].contents
if key != NO_BLOCK: out.append("\n")
if key != NO_BLOCK and np.size(objs)>0:
out.append("%%% FTblock " + key + "\n") out.append("%%% FTblock " + key + "\n")
for obj in objs: for obj in objs:
...@@ -833,7 +834,7 @@ class kat(object): ...@@ -833,7 +834,7 @@ class kat(object):
else: else:
out.append(txt + "\n") out.append(txt + "\n")
if key != NO_BLOCK: if key != NO_BLOCK and np.size(objs)>0:
out.append("%%% FTend " + key + "\n") out.append("%%% FTend " + key + "\n")
# now loop through all the nodes and get any gauss commands # now loop through all the nodes and get any gauss commands
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment