%PDF- %PDF-
Mini Shell

Mini Shell

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

�

Cf�c=%����dZddlZddlZ	ddlmZmZmZmZmZm	Z	m
Z
dZddddd	�Z
ejd
�ZGd�de�ZGd
�de�Zd�Zd�ZGd�de�ZGd�de�Zy#e$rY�UwxYw)z'Functions for working with watch files.�N)�Iterable�Iterator�List�Optional�Sequence�TextIO�Tuple�z[-_]?(\d[\-+\.:\~\da-zA-Z]*)z2(?i)\.(?:tar\.xz|tar\.bz2|tar\.gz|zip|tgz|tbz|txz)zL(?i)\.(?:tar\.xz|tar\.bz2|tar\.gz|zip|tgz|tbz|txz)\.(?:asc|pgp|gpg|sig|sign)z%[\+~](debian|dfsg|ds|deb)(\.)?(\d+)?$)z
@ANY_VERSION@z
@ARCHIVE_EXT@z@SIGNATURE_EXT@z	@DEB_EXT@zdebian.watchc��eZdZdZy)�MissingVersionzThe version= line is missing.N��__name__�
__module__�__qualname__�__doc__���./usr/lib/python3/dist-packages/debian/watch.pyrr=s��'rrc��eZdZdZy)�WatchFileFormatErrorz(Raised when the input is not valid.
    Nr
rrrrrAs��rrc��ttj��}||d<|j�D]\}}|j||�}�|S)z�Apply substitutions to a string.

    :param text: text to apply substitutions to
    :param package: package name, as a string
    :return: text with subsitutions applied
    z	@PACKAGE@)�dict�
SUBSTITUTIONS�items�replace)�text�package�substs�k�vs     r�expandr!FsQ���-�%�%�'�
(�F�"�F�;������"���1��|�|�A�q�!��"��Krc�H�|rt|��tj|�y�N)r�logger�warning)�msg�stricts  r�	_complainr(Ws��
�"�3�'�'�
�N�N�3�rc�<�eZdZdZddefd�Zd�Zd�Zedd��Z	y)�	WatchFilez�A Debian watch file.

    :ivar entries: list of Watch entries
    :ivar options: optional list of global options, applied to all Watch
        entries
    :ivar version: watch file version
    Nc�>�||_|�g}||_|�g}||_yr#)�version�entries�options)�selfr-r.r,s    r�__init__zWatchFile.__init__gs-��
����?��G�����?��G���rc�,�t|j�Sr#)�iterr-�r/s r�__iter__zWatchFile.__iter__ts���D�L�L�!�!rc��d�}|j�|jd|jz�|jr$|j||j�dz�|jD]�}|jr$|j||j�dz�|j|j�|j
r|jd|j
z�|jr|jd|jz�|jr|jd|jz�|jd���y)aOWrite the contents of a watch file to a file-like object.

        Note that this will not preserve the formatting of the original file,
        and thus it is currently not possible to use this function to
        parse and reserialize a file and end up with the same contents.

        :param f: File-like object to write to
        c�N�dj|�}d|vsd|vrd|zdzSd|zS)N�,� �	zopts="�"�opts=)�join)�opts�ss  r�serialize_optionsz)WatchFile.dump.<locals>.serialize_options�s5�������A��a�x�4�1�9��!�|�c�)�)��Q�;�rNzversion=%d
�
r8)r,�writer.r-�url�matching_pattern�script)r/�fr?�entrys    r�dumpzWatchFile.dumpxs���	��<�<�#�
�G�G�N�T�\�\�1�2��<�<�
�G�G�%�d�l�l�3�d�:�;��\�\�
	�E��}�}����)�%�-�-�8�3�>�?�
�G�G�E�I�I���%�%�����e�4�4�4�5��}�}�����e�m�m�+�,��|�|�����e�l�l�*�+�
�G�G�D�M�
	rc���g}g}|D]�}|jd�r�|j�s�&|jd�jd�r!|j	|jd���g|j	|�|j	|�g}��|rtd|�|j	|�|sydj
