From f3ce412599d8cfe2e6ed1dfc4f023f5015118597 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Fri, 6 Apr 2012 16:53:47 +0200 Subject: [PATCH] Add support for link opts --- pygal/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pygal/util.py b/pygal/util.py index 5b7389f..32d6d6f 100644 --- a/pygal/util.py +++ b/pygal/util.py @@ -190,7 +190,10 @@ def get_texts_box(texts, fs): def decorate(svg, node, metadata): if hasattr(metadata, 'xlink'): - return svg.node(node, 'a', href=metadata.xlink) + xlink = metadata.xlink + if not isinstance(xlink, dict): + xlink = {'href': xlink} + return svg.node(node, 'a', **xlink) for key in dir(metadata): if key not in ('xlink', 'value') and not key.startswith('_'): svg.node(node, 'desc', class_=key).text = str(