HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
Disabled: NONE
Upload Files
File: //kunden/lib/python3/dist-packages/dulwich/__pycache__/mailmap.cpython-39.pyc
a

�~�_��@s(dZdd�Zdd�ZGdd�de�ZdS)zMailmap file reader.cCs>|�dd�\}}|��}|�d���}|s.d}|s6d}||fS)N�<��>)�rsplit�strip�rstrip)�text�nameZemail�r	�1/usr/lib/python3/dist-packages/dulwich/mailmap.py�parse_identitysrccsj|D]`}|�d�d}|��}|s$q|�dd�\}}|d7}|��rNt|�}nd}t|�}||fVqdS)z�Read a mailmap.

    Args:
      f: File-like object to read from
    Returns: Iterator over
        ((canonical_name, canonical_email), (from_name, from_email)) tuples
    �#�rrN)�splitrr)�f�line�canonical_identity�
from_identityZparsed_from_identityZparsed_canonical_identityr	r	r
�read_mailmap%s
rc@s8eZdZdZddd�Zddd�Zdd�Zed	d
��ZdS)
�Mailmapz#Class for accessing a mailmap file.NcCs(i|_|r$|D]\}}|�||�qdS)N)�_table�	add_entry)�self�maprrr	r	r
�__init__@szMailmap.__init__cCsb|durd\}}n|\}}|\}}|durP|durP||j|df<||jd|f<n||j||f<dS)aAdd an entry to the mail mail.

        Any of the fields can be None, but at least one of them needs to be
        set.

        Args:
          canonical_identity: The canonical identity (tuple)
          from_identity: The from identity (tuple)
        N)NN)r)rrr�	from_nameZ
from_emailZcanonical_nameZcanonical_emailr	r	r
rFs

zMailmap.add_entrycCs�t|t�sd}t|�}nd}|d|df|ddffD]<}|j�|�}|dur6|dp\|d|dpj|df}qtq6|r||S|dd|ddSdS)z$Lookup an identity in this mailmail.FTNrr
s <r)�
isinstance�tuplerr�get)rZidentityZ	was_tupleZqueryrr	r	r
�lookup[s

�zMailmap.lookupcCs:t|d��}|t|��Wd�S1s,0YdS)N�rb)�openr)�cls�pathrr	r	r
�	from_pathnszMailmap.from_path)N)N)	�__name__�
__module__�__qualname__�__doc__rrr�classmethodr#r	r	r	r
r=s

rN)r'rr�objectrr	r	r	r
�<module>s