diff --git a/pygal/_compat.py b/pygal/_compat.py index ff7d9d7..9d0efdf 100644 --- a/pygal/_compat.py +++ b/pygal/_compat.py @@ -18,11 +18,6 @@ # along with pygal. If not, see . import sys -try: - from urllib.parse import urlparse -except ImportError: - from urlparse import urlparse - def to_str(string): if sys.version_info[0] == 3: diff --git a/pygal/svg.py b/pygal/svg.py index d25a37b..e63fff2 100644 --- a/pygal/svg.py +++ b/pygal/svg.py @@ -22,7 +22,7 @@ Svg helper """ from __future__ import division -from pygal._compat import urlparse, to_str, u +from pygal._compat import to_str, u import io import os import json @@ -57,7 +57,7 @@ class Svg(object): self.root.append( etree.Comment(u( 'Generated with pygal %s ©Kozea 2011-2013 on %s' % ( - __version__, date.today().isoformat())))) + __version__, date.today().isoformat())))) self.root.append(etree.Comment(u('http://pygal.org'))) self.root.append(etree.Comment(u('http://github.com/Kozea/pygal'))) self.defs = self.node(tag='defs') @@ -69,7 +69,7 @@ class Svg(object): colors = self.graph.style.get_colors(self.id) all_css = [] for css in ['base.css'] + list(self.graph.css): - if urlparse(css).scheme: + if '://' in css: self.processing_instructions.append( etree.PI( u('xml-stylesheet'), u('href="%s"' % css))) @@ -97,7 +97,7 @@ class Svg(object): ("window.config", json.dumps(self.graph.config.to_dict()))) for js in self.graph.js: - if urlparse(js).scheme: + if '://' in js: self.node( self.defs, 'script', type='text/javascript', href=js) else: