403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.225.7.106
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/svgwrite/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/svgwrite/__pycache__/drawing.cpython-37.opt-1.pyc
B

��]M�@sVdZddlmZddlZddlmZmZddlmZddl	m
Z
Gdd�dee�ZdS)	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)

�)�unicode_literalsN)�SVG�Defs)�ElementFactory)�
pretty_xmlcs^eZdZdZd�fdd�	Z�fdd�Zdd
d�Zddd�Zddd�Zddd�Z	dd�Z
�ZS)�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.svg�z100%z100%cs*tt|�jfd|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)�selfr
r
Zextra)�	__class__��A/opt/alt/python37/lib/python3.7/site-packages/svgwrite/drawing.pyr,szDrawing.__init__csL|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/svgZxmlnszhttp://www.w3.org/1999/xlinkzxmlns:xlinkz!http://www.w3.org/2001/xml-eventszxmlns:evZbaseProfile�version)�profilerZattribsrr�get_xml)rrr)rrrr<s




zDrawing.get_xml�no�screencCs|j�||||f�dS)a5 Add a stylesheet reference.

        :param string href: link to stylesheet <URI>
        :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)r�append)rZhref�titleZ	alternateZmediarrr�add_stylesheetLs	zDrawing.add_stylesheetF�cCsR|�d�d}x|jD]}|�||�qW|��}|rDt||d�}|�|�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(<?xml version="1.0" encoding="utf-8" ?>
zR<?xml-stylesheet href="%s" type="text/css" title="%s" alternate="%s" media="%s"?>
)�indentN)�writer�tostringr)r�fileobj�prettyrZstylesheet_templateZ
stylesheetZ
xml_stringrrrrWs
z
Drawing.writecCs.tj|jddd�}|j|||d�|��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)�mode�encoding)r rN)�io�openr
r�close)rr rrrrr�savesszDrawing.savecCs||_|j||d�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
        )r rN)r
r')rr
r rrrr�saveas}szDrawing.saveascCs|��S)z� Show SVG in IPython, Jupyter Notebook, and Jupyter Lab

        :return: unicode XML string of this object and all its subelements

        )r)rrrr�
_repr_svg_�szDrawing._repr_svg_)rr	)rr)Fr)Fr)Fr)�__name__�
__module__�__qualname__�__doc__rrrrr'r(r)�
__classcell__rr)rrr"s	





r)r-Z
__future__rr$Zsvgwrite.containerrrZsvgwrite.elementfactoryrZsvgwrite.utilsrrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit