aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-07-06 22:09:24 +0000
committerRob Austein <sra@hactrn.net>2012-07-06 22:09:24 +0000
commitac27ee1ea98249fee08d78dbf51b917fc6a31555 (patch)
tree9e9d01e481fa4e5032a720d20d4f93bcf0409a6c
parent1182d3e5a181f5d54d792a0552e17af62808291e (diff)
Clever hack of inserting SVG inline doesn't work with xml.etree due to
xml.etree's lack of support for XML namespaces. lxml.etree gets this right, but we don't want to require relying parties to install lxml. Since every browser we care about supports SVG with plain old <img/> elements, just do this the simple way and move on. Fixes #264. svn path=/trunk/; revision=4591
-rw-r--r--rcynic/rcynic-html.py20
1 files changed, 1 insertions, 19 deletions
diff --git a/rcynic/rcynic-html.py b/rcynic/rcynic-html.py
index f4b11ca6..c165d652 100644
--- a/rcynic/rcynic-html.py
+++ b/rcynic/rcynic-html.py
@@ -360,25 +360,7 @@ class Host(Problem_Mixin):
html.BodyElement("br")
svg_html = HTML("%s over last %s" % (self.hostname, period),
"%s_%s_svg" % (self.hostname, period))
- #
- # In theory, we could edit the SVG here to insert an <a/>
- # element just inside the <svg/> element, causing the entire SVG
- # image to be a link to wherever we want it to go. Don't bother
- # until we have a use for such a link, but, references:
- #
- # http://www.w3.org/TR/SVG/linking.html#Links
- # http://lxml.de/tutorial.html#elements-are-lists
- #
- # So code would look something like:
- #
- # svg = ElementTree(...).getroot()
- # a = Element("{http://www.w3.org/2000/svg}a",
- # { "{http://www.w3.org/1999/xlink}href" : url })
- # a.extend(svg[:])
- # del svg[:]
- # svg.append(a)
- #
- svg_html.body.append(ElementTree(file = "%s_%s.svg" % (filebase, period)).getroot())
+ svg_html.BodyElement("img", src = "%s_%s.svg" % (self.hostname, period))
svg_html.close()