File: //snap/certbot/4965/lib/python3.12/site-packages/certbot/plugins/__pycache__/util.cpython-312.pyc
�
N�h� � �~ � d Z ddlZddlmZ ddlmZ ddlmZ ej e � Z
dedee fd�Z
d edefd
�Zy)zPlugin utilities.� N)�util)�os)�STANDARD_BINARY_DIRS�path�returnc �� � t j j | � }g }|rA|j |� t j j |� \ }}||d k( r |S |r�A|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 r �normpath�append�split)r �prefix�prefixes�_s ��/build/snapcraft-certbot-c9561b03ef7f16aa90eb6754ca5f17a1/parts/certbot/install/lib/python3.12/site-packages/certbot/plugins/util.py�get_prefixesr sb � � �W�W�
�
�d�
#�F��H�
�������G�G�M�M�&�)� ����X�b�\�!���O�
� �O� �cmdc � � t j d }g }t D ]. }||vs�|t j |z z
}|j |� �0 t |� rGt j d| t j j |� � |t j d<