Viewing File: /opt/alt/python35/lib64/python3.5/xml/dom/__pycache__/domreg.cpython-35.pyc



°ÕYf{
ã@sddZddlZddddiZiZdd„Zd	d
„Zdfdd„Zd
d„ZdS)z´Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom.éNZminidomzxml.dom.minidomZ4DOMzxml.dom.DOMImplementationcCs|t|<dS)aIregisterDOMImplementation(name, factory)

    Register the factory function with the name. The factory function
    should return an object which implements the DOMImplementation
    interface. The factory function can either return the same object,
    or a new one (e.g. if that implementation supports some
    customization).N)Ú
registered)ÚnameÚfactory©rú3/opt/alt/python35/lib64/python3.5/xml/dom/domreg.pyÚregisterDOMImplementations	rcCs1x*|D]"\}}|j||ƒsdSqWdS)zF_good_enough(dom, features) -> Return 1 if the dom offers the featuresré)Z
hasFeature)ÚdomÚfeaturesÚfÚvrrrÚ_good_enough sr
cCs=ddl}d}tj|ƒ}|rIt|iidgƒ}|jƒS|rZt|ƒStjjrŠd|j	krŠtd|j	dƒSt
|tƒr¥t|ƒ}x0tj
ƒD]"}|ƒ}t||ƒr²|Sq²WxRtjƒD]D}ytd|ƒ}Wntk
rwåYnXt||ƒrå|SqåWtdƒ‚dS)aSgetDOMImplementation(name = None, features = ()) -> DOM implementation.

    Return a suitable DOM implementation. The name is either
    well-known, the module name of a DOM implementation, or None. If
    it is not None, imports the corresponding module and returns
    DOMImplementation object if the import succeeds.

    If name is not given, consider the available implementations to
    find one with the required feature set. If no implementation can
    be found, raise an ImportError. The features list must be a sequence
    of (feature, version) pairs which are passed to hasFeature.rNÚgetDOMImplementationZ
PYTHON_DOMrz$no suitable DOM implementation found)ÚosÚwell_known_implementationsÚgetÚ
__import__rrÚsysÚflagsÚignore_environmentÚenvironÚ
isinstanceÚstrÚ_parse_feature_stringÚvaluesr
ÚkeysÚ	ExceptionÚImportError)rr
rZcreatorÚmodr	rrrr's0

	
rcCsÇg}|jƒ}d}t|ƒ}x–||kr¼||}|ddkr`td|fƒ‚|d}d}||kr¦||}|ddkr¦|d}|}|j||fƒq'Wt|ƒS)NrÚ
0123456789zbad feature name: %rr)ÚsplitÚlenÚ
ValueErrorÚappendÚtuple)Úsr
ÚpartsÚiZlengthZfeatureÚversionrrrrrRs"



r)Ú__doc__rrrrr
rrrrrrÚ<module>s+
Back to Directory File Manager