-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
from io import StringIO | ||
from textwrap import dedent | ||
|
||
from svglib.svglib import svg2rlg | ||
from lxml.etree import XML | ||
|
||
from svglib.svglib import NodeTracker, svg2rlg | ||
|
||
|
||
def drawing_from_svg(content): | ||
return svg2rlg(StringIO(dedent(content))) | ||
|
||
|
||
def minimal_svg_node(content): | ||
return NodeTracker(XML(content)) |