bgXdZddlZddlmZmZddlmZddlmZGddeeZ dS)a The *Drawing* object is the overall container for all SVG elements. It provides the methods to store the drawing into a file or a file-like object. If you want to use stylesheets, the reference links to this stylesheets were also stored (`add_stylesheet`) in the *Drawing* object. set/get SVG attributes:: element['attribute'] = value value = element['attribute'] The Drawing object also includes a defs section, add elements to the defs section by:: drawing.defs.add(element) N)SVGDefs)ElementFactory) pretty_xmlcTeZdZdZdfd ZfdZddZdd Zdd Zdd Z dZ xZ S)Drawinga This is the SVG drawing represented by the top level *svg* element. A drawing consists of any number of SVG elements contained within the drawing element, stored in the *elements* attribute. A drawing can range from an empty drawing (i.e., no content inside of the drawing), to a very simple drawing containing a single SVG element such as a *rect*, to a complex, deeply nested collection of container elements and graphics elements. noname.svg100%r c htt|jdd|i|||_g|_dS)a :param string filename: filesystem filename valid for :func:`open` :param 2-tuple size: width, height :param keywords extra: additional svg-attributes for the *SVG* object Important (and not SVG Attributes) **extra** parameters: :param string profile: ``'tiny | full'`` - define the SVG baseProfile :param bool debug: switch validation on/off sizeN)superr__init__filename _stylesheets)selfrr extra __class__s a/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/svgwrite/drawing.pyrzDrawing.__init__+sB &gt%99495999  c|j}|j}d|jd<d|jd<d|jd<||jd<||jd<tt|S) z Get the XML representation as `ElementTree` object. :return: XML `ElementTree` of this object and all its subelements zhttp://www.w3.org/2000/svgxmlnszhttp://www.w3.org/1999/xlinkz xmlns:xlinkz!http://www.w3.org/2001/xml-eventszxmlns:ev baseProfileversion)profilerattribsrrget_xml)rrrrs rrzDrawing.get_xml;sk ,, < W&D ]##F Z &- ]#") YWd##++---rnoscreencB|j||||fdS)a5 Add a stylesheet reference. :param string href: link to stylesheet :param string title: name of stylesheet :param string alternate: ``'yes'|'no'`` :param string media: ``'all | aureal | braille | embossed | handheld | print | projection | screen | tty | tv'`` N)rappend)rhreftitle alternatemedias radd_stylesheetzDrawing.add_stylesheetKs*   $y%!@AAAAArFc|dd}|jD]}|||z|}|rt||}||dS)aK Write XML string to `fileobj`. :param fileobj: a file-like object :param pretty: True for easy readable output :param indent: how much to indent if pretty is enabled, by default 2 spaces Python 3.x - set encoding at the open command:: open('filename', 'w', encoding='utf-8') z( zR )indentN)writertostringr)rfileobjprettyr*stylesheet_template stylesheet xml_strings rr+z Drawing.writeVs  ABBB 7+ < >>J j!!!!!rctj|jdd}|||||dS)z Write the XML string to `self.filename`. :param pretty: True for easy readable output :param indent: how much to indent if pretty is enabled, by default 2 spaces wzutf-8)modeencodingr.r*N)ioopenrr+close)rr.r*r-s rsavez Drawing.saversE '$-cGDDD 76& 999 rcB||_|||dS)a Write the XML string to `filename`. :param string filename: filesystem filename valid for :func:`open` :param pretty: True for easy readable output :param indent: how much to indent if pretty is enabled, by default 2 spaces r6N)rr:)rrr.r*s rsaveaszDrawing.saveas|s'!   /////rc*|S)z Show SVG in IPython, Jupyter Notebook, and Jupyter Lab :return: unicode XML string of this object and all its subelements )r,)rs r _repr_svg_zDrawing._repr_svg_s }}r)r r )rr )Fr() __name__ __module__ __qualname____doc__rrr'r+r:r<r> __classcell__)rs@rrr!s ..... B B B B""""80000rr) rBr7svgwrite.containerrrsvgwrite.elementfactoryrsvgwrite.utilsrrrrrrGs$ ((((((((222222%%%%%%kkkkkc>kkkkkr