AlkantarClanX12
Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/svgwrite/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/svgwrite/__pycache__/base.cpython-311.pyc |
� �܋f�! � � � d Z ddlmZ ddlZddlmZ ddlmZ G d� de� � Z G d� d e� � Z G d � de � � Z G d� d e � � ZdS )z7 The **BaseElement** is the root for all SVG elements. � )�etreeN)� Parameter)�AutoIDc � � e Zd ZdZdZd� Zd� Zd� Zed� � � Z ed� � � Z ed� � � Zej d � � � Zed � � � Z d� Zdd �Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zdd�Zd� ZdS )�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**. �baseElementc �| � |� dd� � }|� |j | _ nt � � | _ |� dd� � }|�|| j _ |� dd� � }|�|| 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� _parameterr r r �dict�attribs�update�list�elements)�self�extrar r r s �^/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/svgwrite/base.py�__init__zBaseElement.__init__ s� � �* �)�)�I�t�,�,����%�0�D�O�O� (�k�k�D�O� � � �'�4�(�(����$)�D�O�!� �)�)�I�t�,�,����&-�D�O�#��v�v������E�������� � � � c � � |� � � D ]D\ }}|� d� � � dd� � }| � ||� � �EdS )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__)r r �key�values r r zBaseElement.updateH sc � � "�-�-�/�/� )� )�J�C�� �*�*�S�/�/�)�)�#�s�3�3�C����S�%�(�(�(�(� )� )r c �� � t j | � � }t j | j � � |_ t j | j � � |_ d|j v r|� � � |d<