Viewing File: /opt/alt/python35/lib/python3.5/site-packages/cerberus/__pycache__/utils.cpython-35.opt-1.pyc



LX
@sddlmZddlmZmZddlmZmZddZddZ	dd	Z
d
dZdd
ZddZ
ddZdiddZdS))absolute_import)MappingSequence)
_int_types	_str_typecCsxttt|t|D]z}t||t||rn||||kr||||kSq"t||trdSt||tr"dSq"Wt|t|kS)NTF)rangeminlen
isinstancetyper)xyir	/utils.pycompare_paths_lts(rcCs |d|||ddS)Nr)trrrrdrop_item_from_tuplesrcCs#dtkrddlmatS)N	Validatorr)r)globalsZcerberus.validatorrrrrrget_Validator_classsrcCstt|S)N)hashmapping_to_frozenset)Zschemarrrmapping_hashsrcCs|j}x|jD]\}}t|trGt|||<qt|trt|}x9t|D]+\}}t|trot|||<qoWt|||<qWt	|jS)z Be aware that this treats any sequence type with the equal members as
        equal. As it is used to identify equality of schemas, this can be
        considered okay as definitions are semantically equal regardless the
        container type. )
copyitemsr
rrrlist	enumeratetuple	frozenset)mappingkeyvalueritemrrrr#srcCs2yt|tWntk
r)dSYnXdSdS)NFT)
issubclassobject	TypeError)objrrrisclass5s

	r)cCst|trd|S|SdS)Nz"%s")r
r)r#rrrquote_string>sr*NcCst}|dkr!|f}n+t|tr@|f|}n||f}dd|D}t|dkrd|kr|jddj|it|||S)a Dynamically create a :class:`~cerberus.Validator` subclass.
        Docstrings of mixin-classes will be added to the resulting
        class' one if ``__doc__`` is not in :obj:`class_dict`.

    :param name: The name of the new class.
    :type name: :class:`str`
    :param mixin: Class(es) with mixin-methods.
    :type mixin: :class:`tuple` of or a single :term:`class`
    :param class_dict: Attributes for the new class.
    :type class_dict: :class:`dict`
    :return: The created class.
    NcSs"g|]}|jr|jqSr)__doc__).0rrrr
<listcomp>[s	z%validator_factory.<locals>.<listcomp>rr+
)rr
rr	updatejoinr)nameZmixinZ
class_dictrbasesZ
docstringsrrrvalidator_factoryEs
	r3)Z
__future__rcollectionsrrZcerberus.platformrrrrrrrr)r*r3rrrr<module>s	
Back to Directory File Manager