
                         j    S r SSKrSSKJrJrJr   " S S\5      r\" 5       SS r " S S\5      r	S	 r
g)
zDNS Wire Data Helper    N   )binary_typestring_typesPY2c                   4    \ rS rSrS r\(       a  S rSrgSrg)_SliceUnspecifiedBound   c                     UR                   $ N)stop)selfkeys     lib/third_party/dns/wiredata.py__getitem__"_SliceUnspecifiedBound.__getitem__    s    xx    c                 6    U R                  [        X5      5      $ r   r   slicer   ijs      r   __getslice__#_SliceUnspecifiedBound.__getslice__$       ##E!K00r    N)__name__
__module____qualname____firstlineno__r   r   r   __static_attributes__r   r   r   r   r      s     	1 r   r   c                   H   ^  \ rS rSrU 4S jr\(       a  S rS rS rSr	U =r
$ )WireData*   c                   >  [        U[        5      (       a  UR                  nUR                  n[        (       aj  U[
        :X  a  [        U 5      nUS:  d  US:  a  [        R                  R                  eX#:w  a)  [        [        U ]3  U5        [        [        U ]3  US-
  5        OAX#4 H:  nUc  M  [        U5      [        U 5      :  d  M"  [        R                  R                  e   [        [        [        U ]3  [        X#5      5      5      $ [        U R                  5       5      U   $ ! [          a    [        R                  R                  ef = fNr   r   )
isinstancer   startr   r   _unspecified_boundlendns	exception	FormErrorsuperr#   r   abs	bytearrayunwrap
IndexError)r   r   r(   r   index	__class__s        r   r   WireData.__getitem__-   s   	*#u%% 		xx311"4yqyD1H!mm555 }h9%@h9$(C"' =$ Z#d)3"%--"9"99	 "/  h A%&!( ) )T[[]+C00 	*--)))	*s   CD' 
A D' D' '%Ec                 6    U R                  [        X5      5      $ r   r   r   s      r   r   WireData.__getslice__P   r   r   c              #   |   #    Sn  X   v   US-  nM  ! [         R                  R                   a    [        ef = f7fr&   )r+   r,   r-   StopIteration)r   r   s     r   __iter__WireData.__iter__S   sG     $gQ  ==** $##$s   < <%9<c                     [        U 5      $ r   )r   )r   s    r   r1   WireData.unwrap\   s    4  r   r   )r   r   r   r    r   r   r   r:   r1   r!   __classcell__)r4   s   @r   r#   r#   *   s"     *D 	1$! !r   r#   c                     [        U [        5      (       a  U $ [        U [        5      (       a  [        U 5      $ [        U [        5      (       a  [        U R	                  5       5      $ [        S[        U 5      -  5      e)Nzunhandled type %s)r'   r#   r   r   encode
ValueErrortype)wires    r   
maybe_wraprD   `   s^    $!!	D+	&	&~	D,	'	'&&
(4:5
66r   )__doc__dns.exceptionr+   _compatr   r   r   r   r)   r#   rD   r   r   r   <module>rH      sC   $   3 31[ 1 ,-ab1 3!{ 3!l7r   