3 ¢báWë ã @ s8 d Z ddlZddlmZ G dd„ dejjƒZdd„ ZdS ) zDNS TTL conversion.é Né )Úlongc @ s e Zd ZdZdS )Ú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 ƒ rt| ƒ}nð| d j ƒ s"t‚tdƒ}tdƒ}x¼| D ]´}|j ƒ rZ|d9 }|t|ƒ7 }q8|jƒ }|dkr|||tdƒ 7 }nl|dkr–||tdƒ 7 }nR|dkr°||tdƒ 7 }n8|d krÊ||td ƒ 7 }n|dkrÜ||7 }ntd| ƒ‚d}q8W |dk�std ƒ‚|tdƒk �s|tdƒk�r&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. @param text: the textual TTL @type text: string @raises dns.ttl.BadTTL: the TTL is not well-formed @rtype: int r é Úwi€: Údi€Q Úhi Úmé<