PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/hc_python/lib/python3.12/site-packages/dns/__pycache__/
Upload File :
Current File : //opt/hc_python/lib/python3.12/site-packages/dns/__pycache__/ttl.cpython-312.pyc

�

���g����dZddlmZddlZdZGd�dejj�Zde	de
fd	�Zd
ee
e	fde
fd�Zy)zDNS TTL conversion.�)�UnionNl��c��eZdZdZy)�BadTTLz!DNS TTL value is not well-formed.N)�__name__�
__module__�__qualname__�__doc__���6/opt/hc_python/lib/python3.12/site-packages/dns/ttl.pyrr s��+rr�text�returnc��|j�rt|�}n�t|�dk(rt�d}d}d}|D]�}|j�r|dz}|t|�z
}d}�)|rt�|j	�}|dk(r	||dzz
}nD|dk(r	||dzz
}n6|d	k(r	||d
zz
}n(|dk(r	||dzz
}n|d
k(r||z
}ntd|�d���d}d}��|dk(std��|dks	|t
kDrtd��|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``.
    rT�
F�wi�:	�di�Q�hi�m�<�szunknown unit '�'ztrailing integerz1TTL should be between 0 and 2**32 - 1 (inclusive))�isdigit�int�lenr�lower�MAX_TTL)r
�total�current�
need_digit�cs     r�	from_textr!$s.���|�|�~��D�	��	�T��a���������
��A��y�y�{��2�
���3�q�6�!��"�
�� �L��G�G�I����8��W�v�-�-�E��#�X��W�u�_�,�E��#�X��W�t�^�+�E��#�X��W�r�\�)�E��#�X��W�$�E� �>�!��A�!6�7�7���!�
�-�.�!�|��+�,�,��q�y�E�G�O��H�I�I��Lr�valuec��t|t�r|St|t�rtjj|�St
d��)Nzcannot convert value to TTL)�
isinstancer�str�dns�ttlr!�
ValueError)r"s r�maker)Vs<���%�����	�E�3�	��w�w� � ��'�'��6�7�7r)
r	�typingr�
dns.exceptionr&r�	exception�SyntaxErrorrr%rr!r)r
rr�<module>r.s\��$�����,�S�]�]�
&�
&�,�/�C�/�C�/�d8��c�3�h��8�C�8r

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic