
    b:                     &    d  Z ddZd Zd Zd ZdS )c                     | |k    | |k     z
  S )z
    Replacement for built-in function cmp that was removed in Python 3

    Compare the two objects x and y and return an integer according to
    the outcome. The return value is negative if x < y, zero if x == y
    and strictly positive if x > y.
     )xys     ./usr/lib/python3/dist-packages/samba/common.pycmpr      s     Ea!e    Fc                     |rt          d| z             dS dddddd}d}|rd|d<   d|d<   d}	 t          | d	|z  z             }|                                }||v r||         S t          d
|z             H)z|confirm an action with the user

    :param msg: A string to print to the user
    :param forced: Are the answer forced
    z%s [YES]TF)YYES NNOz[y/N]ALLNONEz[y/N/all/none]z %s zUnknown response '%s')printinputupper)msgforced	allow_allmappingpromptvs         r   confirmr   !   s      j3t  G F " !+#'((GGII<<1:%)***+r   c                     t          |           dz  r2t          |           dk    rt          t          |           dz
            S t          |           S )z)normalise a ldap integer to signed 32 bitl            l        )intstr)ivalues    r   normalise_int32r    B   sH    
6{{Z .CKK!OO3v;;,---v;;r   c                     | }t          | t                    r|                     d          }n7t          | t                    s"t	          dt          |           d|           |S )Nutf8zExpected byte or string for :)
isinstancer   encodebytes
ValueErrortypebytesorstringtmps     r   	get_bytesr,   W   sn    
C-%% e""6**u-- ej]@S@S@S@SUbUbcdddJr   c                     | }t          | t                    r|                     d          }n7t          | t                    s"t	          dt          |           d|           |S )Nr"   zExpected byte of string for r#   )r$   r&   decoder   r'   r(   r)   s     r   
get_stringr/   e   sn    
C-'' e""6**s++ ej]@S@S@S@SUbUbcdddJr   N)FF)r   r   r    r,   r/   r   r   r   <module>r0      s`   *	 	 	+ + + +B  *      r   