]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Fixed a bug where the Document open/close tags were not output with to_kml().
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 25 Oct 2009 05:16:28 +0000 (01:16 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 25 Oct 2009 05:16:28 +0000 (01:16 -0400)
src/KML.py

index f96adb26272c56563ced80ef3636623e024db173..3279c858f29d42c69f7e825529031f89b685f177 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)