File: utils.py

package info (click to toggle)
python-svglib 1.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 332 kB
  • sloc: python: 2,736; sh: 6; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 299 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from io import StringIO
from textwrap import dedent

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), None, 0, None, False)