+#!/usr/bin/env python
+
+# YouRule: Onscreen Ruler Generator
+#
+# Copyright (C) 2007 Benjamin Mako Hill <mako@atdot.cc>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the Affero General Public License as published
+# by the Free Software Foundation, either version 1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the Affero General Public License
+# along with this program. If not, see
+# <http://http://www.affero.org/oagpl.html>.
+
# define the length of things
-from __future__ import division
+
import SVGdraw
class SVGRuler:
self.drawing.setSVG(self.svg)
def getxml(self):
- import cStringIO
- xml = cStringIO.StringIO()
+ import io
+ xml = io.StringIO()
xml.write("<?xml version='1.0' encoding='UTF-8'?>\n")
xml.write("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www .w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd \">\n")
self.svg.toXml(0,xml)