|jd��}	|jd	d
�\}}|j�dk7r
t��t|j��}	g}
g}|D�]}}|	dkDr|D�
cgc]}
|
j���}}
dj
|�j�}|s�H|jd
�rf|ddk(r3|jdd�}|dk(rtd|z��|d|}||d
zd}n	|ddjdd
�\}}|jd�}ng}|r�	|jdd
�\}}tjd|�}|rAt!|d�ft#|jdd
��z}|dt%|d�d
z
}nt#|jdd��}|j	t'|g|��d|i����m|
j)|����|||
|	��S#t$rt��wxYwcc}
w#t$r|dd}d}Y��wxYw#t$r|}d}Y��wxYw)a@Parse from the contents that make up a watch file.

        :param lines: watch file lines to parse
        :return: instance or None if there are no non-comment lines in the file
        :raise MissingVersion: if there is no version number declared
        :raise ValueError: when syntax errors are encountered
        �#r@�\z
\z*watchfile ended with \; skipping last lineN�r�=�r,�r;�r:����zNot matching " in %rr7z/([^/]*\([^/]*\)[^/]*)$�r=)r-r.r,)�
startswith�strip�rstrip�endswith�appendr(r<�pop�split�
ValueErrorr�int�lstrip�index�re�findall�str�tuple�len�Watch�extend)�cls�linesr'�joined_lines�	continued�line�	firstline�key�valuer,�persistent_optionsr-�chunked�chunk�optend�opts_strr=rB�m�partss                    r�
from_lineszWatchFile.from_lines�s�����	��
	�D����s�#���:�:�<���{�{�4� �)�)�$�/�� � ����V�!4�5�� � ��&��#�#�I�.��	�
	���C�V�L����	�*����G�G�L�,�,�Q�/�0�	�	#�"����a�0�J�C���9�9�;�)�#� �"�"��e�k�k�m�$������#�&	0�G���{�8?�?�e�5�<�<�>�?��?��7�7�7�#�)�)�+�D������w�'���7�c�>�!�Z�Z��Q�/�F���|�(�)?�$�)F�G�G�#�A�f�~�H���q��	�?�D�"�+/���8�>�>�$��+B�(��4� �~�~�c�*������ $�
�
�4�� 3�I�C���J�J�9�3�?��� ��1��Y�M�E�$�*�*�T�1�2E�,F�F�E��m��A�a�D�	�z�!�|�,�C�!�$�*�*�T�1�"5�6�E����u�S�<�5�<�t�<�=�"�)�)�$�/�M&	0�N��%7��J�	J��]�	#� �"�"�	#��@��&�"�#'���8��!��"��"���C��D��s6�J4�5K�=K�,K'�4K�K$�#K$�'
K7�6K7)F)
rrrr�DEFAULT_VERSIONr0r4rG�classmethodrtrrrr*r*^s:�����(��"��@�NJ��NJrr*c�,�eZdZdZ				dd�Zd�Zd�Zy)rcaOWatch line entry.

    This will contain the attributes documented in uscan(1):

    :ivar url: The URL (possibly including the filename regex)
    :ivar matching_pattern: a filename regex, optional
    :ivar version: version policy, optional
    :ivar script: script to run, optional
    :ivar opts: a list of options, as strings
    Nc�R�||_||_||_||_|�g}||_yr#)rBrCr,rDr.)r/rBrCr,rDr=s      rr0zWatch.__init__�s2����� 0����������<��D���rc��|jj�d|j�d|j�d|j�d|j
�d|j�d�S)N�(z, matching_pattern=z
, version=z	, script=z, opts=�))�	__class__rrBrCr,rDr.r3s r�__repr__zWatch.__repr__s<�����'�'����4�3H�3H����d�k�k�4�<�<�
9�	:rc�.�t|t�sy|j|jk(xrj|j|jk(xrO|j|jk(xr4|j
|j
k(xr|j|jk(S)NF)�
isinstancercrBrCr,rDr.)r/�others  r�__eq__zWatch.__eq__s����%��'���	�	�T�X�X�%�.��&�&�$�*?�*?�?�.��
�
����-�.�������+�.��
�
����-�		/r)NNNN)rrrrr0r}r�rrrrcrc�s$��	�#'����
�:�/rrc)r�loggingr^�typingrrrrrrr	�ImportErrorrur�	getLoggerr$�	ExceptionrrZrr!r(�objectr*rcrrr�<module>r�s���$.��	�
	�
�
�
���
5�K�	&�:�
�
� 
��	�	�>�	*��(�Y�(��:��
�"�IJ��IJ�X*/�F�*/��Q�	��	�s�A,�,A4�3A4

Zerion Mini Shell 1.0