src/reportlab/lib/utils.py
changeset 3517 d49ec5554d81
parent 3465 21c2d12661b9
child 3569 b4bb97f6ed72
--- a/src/reportlab/lib/utils.py	Fri May 20 14:29:09 2011 +0000
+++ b/src/reportlab/lib/utils.py	Thu May 26 14:08:20 2011 +0000
@@ -1167,4 +1167,17 @@
     data = data.replace(">", ">")
     data = data.replace("<", "<")
     return data
-    
+
+class IdentStr(str):
+    '''useful for identifying things that get split'''
+    def __new__(cls,value):
+        if isinstance(value,IdentStr):
+            inc = value.__inc
+            value = value[:-(2+len(str(inc)))]
+            inc += 1
+        else:
+            inc = 0
+        value += '[%d]' % inc
+        self = str.__new__(cls,value)
+        self.__inc = inc
+        return self