Commit 46218f5a authored by Andreas Freise's avatar Andreas Freise
Browse files

make block writing a bit more readable.

parent 5a013138
......@@ -393,7 +393,7 @@ class kat(object):
if values[1] == "FTblock":
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))
if newTag in self.__blocks:
......@@ -816,7 +816,8 @@ class kat(object):
for key in self.__blocks:
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")
for obj in objs:
......@@ -833,7 +834,7 @@ class kat(object):
else:
out.append(txt + "\n")
if key != NO_BLOCK:
if key != NO_BLOCK and np.size(objs)>0:
out.append("%%% FTend " + key + "\n")
# now loop through all the nodes and get any gauss commands
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment