Commit 8fdb337c authored by Andreas Freise's avatar Andreas Freise
Browse files

fixing problems with Block reading/writing.

parent 464d25cc
......@@ -26,5 +26,6 @@ class FinesseRunError(BasePyKatException) :
self.__err = err
self.__kat = kat
BasePyKatException.__init__(self, "Finesse returned an error running {1}: {0}".format(self.__err, self.__kat))
BasePyKatException.__init__(self, "Finesse error (file {1}):\n{0}".format(self.__err, self.__kat))
#BasePyKatException.__init__(self, "{0}".format(self.__err))
......@@ -225,7 +225,7 @@ class kat(object):
warnings.warn("found block {0} before block {1} ended".format(newTag, self.__currentTag))
if newTag in self.__blocks:
raise pkex.BasePyKatException("Block `{0}` has already been read")
raise pkex.BasePyKatException("Block `{0}` has already been read").format(newTag)
self.__blocks[newTag] = Block(newTag) # create new list to store all references to components in block
self.__currentTag = newTag
......@@ -577,8 +577,9 @@ class kat(object):
for key in self.__blocks:
objs = self.__blocks[key].contents
out.append("%%% FTblock " + key + "\n")
if key != NO_BLOCK:
out.append("%%% FTblock " + key + "\n")
for obj in objs:
if isinstance(obj, str):
......@@ -593,8 +594,9 @@ class kat(object):
out.append(t + "\n")
else:
out.append(txt + "\n")
out.append("%%% FTend " + key + "\n")
if key != NO_BLOCK:
out.append("%%% FTend " + key + "\n")
if self.noxaxis != None and self.noxaxis == True:
out.append("noxaxis\n")
......
......@@ -164,4 +164,4 @@ class AttrParam(Param):
rtn.extend(super(AttrParam, self).getFinesseText())
return rtn
\ No newline at end of file
return rtn
Markdown is supported
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