grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a àMÒeŠã@sºdZddlmZmZmZddlZddlZddlZej   d¡Z e fe eej j ej j dœdd„Ze dfej j eej j ee d œd d „Zde eeej j e feejjejjd œd d„ZdS)zDNS E.164 helpers.é)ÚIterableÚOptionalÚUnionNz e164.arpa.)ÚtextÚoriginÚreturncCs,dd„|Dƒ}| ¡tjjd |¡|d�S)aÐConvert an E.164 number in textual form into a Name object whose value is the ENUM domain name for that number. Non-digits in the text are ignored, i.e. "16505551212", "+1.650.555.1212" and "1 (650) 555-1212" are all the same. *text*, a ``str``, is an E.164 number in textual form. *origin*, a ``dns.name.Name``, the domain in which the number should be constructed. The default is ``e164.arpa.``. Returns a ``dns.name.Name``. cSsg|]}| ¡r|‘qS©)Úisdigit©Ú.0Údrrú,/usr/lib/python3.9/site-packages/dns/e164.pyÚ /ózfrom_e164..Ú.)r)ÚreverseÚdnsÚnameÚ from_textÚjoin)rrÚpartsrrr Ú from_e164srT)rrÚwant_plus_prefixrcCsf|dur| |¡}dd„|jDƒ}t|ƒt|jƒkr@tj d¡‚| ¡d |¡}|r^d|}| ¡S)a²Convert an ENUM domain name into an E.164 number. Note that dnspython does not have any information about preferred number formats within national numbering plans, so all numbers are emitted as a simple string of digits, prefixed by a '+' (unless *want_plus_prefix* is ``False``). *name* is a ``dns.name.Name``, the ENUM domain name. *origin* is a ``dns.name.Name``, a domain containing the ENUM domain name. The name is relativized to this domain before being converted to text. If ``None``, no relativization is done. *want_plus_prefix* is a ``bool``. If True, add a '+' to the beginning of the returned number. Returns a ``str``. NcSs$g|]}| ¡rt|ƒdkr|‘qS)é)r Úlenr rrr rNrzto_e164..z$non-digit labels in ENUM domain nameró+) Z relativizeÚlabelsrrÚ exceptionÚ SyntaxErrorrrÚdecode)rrrZdlabelsrrrr Úto_e1644s   r )ÚnumberÚdomainsÚresolverrc Cs–|durtj ¡}tj ¡}|D]l}t|tƒr:tj |¡}tj  ||¡}z|  |d¡WStjjyŠ}z||7}WYd}~q d}~00q |‚dS)a~Look for NAPTR RRs for the specified number in the specified domains. e.g. lookup('16505551212', ['e164.dnspython.org.', 'e164.arpa.']) *number*, a ``str`` is the number to look for. *domains* is an iterable containing ``dns.name.Name`` values. *resolver*, a ``dns.resolver.Resolver``, is the resolver to use. If ``None``, the default resolver is used. NZNAPTR) rr#Zget_default_resolverZNXDOMAINÚ isinstanceÚstrrrZe164rÚresolve)r!r"r#Ze_nxÚdomainZqnameÚerrr ÚqueryXs     r))N)Ú__doc__ÚtypingrrrZ dns.exceptionrZdns.nameZ dns.resolverrrZpublic_enum_domainr%ÚNamerÚboolr r#ZResolverZAnswerr)rrrr Ús2 ÿ þ ý ü 'ý ü