%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/svgwrite/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyo

�
x��Rc@s{ddlmZddlmZddlmZiZd�Zed�Zdefd��YZ	de	fd	��YZ
d
S(i����(tfull11(ttiny12(tpatterncCst|�t|�S(N(tstr(tprofiletdebug((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyt	cache_keyscCs�ytt||�SWnktk
r�|dkr@t|�}n+|dkr[t|�}ntd|��|tt||�<|SXdS(s Validator factory ttinytfulltbasictnonesUnsupported profile: '%s'N(RR	R
(tvalidator_cacheRtKeyErrortTiny12ValidatortFull11Validatort
ValueError(RRt	validator((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyt
get_validators
R
cBs�eZdZed�Zd�Zd�Zd�Zd�Zd�Z	dd�Z
d	�Zd
�Zd�Z
d�Zd
�ZeZRS(sTiny 1.2cCs4||_tj|_tj|_tj�|_dS(N(RRt
attributestelementstTypeCheckerttypechecker(tselfR((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyt__init__%s	cCs4x-|j�D]\}}|j|||�q
WdS(s�
        Check if attributes are valid for object 'elementname' and all svg
        attributes have valid types and values.

        Raises ValueError.
        N(titemstcheck_svg_attribute_value(RtelementnameRt
attributenametvalue((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pytcheck_all_svg_attribute_values+scCs'|j||�|j|||�dS(s�
        Check if 'attributename' is valid for object 'elementname' and 'value'
        is a valid svg type and value.

        Raises ValueError.
        N(t_check_valid_svg_attribute_namet_check_svg_value(RRRR((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyR5scCs�|j|}x0|j|�D]}|jj||�rdSqWt|�}||j|�kr}td|||f��ndS(s�
        Checks if 'value' is a valid svg-type for svg-attribute
        'attributename' at svg-element 'elementname'.

        Raises TypeError.
        NsA'%s' is not a valid value for attribute '%s' at svg-element <%s>.(Rt	get_typesRtcheckRt	get_constt	TypeError(RRRRt	attributettypenametvaluestr((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyR?s
cCs/|j||�s+td||f��ndS(s~ Check if 'attributename' is a valid svg-attribute for svg-element
        'elementname'.

        Raises ValueError.
        s,Invalid attribute '%s' for svg-element <%s>.N(tis_valid_svg_attributeR(RRR((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyRPscCs@y|j|SWn*tk
r;td||jf��nXdS(Ns-<%s> is not valid for selected profile: '%s'.(RRtprofilename(RR((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyt_get_elementYs
tstringcCs3|jj||�r|Std||f��dS(sZ
        Check if 'value' matches svg type 'typename'.

        Raises TypeError.
        s%s is not of type '%s'.N(RR!R#(RRR%((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pytcheck_svg_type_scCs
||jkS(s4 True if 'elementname' is a valid svg-element name. (R(RR((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pytis_valid_elementnamejscCs|j|�}||jkS(sa True if 'attributename' is a valid svg-attribute for svg-element
        'elementname'.
        (R)tvalid_attributes(RRRtelement((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyR'nscCs|j|�}||jkS(sf True if svg-element 'childrenname' is a valid children of
        svg-element 'elementname'.
        (R)tvalid_children(RRtchildrennameR.((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pytis_valid_childrenuscCs/|j||�s+td||f��ndS(s� Checks if svg-element 'childrenname' is a valid children of
        svg-element 'elementname'.

        Raises ValueError.
        s+Invalid children '%s' for svg-element <%s>.N(R1R(RRR0((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pytcheck_valid_children|scCs�|dkrtd��nt|ttf�r?|df}n^tjj|j��}|r�|j	�\}}}t|�}nt
d|��||f}|jj|d�r�|Sd|jj
�}t
d||f��dS(sk Split value in (number, unit) if value has an unit or (number, None).

        Raises ValueError.
        sInvalid type 'None'.s#'%s' is not a valid svg-coordinate.is	SVG %s %ss!%s is not a valid number for: %s.N(tNoneR#t
isinstancetinttfloatRt
coordinatetmatchtstriptgroupsRRt	is_numbertget_version(RRtresulttnumberttmptunittversion((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pytget_coordinate�s(t__name__t
__module__R(tTrueRRRRRR)R+R,R'R1R2RBt
get_length(((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyR
"s	
	
										RcBseZdZed�ZRS(sFull 1.1cCs4||_tj|_tj|_tj�|_dS(N(RRRRRR(RR((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyR�s	(RCRDR(RER(((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyR�sN(t
svgwrite.dataRRRRRRERtobjectR
R(((sD/opt/alt/python27/lib/python2.7/site-packages/svgwrite/validator2.pyt<module>s	}

Zerion Mini Shell 1.0