/
proc
/
self
/
root
/
proc
/
thread-self
/
root
/
lib
/
python3
/
dist-packages
/
certbot
/
compat
/
__pycache__
/
Upload File
HOME
� E��c$ � � � d Z ddlmZ ddlZddlZddlZddlZddlmZ ddlm Z ddl mZ ddlm Z ddlmZ dd lmZ dd lmZ ddlmZ dZn # e$ r d ZY nw xY w ej e� � Zerg d�ng Zd$d�Zd$d�Zdedee de fd�Z!dddd�Z"dddd�Z#de de fd�Z$de de fd�Z% d%d e d!e d"ee& de e'e e f fd#�Z(dS )&zk This compat module handles various platform specific calls that do not fall into one particular category. � )�absolute_importN)�Optional)�Tuple)�errors)�os)�error)�shell)�GetStdHandle)�STD_OUTPUT_HANDLEFT)z /usr/sbinz/usr/local/binz/usr/local/sbin�returnc �n � t s+t j � � dk rt j d� � �dS dS )z� On Windows, raise if current shell does not have the administrative rights. Do nothing on Linux. :raises .errors.Error: If the current shell does not have administrative rights on Windows. r zAError, certbot must be run on a shell with administrative rights.N)� POSIX_MODE� shellwin32� IsUserAnAdminr �Error� � �5/usr/lib/python3/dist-packages/certbot/compat/misc.py�+raise_for_non_administrative_windows_rightsr ! sC � � � `�*�2�4�4��9�9��l�^�_�_�_�`� `�9�9r c � � t rdS d} t t � � }|r,|� |� � � | z � � dS dS # t $ r t � dd�� � Y dS w xY w)zR On Windows, ensure that Console Virtual Terminal Sequences are enabled. N� zFailed to set console modeT)�exc_info)r r r �SetConsoleMode�GetConsoleMode� pywinerror�logger�debug)�"ENABLE_VIRTUAL_TERMINAL_PROCESSING�hs r �prepare_virtual_consoler , s� � � � ��� *0�&�B��*�+�+��� V� ���Q�-�-�/�/�2T�T�U�U�U�U�U� V� V��� B� B� B����1�D��A�A�A�A�A�A�B���s �A A �&A;�:A;�timeout�promptc �: � t j t j gg g | � � \ }}}|s+t j d� |r|nd� � � � �|d � � � S # t $ r! t j � � � cY S w xY w)a( Read user input to return the first line entered, or raise after specified timeout. :param float timeout: The timeout in seconds given to the user. :param str prompt: The prompt message to display to the user. :returns: The first line entered by the user. :rtype: str z,Timed out waiting for answer to prompt '{0}'� r )�select�sys�stdinr r �format�readline�OSError)r! r"