/usr/lib/python3/dist-packages/certbot/compat/__pycache__
Edit: /usr/lib/python3/dist-packages/certbot/compat/__pycache__/misc.cpython-310.pyc (5927B)
o
6at @ s d Z ddlmZ ddlZddlZddlZddlZddlZddlm Z ddlm
Z
ddlmZ ddl
mZ zddlmZ dd lmZmZ dd
lmZ dZW n eyW dZY nw eeZercg d
ng Zd+ddZd+ddZde de!de!fddZ"ddddZ#ddddZ$de!de!fdd Z%d!e!de!fd"d#Z& d,d$e!d%e!d&e e' de
e(e!e!f fd'd(Z)d,d$e!d%e!d&e e' de
e!e!f fd)d*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)shell)GetStdHandleSTD_OUTPUT_HANDLE)errorFT)z /usr/sbinz/usr/local/binz/usr/local/sbinreturnc C s" t s
t dkrtddS 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 r r 5/usr/lib/python3/dist-packages/certbot/compat/misc.py+raise_for_non_administrative_windows_rights! s
r c C sZ t rdS d} ztt}|r|| | B W dS W dS ty, tjddd Y dS w )zR
On Windows, ensure that Console Virtual Terminal Sequences are enabled.
N zFailed to set console modeT)exc_info)r r r SetConsoleModeGetConsoleMode
pywinerrorloggerdebug)"ENABLE_VIRTUAL_TERMINAL_PROCESSINGhr r r prepare_virtual_console, s r timeoutpromptc C sZ zt tjgg g | \}}}|std||d W S ty, tj Y S 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 )selectsysstdinr r formatreadlineOSError)r r rlist_r r r readline_with_timeout@ s r' z
C:\CertbotzC:\Certbot\libzC:\Certbot\log)configworklogsz/etc/letsencryptz/var/lib/letsencryptz/var/log/letsencryptfolder_typec C s t jdkr t| S t| S )z
Return the relevant default folder for the current OS
:param str folder_type: The type of folder to retrieve (config, work or logs)
:returns: The relevant default folder.
:rtype: str
nt)r nameLINUX_DEFAULT_FOLDERSWINDOWS_DEFAULT_FOLDERS)r+ r r r get_default_folderi s
r0 pathc C s. t jdkr| S t j| \}}||dd S )z
Replace unsupported characters in path for current OS by underscores.
:param str path: the path to normalize
:return: the normalized path
:rtype: str
r, :r&