%PDF- %PDF-
| Direktori : /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/ |
| Current File : //opt/plesk/python/2.7/lib/python2.7/site-packages/dns/e164.pyc |
�
�ac @ s} d Z d d l Z d d l Z d d l Z d d l m Z m Z e j j d � Z
e
d � Z e
e d � Z
d d � Z d S( s DNS E.164 helpers.i����Ni ( t string_typest maybe_decodes
e164.arpa.c C sN g | D] } | j � r | ^ q } | j � t j j d j | � d | �S( s� 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 ``text``, 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``.
t .t origin( t isdigitt reverset dnst namet from_textt join( t textR t dt parts( ( s= /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/e164.pyt from_e164 s %
c C s� | d k r | j | � } n g | j D]* } | j � r( t | � d k r( | ^ q( } t | � t | j � k r� t j j d � � n | j � d j | � } | r� d | } n t
| � S( s� 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 ``text``.
i s$ non-digit labels in ENUM domain namet t +N( t Nonet
relativizet labelsR t lenR t exceptiont SyntaxErrorR R R ( R R t want_plus_prefixR t dlabelsR
( ( s= /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/e164.pyt to_e1641 s :
c C s� | d k r t j j � } n t j j � } x� | D]y } t | t � r^ t j j | � } n t j j
| | � } y | j | d � SWq4 t j j k
r� } | | 7} q4 Xq4 W| � d S( s Look for NAPTR RRs for the specified number in the specified domains.
e.g. lookup('16505551212', ['e164.dnspython.org.', 'e164.arpa.'])
*number*, a ``text`` 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.
t NAPTRN( R R t resolvert get_default_resolvert NXDOMAINt
isinstanceR R R t e164R
t query( t numbert domainsR t e_nxt domaint qnamet e( ( s= /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/e164.pyR Q s
( t __doc__t
dns.exceptionR t dns.namet dns.resolvert _compatR R R R t public_enum_domainR
t TrueR R R ( ( ( s= /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/e164.pyt <module> s