From: Michael Orlitzky Date: Sun, 25 Oct 2009 05:16:28 +0000 (-0400) Subject: Fixed a bug where the Document open/close tags were not output with to_kml(). X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b2537c605b2ad0e6b04bf1534d569f91f30f1594;p=dead%2Fcensus-tools.git Fixed a bug where the Document open/close tags were not output with to_kml(). --- diff --git a/src/KML.py b/src/KML.py index f96adb2..3279c85 100644 --- a/src/KML.py +++ b/src/KML.py @@ -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): """ CLOSE_TAG = """ - """ +""" def __init__(self, initial_text=''): super(Document, self).__init__(initial_text)