Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Kozea/cairosvg
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Feb 11, 2015
2 parents d4bb235 + d844b6a commit 4d4f020
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cairosvg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
surface_type.convert(*args, **kwargs))(_surface_type)
_name = 'svg2%s' % _output_format.lower()
_function.__name__ = _name
_function.__doc__ = surface.Surface.convert.__doc__.replace(
'the format for this class', _output_format)
if surface.Surface.convert.__doc__:
_function.__doc__ = surface.Surface.convert.__doc__.replace(
'the format for this class', _output_format)
setattr(sys.modules[__name__], _name, _function)


Expand Down
4 changes: 3 additions & 1 deletion cairosvg/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ def __init__(self, **kwargs):
url = parent.url
self.url = url
if url:
if urlparse.urlparse(url).scheme:
if url[1:3] == ":\\":
input_ = url # win absolute filename
elif urlparse.urlparse(url).scheme:
input_ = urlopen(url)
else:
input_ = url # filename
Expand Down
2 changes: 2 additions & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
TEST_FOLDER = os.path.join(os.path.dirname(__file__), "svg")
OUTPUT_FOLDER = os.path.join(os.path.dirname(__file__), "output")

os.chdir(TEST_FOLDER) # relative image urls

if os.environ.get("CAIROSVG_TEST_FILES"):
ALL_FILES = os.environ["CAIROSVG_TEST_FILES"].split(",")
else:
Expand Down
8 changes: 7 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ deps=
tinycss
cssselect
cairocffi
commands=nosetests []
sitepackages=True

setenv =
COVERAGE_FILE=.cov-{envname}

commands=
coverage run --source=cairosvg {envbindir}/nosetests --with-xunit --xunit-file=junit-{envname}.xml
coverage xml -o coverage-{envname}.xml

0 comments on commit 4d4f020

Please sign in to comment.