util/MiniTextControler.py
changeset 725 31dade089db5
parent 722 a94f361fc42e
child 806 abf1afc1f04d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/util/MiniTextControler.py	Wed May 09 00:00:50 2012 +0200
@@ -0,0 +1,51 @@
+"""
+Minimal tab controller for a simple text editor
+"""
+
+import os
+
+class MiniTextControler:
+    
+    def __init__(self, filepath):
+        self.FilePath = filepath
+    
+    def CTNFullName(self):
+        return ""
+    
+    def SetEditedElementText(self, tagname, text):
+        file = open(self.FilePath, "w")
+        file.write(text)
+        file.close()
+        
+    def GetEditedElementText(self, tagname, debug = False):
+        if os.path.isfile(self.FilePath):
+            file = open(self.FilePath, "r")
+            text = file.read()
+            file.close()
+            return text
+        return ""
+    
+    def GetEditedElementInterfaceVars(self, tagname, debug = False):
+        return []
+    
+    def GetEditedElementType(self, tagname, debug = False):
+        return "program"
+    
+    def GetBlockTypes(self, tagname = "", debug = False):
+        return []
+    
+    def GetDataTypes(self, tagname = "", basetypes = True, only_locatables = False, debug = False):
+        return []
+    
+    def GetEnumeratedDataValues(self, debug = False):
+        return []
+    
+    def StartBuffering(self):
+        pass
+
+    def EndBuffering(self):
+        pass
+
+    def BufferProject(self):
+        pass
+