관리-도구
편집 파일: ttl.cpython-38.pyc
U /?�f� � @ s\ d Z ddlmZ ddlZdZG dd� dejj�Ze e d�dd �Zee e f e d �dd�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 �5/opt/hc_python/lib/python3.8/site-packages/dns/ttl.pyr s r )�text�returnc C s | � � rt| �}n�t| �dkr$t�n�d}d}d}| D ]�}|� � rZ|d9 }|t|�7 }d}q4|rbt�|�� }|dkr�||d 7 }n`|dkr�||d 7 }nJ|d kr�||d 7 }n4|dkr�||d 7 }n|d kr�||7 }ntd| ��d}d}q4|dks�td��|dk �s|tk�rtd��|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�<