OwlCyberSecurity - MANAGER
Edit File: getpass.cpython-36.pyc
3 � fj������������������@���s����d�Z�ddlZddlZddlZddlZddlZdddgZG�dd��de�Zddd �Z dd d�Z ddd �Zddd�Zdd��Z yddlZejejf�W�nB�eefk r����yddlZW�n�ek r����eZY�nX�e ZY�nX�e ZdS�)a���Utilities to get a password and/or the current user name. getpass(prompt[, stream]) - Prompt for a password, with echo turned off. getuser() - Get the user name from the environment or password database. GetPassWarning - This UserWarning is issued when getpass() cannot prevent echoing of the password contents while reading. On Windows, the msvcrt module will be used. �����N�getpass�getuser�GetPassWarningc���������������@���s���e�Zd�ZdS�)r���N)�__name__� __module__�__qualname__��r���r����,/opt/alt/python36/lib64/python3.6/getpass.pyr������s����� Password: c����������.���C���s���d}t�j�����}yJtjdtjtjB��}tj|d�}|j|��tj |�}|j|��|sX|}W�np�t k r��}�zT|j���ytj j��}W�n&�ttfk r����d}t|�|�}Y�nX�tj }|s�tj}W�Y�dd}~X�nX�|dk �r�y�tj|�}|dd��} | d��tj�M��<�tj} ttd��r| tjO�} z tj|| | ��t|�||d�}W�dtj|| |��|j���X�W�n@�tjk �r����|dk �rz��||k �r�|j���t|�|�}Y�nX�|jd��|S�Q�R�X�dS�)a��Prompt for a password, with echo turned off. Args: prompt: Written on stream to ask for the input. Default: 'Password: ' stream: A writable file object to display the prompt. Defaults to the tty. If no tty is available defaults to sys.stderr. Returns: The seKr3t input. Raises: EOFError: If our input tty or stdin was closed. GetPassWarning: When we were unable to turn echo off on the input. Always restores terminal settings before returning. Nz/dev/ttyzw+�����TCSASOFT)�input� )� contextlib� ExitStack�os�open�O_RDWR�O_NOCTTY�io�FileIO� enter_context� TextIOWrapper�OSError�close�sys�stdin�fileno�AttributeError� ValueError�fallback_getpass�stderr�termios� tcgetattrZECHOZ TCSAFLUSH�hasattrr���� tcsetattr� _raw_input�flush�error�write)�prompt�streamZpasswd�stack�fdZttyr ����e�old�newZtcsetattr_flagsr���r���r ����unix_getpass���sR���� r1���c�������������C���s����t�jt�jk rt|�|�S�x|�D�]}tj|��qW�d}xHtj��}|dksL|dkrNP�|dkrZt�|dkrp|dd��}q4||�}q4W�tjd��tjd��|S�) z9Prompt for password with echo off, using Windows getch().��� r�����N�������)r���r���� __stdin__r ����msvcrtZputwchZgetwch�KeyboardInterrupt)r*���r+����cZpwr���r���r ����win_getpassa���s"���� r<���c�������������C���s0���t�jdtdd��|stj}td|d��t|�|�S�)Nz%Can not control echo on the terminal.����)� stacklevelz&Warning: Password input may be echoed.)�file)�warnings�warnr���r���r!����printr&���)r*���r+���r���r���r ���r ���x���s����r ���r2���c�������������C���s����|s t�j}|st�j}t|��}�|�rpy|j|���W�n8�tk rf���|�j|jd�}�|�j|j�}�|j|���Y�nX�|j ���|j ��}|s�t�|d�dkr�|d�d��}|S�)N�replacer6���r���r7���r7���)r���r!���r����strr)����UnicodeEncodeError�encode�encoding�decoder'����readline�EOFError)r*���r+���r ����liner���r���r ���r&�������s&����r&���c��������������C���s<���x dD�]}�t�jj|��}|r|S�qW�ddl}|jt�j���d�S�)z�Get the username from the environment or password database. First try various environment variables, then the password database. This works on Windows as long as USERNAME is set. �LOGNAME�USER�LNAME�USERNAMEr���N)rL���rM���rN���rO���)r����environ�get�pwd�getpwuid�getuid)�name�userrR���r���r���r ���r�������s���� )r ���N)r ���N)r ���N)r2���NN)�__doc__r���r���r���r���r@����__all__�UserWarningr���r1���r<���r ���r&���r���r"���r#���r%����ImportErrorr���r9���r���r���r���r���r ����<module>���s,��� D