File: //kunden/lib/python3/dist-packages/breezy/__pycache__/ignores.cpython-39.pyc
a
�*�^� � @ s� d Z ddlmZ ddlZddlmZ ddlZddlZddlmZ ee � d� ddl
mZ g d �Zd
d� Z
dd
� Zdd� Zdd� Ze� add� Zdd� Zdd� ZdS )zLists of ignore files, etc.� )�absolute_importN)�BytesIO� )�lazy_importzE
from breezy import (
atomicfile,
globbing,
trace,
)
)�bedding)
z*.az*.oz*.py[co]z*.soz *.sw[nop]z*~z.#*z[#]*#�__pycache__zbzr-orphansc C s� t � }| �� }z|�d��d�}W nl ty� |�d�}g }t|�D ]B\}}z|�|�d�� W qF ty� t�d|d � Y qF0 qFY n0 |D ].}|� d�}|r�|�
d�r�q�|�t�
|�� q�|S ) z�Read in all of the lines in the file and turn it into an ignore list
Continue in the case of utf8 decoding errors, and emit a warning when
such and error is found. Optimise for the common case -- no decoding
errors.
�utf8�
�
�utf-8zA.bzrignore: On Line #%d, malformed utf8 character. Ignoring line.r z
�#)�set�read�decode�split�UnicodeDecodeError� enumerate�appendZtraceZwarning�rstrip�
startswith�add�globbing�normalize_pattern)�f�ignoredZignore_fileZ
unicode_lines�linesZline_number�line� r �0/usr/lib/python3/dist-packages/breezy/ignores.py�parse_ignore_file7 s,
��
r c
C s� t �� } tt�}zt| d�}W n� ttfy� } zpt|dd�}|tj fvrL� zt
t� W n8 ty� } z |jtjtj fvr|� W Y d}~n
d}~0 0 |W Y d}~S d}~0 0 zt
|�W |�� S |�� 0 dS )z9Get the list of user ignored files, possibly creating it.�rb�errnoN)r �user_ignore_config_pathr
�
USER_DEFAULTS�open�IOError�OSError�getattrr! ZENOENT�_set_user_ignores�EnvironmentErrorZEPERMr �close)�path�patternsr �e�errr r r �get_user_ignoresZ s&