etisserant@14: """ Edouard@725: Minimal tab controller for a simple text editor etisserant@14: """ etisserant@14: Edouard@725: import os etisserant@14: lbessard@65: class MiniTextControler: lbessard@65: laurent@806: def __init__(self, filepath, controller): lbessard@65: self.FilePath = filepath laurent@806: self.BaseController = controller laurent@806: laurent@806: def __del__(self): laurent@806: self.BaseController = None laurent@716: Edouard@718: def CTNFullName(self): laurent@716: return "" laurent@716: lbessard@74: def SetEditedElementText(self, tagname, text): lbessard@65: file = open(self.FilePath, "w") lbessard@65: file.write(text) lbessard@65: file.close() lbessard@65: greg@273: def GetEditedElementText(self, tagname, debug = False): lbessard@65: if os.path.isfile(self.FilePath): lbessard@65: file = open(self.FilePath, "r") lbessard@65: text = file.read() lbessard@65: file.close() lbessard@65: return text lbessard@65: return "" lbessard@65: greg@273: def GetEditedElementInterfaceVars(self, tagname, debug = False): lbessard@74: return [] lbessard@74: greg@273: def GetEditedElementType(self, tagname, debug = False): lbessard@74: return "program" lbessard@74: laurent@806: def GetBlockType(self, type, inputs = None, debug = False): laurent@806: return self.BaseController.GetBlockType(type, inputs, debug) laurent@806: greg@273: def GetBlockTypes(self, tagname = "", debug = False): laurent@806: return self.BaseController.GetBlockTypes(tagname, debug) lbessard@74: laurent@630: def GetDataTypes(self, tagname = "", basetypes = True, only_locatables = False, debug = False): laurent@806: return self.BaseController.GetDataTypes(tagname, basetypes, only_locatables, debug) laurent@630: greg@273: def GetEnumeratedDataValues(self, debug = False): laurent@806: return self.BaseController.GetEnumeratedDataValues(debug) lbessard@74: lbessard@65: def StartBuffering(self): lbessard@65: pass lbessard@65: lbessard@65: def EndBuffering(self): lbessard@65: pass lbessard@65: lbessard@65: def BufferProject(self): lbessard@65: pass lbessard@65: