From 5a1bce8b1f15ae7b335b71feb8e65c0133bae860 Mon Sep 17 00:00:00 2001 From: Daniel Brown <ddb@star.sr.bham.ac.uk> Date: Mon, 9 Jan 2017 13:25:04 +0000 Subject: [PATCH] adding string conversion for BlockedKat --- pykat/finesse.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pykat/finesse.py b/pykat/finesse.py index f442a71..88e58e4 100644 --- a/pykat/finesse.py +++ b/pykat/finesse.py @@ -210,6 +210,16 @@ class BlockedKatFile(object): bkf.write("mytest.kat") """ + def __str__(self): + rtn = "" + + for block in self.ordering: + rtn += "\n%%% FTblock " + block + "\n" + rtn += self.blocks[block] + rtn += "%%% FTend " + block + "\n" + + return rtn + def __init__(self, NO_BLOCK="NO_BLOCK"): self.__NO_BLOCK = NO_BLOCK self.ordering = [self.__NO_BLOCK] -- GitLab