%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/aptsources/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/aptsources/__pycache__/_deb822.cpython-312.pyc

�

\�e?���dZddlZddlZddlZddlZej
d�ZGd�d�ZGd�d�Ze	dk(rd	Z
ee
�Zee�yy)
z;deb822 parser with support for comment headers and footers.�N�Tc��eZdZUdZej
eefed<eeefed<eed<eed<de	jedffd�Zded	efd
�Zded	dfd�Z
ded
ed	dfd�Zd	efd�Ze	j"ded	edzfd��Ze	j"deded	eezfd��Zddededzd	edzezfd�Zeded	efd��Zd	efd�Zy)�SectionzcA single deb822 section, possibly with comments.

    This represents a single deb822 section.
    �tags�
_case_mapping�header�footer�sectionc��t|t�rutj|j�|_|jD�cic]}|j�|��c}|_|j|_|j|_yddg}d}d}|jd�D]3}|jd�r|dd}||xx|dzz
cc<�*d}||dzz
}�5tjtj|��|_|jD�cic]}|j�|��c}|_|\|_|_ycc}wcc}w)N�F�
�#�T)
�
isinstancer�collections�OrderedDictr�casefoldrrr	�split�
startswith�apt_pkg�
TagSection)�selfr
�k�comments�
in_section�trimmed_section�lines       �4/usr/lib/python3/dist-packages/aptsources/_deb822.py�__init__zSection.__init__s"���g�w�'�#�/�/����=�D�I�;?�9�9�!E�a�!�*�*�,��/�!E�D��!�.�.�D�K�!�.�.�D�K����8���
����M�M�$�'�	+�D����s�#��A�B�x����$��t��3�$���J��t�d�{�*�O�	+� �+�+�G�,>�,>��,O�P��	�7;�y�y�A�!�a�j�j�l�A�o�A���#+� ���T�[��+"F��(Bs�E�E�key�returnc�p�|j|jj|j�|�S)zGet the value of a field.�rr�getr�rr s  r�__getitem__zSection.__getitem__7s*���y�y��+�+�/�/������D�E�E�Nc�n�|j|jj|j�|�=y)zDelete a fieldNr#r%s  r�__delitem__zSection.__delitem__;s'���I�I�d�(�(�,�,�S�\�\�^�S�A�Br'�valc���|j�|jvr||j|j�<||j|j|j�<y)zSet the value of a field.N)rrr)rr r*s   r�__setitem__zSection.__setitem__?sK���<�<�>��!3�!3�3�14�D���s�|�|�~�.�8;��	�	�$�$�$�S�\�\�^�4�5r'c�,�t|j�S�N)�boolr�rs r�__bool__zSection.__bool__Es���D�I�I��r'c��yr.�r%s  rr$zSection.getH���r'�defaultc��yr.r3�rr r5s   rr$zSection.getLr4r'c�0�	||S#t$r|cYSwxYwr.)�KeyErrorr7s   rr$zSection.getPs%��	���9����	��N�	�s����contentc�\�|r)djd�|j�D��dzSdS)Nr
c3�&K�|]	}d|z���y�w)rNr3)�.0rs  r�	<genexpr>z*Section.__comment_lines.<locals>.<genexpr>Ys����B�T�c�D�j�B�s�r)�join�
splitlines)r:s r�__comment_lineszSection.__comment_linesVs8���
�I�I�B�W�-?�-?�-A�B�B�T�I�	
��	
r'c���|j|j�djd�|jj	�D��z|j|j
�zS)z+Canonical string rendering of this section.rc3�2K�|]\}}|�d|�d����y�w)z: r
Nr3)r=r�vs   rr>z"Section.__str__.<locals>.<genexpr>bs ����B���1���2�a�S��m�B���)�_Section__comment_linesrr?r�itemsr	r0s r�__str__zSection.__str__^sU��
� � ����-��g�g�B��	�	���0A�B�B�
C��"�"�4�;�;�/�
0�	
r'r.)�__name__�
__module__�__qualname__�__doc__rr�str�__annotations__�dict�typing�Unionrr&r)r,r/r1�overloadr$r�staticmethodrFrHr3r'rrrsP���
�
!�
!�#�s�(�
+�+���S��>�!��K��K�,����S�)�^� <�,�4F�s�F�s�F�C�s�C�t�C�<�s�<��<��<��$���_�_��s��s�T�z�����_�_��s��Q��1�s�7�����s��Q��X���T��C����
��
��
��
�
��
r'rc�b�eZdZdZdej
fd�Zdeje	fd�Z
defd�Zy)�FilezC
    Parse a given file object into a list of Section objects.
    �fobjc���g|_d}|D]A}|j�s||z
}�|s�|jjt|��d}�C|r%|jjt|��yy)Nr)�sections�isspace�appendr)rrVr
rs    rrz
File.__init__lso����
����	�D��<�<�>��4�����
�
�$�$�W�W�%5�6���	���M�M� � ���!1�2�r'r!c�,�t|j�Sr.)�iterrXr0s r�__iter__z
File.__iter__|s���D�M�M�"�"r'c�F�djd�|jD��S)Nr
c3�2K�|]}t|����y�wr.)rM)r=�ss  rr>zFile.__str__.<locals>.<genexpr>�s����7�A��Q��7�rE)r?rXr0s rrHzFile.__str__s���y�y�7����7�7�7r'N)
rIrJrKrL�io�
TextIOBaserrP�Iteratorrr]rMrHr3r'rrUrUgs8���3�R�]�]�3� #�&�/�/�'�2�#�8��8r'rU�__main__zV# Header
# More header
K1: V1
# Inline
K2: V2
 # not a comment
# Footer
# More footer
)
rLrrarPr�TypeVarrrrUrI�str`�printr3r'r�<module>rhsf��B��	�
���F�N�N�3���R
�R
�j8�8�8�z��
�B�	���A�	�!�H�r'

Zerion Mini Shell 1.0