a
     ’{aç  ã                   @   s2   d dl mZ erdd„ ZeZd
dd„Zdd„ Zd	S )é    )ÚPY3c                 C   s   | |k| |k  S )N© )ÚaÚbr   r   ú./usr/lib/python3/dist-packages/samba/common.pyÚcmp   s    r   Fc                 C   sz   |rt d|  ƒ dS ddddddœ}d}|r@d|d< d|d< d}t| d	|  ƒ}| ¡ }||v rh|| S t d
| ƒ q@dS )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)ÚYZYESÚ ÚNZNOz[y/N]ZALLZNONEz[y/N/all/none]z %s zUnknown response '%s'N)ÚprintÚ	raw_inputÚupper)ÚmsgZforcedZ	allow_allÚmappingÚpromptÚvr   r   r   Úconfirm   s&    ûr   c                 C   s0   t | ƒd@ r(t | ƒdkr(tt | ƒd ƒS t| ƒS )z)normalise a ldap integer to signed 32 bitl        r   l        )ÚintÚstr)Zivaluer   r   r   Únormalise_int32?   s    r   N)FF)Zsamba.compatr   r   Úinputr   r   r   r   r   r   r   Ú<module>   s
   
!