;ò
ýY9?c           @   s8   d  Z  d k Z d e i i f d „  ƒ  YZ d „  Z d S(   s   DNS TTL conversion.Ns   BadTTLc           B   s   t  Z RS(   N(   s   __name__s
   __module__(    (    (    s/   /usr/pkg/lib/python2.3/site-packages/dns/ttl.pys   BadTTL   s   c         C   sX  |  i ƒ  o t |  ƒ Sn |  d i ƒ  o
 t ‚ n d } d } xï |  D]ç } | i ƒ  o | d 9} | t | ƒ 7} qJ | i ƒ  } | d j o | | d 7} n† | d j o | | d 7} ng | d j o | | d 7} nH | d	 j o | | d
 7} n) | d j o | | 7} n t d | ‚ d } qJ W| d j o t d ‚ n | Sd S(   sû   Convert the text form of a TTL to an integer.

    The BIND 8 units syntax for TTLs (e.g. '1w6d4h3m10s') is supported.

    @param text: the textual TTL
    @type text: string
    @raises dns.ttl.BadTTL: the TTL is not well-formed
    @rtype: int
    i    i
   s   wi€:	 s   di€Q s   hi  s   mi<   s   ss   unknown unit '%s's   trailing integerN(   s   texts   isdigits   ints   BadTTLs   totals   currents   cs   lower(   s   texts   cs   currents   total(    (    s/   /usr/pkg/lib/python2.3/site-packages/dns/ttl.pys	   from_text   s8    	 
 

(   s   __doc__s   dns.exceptions   dnss	   exceptions   SyntaxErrors   BadTTLs	   from_text(   s   BadTTLs	   from_texts   dns(    (    s/   /usr/pkg/lib/python2.3/site-packages/dns/ttl.pys   ?   s   	