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

change order of blocks when generating script. First come

all the read FTblocks, followed by the NO_BLOCK bits.
parent 2c40a2e4
No related branches found
No related tags found
No related merge requests found
......@@ -806,21 +806,11 @@ class kat(object):
print " ** removing line '{0}'".format(obj)
objs.remove(obj)
def generateKatScript(self) :
""" Generates the kat file which can then be run """
out = []
import datetime
strtoday = datetime.datetime.now()
out.append(strtoday.strftime("%% Generated by PyKat %d.%m.%Y %H:%M:%S\n") )
for key in self.__blocks:
objs = self.__blocks[key].contents
out.append("\n")
if key != NO_BLOCK and np.size(objs)>0:
out.append("%%% FTblock " + key + "\n")
def writeBlock():
for obj in objs:
if isinstance(obj, str):
out.append(obj + '\n')
......@@ -835,9 +825,33 @@ class kat(object):
else:
out.append(txt + "\n")
if key != NO_BLOCK and np.size(objs)>0:
out = []
import datetime
strtoday = datetime.datetime.now()
out.append(strtoday.strftime("%% Generated by PyKat %d.%m.%Y %H:%M:%S\n") )
# write the FTblocks
for key in self.__blocks:
objs = self.__blocks[key].contents
if key != NO_BLOCK:
if np.size(objs)>0:
out.append("\n")
out.append("%%% FTblock " + key + "\n")
writeBlock()
out.append("%%% FTend " + key + "\n")
# write the NO_BLOCK blocks
for key in self.__blocks:
objs = self.__blocks[key].contents
if key == NO_BLOCK:
if np.size(objs)>0:
out.append("\n")
writeBlock()
# now loop through all the nodes and get any gauss commands
for key in self.nodes.getNodes():
txt = self.nodes.getNodes()[key].getFinesseText()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment