U e5d{ @s<ddlZdddZiZddZddZdd d Zd d ZdS)Nzxml.dom.minidomzxml.dom.DOMImplementation)ZminidomZ4DOMcCs |t|<dS)N) registered)namefactoryr&/usr/lib64/python3.8/xml/dom/domreg.pyregisterDOMImplementations rcCs$|D]\}}|||sdSqdS)Nr)Z hasFeature)domfeaturesfvrrr _good_enough s  r rc Csddl}d}t|}|r2t|iidg}|S|r@t|Stjjsbd|j krbt|j ddSt |t rtt |}t D]}|}t||r||Sq|tD]>}zt|d}Wntk rYqYnXt||r|SqtddS)NrgetDOMImplementationZ PYTHON_DOM)rz$no suitable DOM implementation found)oswell_known_implementationsget __import__rrsysflagsignore_environmentenviron isinstancestr_parse_feature_stringvaluesr keys Exception ImportError)rr rZcreatormodr rrrr's0           rcCsg}|}d}t|}||kr||}|ddkrBtd|f|d}d}||krv||}|ddkrv|d}|}|||fqt|S)Nr 0123456789zbad feature name: %rr)splitlen ValueErrorappendtuple)sr partsiZlengthZfeatureversionr rrrrRs"  r)Nr)rrrrr rrrrrr s  +