+\h dZddlmZddlZdZGddej jZde de fd Z d ee e fde fd Z y) zDNS TTL conversion.)UnionNlceZdZdZy)BadTTLz!DNS TTL value is not well-formed.N)__name__ __module__ __qualname____doc__J/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/dns/ttl.pyrr s+r rtextreturnc|jr t|}nt|dk(rtd}d}d}|D]}|jr|dz}|t|z }d})|rt|j }|dk(r ||dzz }nD|dk(r ||dzz }n6|d k(r ||d zz }n(|d k(r ||d zz }n|d k(r||z }ntd|dd}d}|dk(s td|dks |t kDr td|S)zConvert 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 Fwi: diQhim<szunknown unit ''ztrailing integerz1TTL should be between 0 and 2**32 - 1 (inclusive))isdigitintlenrlowerMAX_TTL)r totalcurrent need_digitcs r from_textr!$s3 ||~D  Ta   "Ayy{2 3q6!"  LGGI8Wv--E#XWu_,E#XWt^+E#XWr\)E#XW$E >!A!677! - ".!|+, , qyEGOHII Lr valuect|tr|St|trtjj |St d)Nzcannot convert value to TTL) isinstancerstrdnsttlr! ValueError)r"s r maker)Vs<% E3 ww  ''677r ) r typingr dns.exceptionr&r exception SyntaxErrorrr%rr!r)r r r r.s\$ ,S]] & &,/C/C/d8c3h8C8r