MCPcopy Index your code
hub / github.com/WhyNotHugo/python-barcode / create_svg_object

Function create_svg_object

barcode/writer.py:58–70  ·  view source on GitHub ↗
(with_doctype=False)

Source from the content-addressed store, hash-verified

56
57
58def create_svg_object(with_doctype=False) -> xml.dom.minidom.Document:
59 imp = xml.dom.minidom.getDOMImplementation()
60 assert imp is not None
61 doctype = imp.createDocumentType(
62 "svg",
63 "-//W3C//DTD SVG 1.1//EN",
64 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd",
65 )
66 document = imp.createDocument(None, "svg", doctype if with_doctype else None)
67 _set_attributes(
68 document.documentElement, version="1.1", xmlns="http://www.w3.org/2000/svg"
69 )
70 return document
71
72
73SIZE = "{0:.3f}mm"

Callers 1

_initMethod · 0.85

Calls 1

_set_attributesFunction · 0.85

Tested by

no test coverage detected