diff SMART/Java/Python/structure/Interval.py @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents 769e306b7933
children
line wrap: on
line diff
--- a/SMART/Java/Python/structure/Interval.py	Mon Apr 22 11:11:10 2013 -0400
+++ b/SMART/Java/Python/structure/Interval.py	Mon Apr 29 03:20:15 2013 -0400
@@ -340,16 +340,15 @@
         @type  surrounder: string
         """
         tags = []
-        for name in self.tags:
-            value = self.tags[name]
+        for name, value in self.tags.iteritems():
             if value == None:
                 continue
             if isinstance(value, basestring):
-                tags.append("%s%s%s%s%s" % (name, fieldSep, surrounder, self.tags[name], surrounder))
+                tags.append("%s%s%s%s%s" % (name, fieldSep, surrounder, value.replace("'", "\\'"), surrounder))
             elif type(value) is int:
-                tags.append("%s%s%s%i%s" % (name, fieldSep, surrounder, self.tags[name], surrounder))
+                tags.append("%s%s%s%i%s" % (name, fieldSep, surrounder, value, surrounder))
             elif type(value) is float:
-                tags.append("%s%s%s%f%s" % (name, fieldSep, surrounder, self.tags[name], surrounder))
+                tags.append("%s%s%s%f%s" % (name, fieldSep, surrounder, value, surrounder))
             else:
                 raise Exception("Do not know how to print '" + value + "'.")
         if self.getName() != None: