]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Merged branch 'master' with the to_kml() fix.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 25 Oct 2009 22:11:24 +0000 (18:11 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 25 Oct 2009 22:11:24 +0000 (18:11 -0400)
src/KML.py

index 1f42898d6d4f48070381e93da2113a2b6af422a2..26e8e71d551437caa72617c52bdfe7ce41717774 100644 (file)
@@ -32,17 +32,17 @@ class KmlObject(object):
 
         
     def to_kml(self):
-        return self.render()
+        kml = self.OPEN_TAG
+        kml += self.render()
+        kml += self.CLOSE_TAG + "\n"
+        return kml
 
 
     def render(self):
-        kml = self.OPEN_TAG
-        kml += escape(self.text)
+        kml = escape(self.text)
 
         for c in self.children:
             kml += c.to_kml()
-
-        kml += self.CLOSE_TAG + "\n"
         
         return kml
 
@@ -75,7 +75,7 @@ class Document(KmlObject):
 <Document>"""
 
     CLOSE_TAG = """</Document>
-    </kml>"""
+</kml>"""
     
     def __init__(self, initial_text=''):
         super(Document, self).__init__(initial_text)