File: //lib/python3/dist-packages/certbot/plugins/__pycache__/util.cpython-310.pyc
o
6��a� � @ sN d Z ddlZddlmZ ddlmZ ddlmZ e�e �Z
dd� Zdd � ZdS )
zPlugin utilities.� N)�util)�os)�STANDARD_BINARY_DIRSc C sH t j�| �}g }|r"|�|� t j�|�\}}||d kr |S |s
|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`
���)r �path�normpath�append�split)r �prefix�prefixes�_� r
�6/usr/lib/python3/dist-packages/certbot/plugins/util.py�get_prefixes s
�r c C s� t jd }g }tD ]}||vr|t j| 7 }|�|� q t|�r0t�d| t j�|�� |t jd<