Title: [commits] (morgen) [11185] In preparation for the upcoming rename of 'displayName' to 'title', continue to use 'displayName' in sharing XML for backwards compatibility.
Revision
11185
Author
morgen
Date
2006-07-18 06:46:29 -0700 (Tue, 18 Jul 2006)

Log Message

In preparation for the upcoming rename of 'displayName' to 'title', continue to use 'displayName' in sharing XML for backwards compatibility.

Modified Paths

Diff

Modified: trunk/chandler/parcels/osaf/sharing/Sharing.py (11184 => 11185)

--- trunk/chandler/parcels/osaf/sharing/Sharing.py	2006-07-17 18:52:02 UTC (rev 11184)
+++ trunk/chandler/parcels/osaf/sharing/Sharing.py	2006-07-18 13:46:29 UTC (rev 11185)
@@ -2629,7 +2629,13 @@
 
             else: # it's a literal (@@@MOR could be SingleRef though)
 
-                result += "<%s" % attrName
+                # Since 'displayName' is being renamed 'title', let's keep
+                # existing shares backwards-compatible and continue to read/
+                # write 'displayName':
+                if attrName == 'title':
+                    result += "<%s" % 'displayName'
+                else:
+                    result += "<%s" % attrName
 
                 if cardinality == 'single':
 
@@ -2694,8 +2700,15 @@
                     # @@@MOR
                     pass
 
-            result += "</%s>\n" % attrName
 
+            # Since 'displayName' is being renamed 'title', let's keep
+            # existing shares backwards-compatible and continue to read/
+            # write 'displayName':
+            if attrName == 'title':
+                result += "</%s>\n" % 'displayName'
+            else:
+                result += "</%s>\n" % attrName
+
         depth -= 1
         result += indent * depth
         result += "</%s>\n" % item.itsKind.itsName
@@ -2815,7 +2828,14 @@
             attributes = self.share.getSharedAttributes(item)
             for attrName in attributes:
 
-                attrElement = self._getElement(element, attrName)
+                # Since 'displayName' is being renamed 'title', let's keep
+                # existing shares backwards-compatible and continue to read/
+                # write 'displayName':
+                if attrName == 'title':
+                    attrElement = self._getElement(element, 'displayName')
+                else:
+                    attrElement = self._getElement(element, attrName)
+
                 if attrElement is None:
                     if item.hasLocalAttributeValue(attrName):
                         item.removeAttributeValue(attrName)




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to