U mfk@s>ddlZddlmZmZmZedddZGdddejZdS)N)TypeTypeVarUnionTIntEnumIntEnum)boundc@seZdZeddZeddZeeeeedddZ eeee edd d Z eeee e efedd d Z ed dZeddZeddZeddZeddZeddZdS)rcCs>||t||}||dp0|||_||_|SN) _check_valueint__new___extra_to_text_prefix_name__value_)clsvaluevalr6/opt/hc_python/lib/python3.8/site-packages/dns/enum.py _missing_s   zIntEnum._missing_cCsD|}t|tst|dks&||kr@|}t|d|dS)Nrz$ must be an int between >= 0 and <= )_maximum isinstancer TypeError _short_name ValueError)rrmaxnamerrrr !s  zIntEnum._check_value)rtextreturncCs|}z ||WStk r&YnX||}|r:|S|}||r|t|drt|t|d}||z ||WSt k r|YSX| dSr) upperKeyError_extra_from_textr startswithlenisdigitr r r_unknown_exception_class)rrrprefixrrr from_text*s"     zIntEnum.from_text)rrrcCsZ||z||j}Wntk r0d}YnX|||}|dkrV||}|Sr)r rrr r )rrrrrrto_text>s   zIntEnum.to_textcCs&t|tr||S||||S)aConvert text or a value into an enumerated type, if possible. *value*, the ``int`` or ``str`` to convert. Raises a class-specific exception if a ``str`` is provided that cannot be converted. Raises ``ValueError`` if the value is out of range. Returns an enumeration from the calling class corresponding to the value, if one is defined, or an ``int`` otherwise. )rstrr'r )rrrrrmakeJs   z IntEnum.makecCstdSr)NotImplementedErrorrrrrr^szIntEnum._maximumcCs |jSr)__name__lowerr,rrrrbszIntEnum._short_namecCsdS)Nrr,rrrr fszIntEnum._prefixcCsdSrr)rrrrrr!jszIntEnum._extra_from_textcCs|Srr)rrZ current_textrrrr nszIntEnum._extra_to_textcCstSr)rr,rrrr%rsz IntEnum._unknown_exception_classN)r- __module__ __qualname__ classmethodrr rrr)r'r r(rr*rrr r!r r%rrrrrs,         )enumtypingrrrrrrrrrs