3
y’bW		  ã               @   sN   d Z ddlZdZejƒ d pdZedd„ d!D ƒƒZdd„ Zdd„ Zdd „ Z	dS )"z1
Helpers related to SVG conditional processing.

é    Nz"http://www.w3.org/TR/SVG11/featureÚ c             c   s   | ]}t d  | V  qdS )ú#N)ÚROOT)Ú.0Úfeature© r   úQ/var/www/html/enquirykeeper_venv/lib/python3.6/site-packages/cairosvg/features.pyú	<genexpr>   s    r	   ÚSVGú
SVG-staticÚCoreAttributeÚ	StructureÚBasicStructureÚConditionalProcessingÚImageÚStyleÚViewportAttributeÚShapeÚ	BasicTextÚBasicPaintAttributeÚOpacityAttributeÚBasicGraphicsAttributeÚMarkerÚGradientÚPatternÚClipÚ	BasicClipÚMaskc             C   s   t t| jƒ jdƒƒkS )z5Check whether ``features`` are supported by CairoSVG.ú )ÚSUPPORTED_FEATURESÚsetÚstripÚsplit)Úfeaturesr   r   r   Úhas_features5   s    r$   c             C   s2   x,| j dƒD ]}|jƒ }|rtj|ƒrdS qW dS )z?Check whether one of ``languages`` is part of the user locales.ú,TF)r"   r!   ÚLOCALEÚ
startswith)Ú	languagesÚlanguager   r   r   Úsupport_languages:   s
    r*   c             C   sV   | j jdƒ}| j jdƒ}d| j kr&dS |dk	r<t|ƒ r<dS |dk	rRt|ƒ rRdS dS )z;Check the node match the conditional processing attributes.ZrequiredFeaturesZsystemLanguageZrequiredExtensionsFNT)ZattribÚgetr$   r*   )Únoder#   r(   r   r   r   Úmatch_featuresC   s    
r-   )r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )
Ú__doc__Úlocaler   Úgetdefaultlocaler&   r    r   r$   r*   r-   r   r   r   r   Ú<module>   s8                      
	