kp 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 ZddZd 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) factoryNdebugprofile) pop _parameterr r r dictattribsupdatelistelements)selfextrar r r s _/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/svgwrite/base.py__init__zBaseElement.__init__ s * ))It,,%0DOO (kkDO '4(($)DO! ))It,,&-DO#vvE 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)itemsrstripreplace__setitem__)r r keyvalues r r zBaseElement.updateH sc "--// ) )JC **S//))#s33CS%(((( ) )r c t j | }t j | j |_ t j | j |_ d|j v r| |d<