File: //home/arjun/projects/env/lib/python3.10/site-packages/dns/__pycache__/ttl.cpython-310.pyc
o
!we� � @ s` d Z ddlmZ ddlZdZG dd� dejj�Zde de
fd d
�Zdee
e f de
fdd
�ZdS )zDNS TTL conversion.� )�UnionNl �� c @ s e Zd ZdZdS )�BadTTLz!DNS TTL value is not well-formed.N)�__name__�
__module__�__qualname__�__doc__� r r �@/home/arjun/projects/env/lib/python3.10/site-packages/dns/ttl.pyr s r �text�returnc C s | � � r t| �}nst| �dkrt�d}d}d}| D ]Z}|� � r,|d9 }|t|�7 }d}q|r0t�|�� }|dkr?||d 7 }n0|dkrJ||d 7 }n%|d krU||d
7 }n|dkr`||d 7 }n|d
kri||7 }ntd| ��d}d}q|dks|td��|dk s�|tkr�td��|S )z�Convert the text form of a TTL to an integer.
The BIND 8 units syntax for TTLs (e.g. '1w6d4h3m10s') is supported.
*text*, a ``str``, the textual TTL.
Raises ``dns.ttl.BadTTL`` if the TTL is not well-formed.
Returns an ``int``.
r T�
F�wi�: �di�Q �hi �m�<