???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................3
bW                 @   s8   d Z ddlZddlmZ G dd dejjZdd ZdS )	zDNS TTL conversion.    N   )longc               @   s   e Zd ZdZdS )BadTTLz!DNS TTL value is not well-formed.N)__name__
__module____qualname____doc__ r	   r	   /usr/lib/python3.6/ttl.pyr      s   r   c             C   s*  | j  rt| }n| d j  s"ttd}td}x| D ]}|j  rZ|d9 }|t|7 }q8|j }|dkr|||td 7 }nl|dkr||td 7 }nR|dkr||td 7 }n8|d	kr||td
 7 }n|dkr||7 }ntd| d}q8W |dkstd|tdk s|tdkr&td|S )zConvert 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
    r   
   wi:	 diQ hi  m<   szunknown unit '%s'ztrailing integeriz0TTL should be between 0 and 2^31 - 1 (inclusive))isdigitr   r   lower)textZtotalZcurrentcr	   r	   r
   	from_text   s8    



r   )	r   Zdns.exceptionZdnsZ_compatr   Z	exceptionSyntaxErrorr   r   r	   r	   r	   r
   <module>   s   