Graphics/PackageItem.py

changeset 2030
db11a2fe9bbc
parent 1509
c0b5e693b0eb
child 2032
704593d042fe
--- a/Graphics/PackageItem.py	Sat Sep 08 18:20:46 2012 +0200
+++ b/Graphics/PackageItem.py	Sun Sep 09 14:46:59 2012 +0200
@@ -180,3 +180,32 @@
         painter.drawLine(offsetX, offsetY + y, offsetX + w - 1, offsetY + y)
         
         self.adjustAssociations()
+    
+    def buildItemDataString(self):
+        """
+        Public method to build a string to persist the specific item data.
+        
+        This string must start with ", " and should be built like
+        "attribute=value" with pairs separated by ", ". value must not contain ", "
+        or newlines.
+        
+        @return persistence data (string)
+        """
+        entries = [
+            "item_type=package",
+            "no_modules={0}".format(self.noModules),
+            "name={0}".format(self.model.getName()),
+        ]
+        modules = self.model.getModules()
+        if modules:
+            entries.append("modules={0}".format("||".join(modules)))
+        
+        return ", " + ", ".join(entries)
+    
+    def parseItemDataString(self, data):
+        """
+        Public method to parse the given persistence data.
+        
+        @param data persisted data to be parsed (string)
+        """
+        # TODO: implement this

eric ide

mercurial