ok

Mini Shell

Direktori : /lib/python3.6/site-packages/certbot/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/certbot/plugins/__pycache__/util.cpython-36.pyc

3

گa�@sndZddlZddlmZddlmZddlmZddlm	Z	ej
e�Ze
ee
d�dd	�Ze
ed
�dd�ZdS)
zPlugin utilities.�N)�List)�util)�os)�STANDARD_BINARY_DIRS)�path�returncCsFtjj|�}g}x0|r@|j|�tjj|�\}}||dkrPqW|S)a�Retrieves all possible path prefixes of a path, in descending order
    of length. For instance:

      * (Linux) `/a/b/c` returns `['/a/b/c', '/a/b', '/a', '/']`
      * (Windows) `C:\a\b\c` returns `['C:\a\b\c', 'C:\a\b', 'C:\a', 'C:']`

    :param str path: the path to break into prefixes

    :returns: all possible path prefixes of given path in descending order
    :rtype: `list` of `str`
    ����)rr�normpath�append�split)r�prefix�prefixes�_�r�/usr/lib/python3.6/util.py�get_prefixess
r)�cmdrcCs�tjd}g}x,tD]$}||kr|tj|7}|j|�qWt|�rdtjd|tjj|��|tjd<t	j
|�rrdSt|�r~dnd}tjd|||�dS)z�Attempt to perform PATH surgery to find cmd

    Mitigates https://github.com/certbot/certbot/issues/1833

    :param str cmd: the command that is being searched for in the PATH

    :returns: True if the operation succeeded, False otherwise
    �PATHz6Can't find %s, attempting PATH mitigation by adding %sTz	 expanded�z*Failed to find executable %s in%s PATH: %sF)r�environr�pathsepr�any�logger�debug�joinrZ
exe_exists)rrZadded�dZexpandedrrr�path_surgery#s 	



r)�__doc__ZloggingZtypingrZcertbotrZcertbot.compatrZcertbot.compat.miscrZ	getLogger�__name__r�strr�boolrrrrr�<module>s


Zerion Mini Shell 1.0