CasperSecurity

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

o

���a%�@s�dZddlZddlmZzddlmZmZmZmZm	Z	m
Z
mZWn	ey)YnwdZ
dddd	d
�ZGdd�de�ZGd
d�de�Zdd�Zdd�ZGdd�de�ZGdd�de�ZdS)z'Functions for working with watch files.�N)�warn)�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@c@�eZdZdZdS)�MissingVersionzThe version= line is missing.N��__name__�
__module__�__qualname__�__doc__�rr�./usr/lib/python3/dist-packages/debian/watch.pyr:�rc@r)�WatchFileFormatErrorz(Raised when the input is not valid.
    Nr
rrrrr>rrcCs6tt���}||d<|��D]
\}}|�||�}q|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�vrrr�expandCs
rcCs|rt|��t|�dS�N)rr)�msg�strictrrr�	_complainTsr#c@s>eZdZdZddefdd�Zdd�Zdd�Zedd
d��Z	dS)
�	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
    NcCs.||_|dur	g}||_|durg}||_dSr )�version�entries�options)�selfr&r'r%rrr�__init__ds
zWatchFile.__init__cCs
t|j�Sr )�iterr&�r(rrr�__iter__qs
zWatchFile.__iter__cCs�dd�}|jdur|�d|j�|jr|�||j�d�|jD];}|jr0|�||j�d�|�|j�|jrA|�d|j�|jrL|�d|j�|jrW|�d|j�|�d�q!dS)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
        cSs.d�|�}d|vs
d|vrd|dSd|S)N�,� �	zopts="�"�opts=)�join)�opts�srrr�serialize_optionss
z)WatchFile.dump.<locals>.serialize_optionsNzversion=%d
�
r.)r%�writer'r&�url�matching_pattern�script)r(�fr5�entryrrr�dumpus"


�zWatchFile.dumpFc	Cs�g}g}|D]*}|�d�rq|��sq|�d��d�r$|�|�d��q|�|�|�|�g}q|r=td|�|�|�|sAdSd�|�d��}z
|�d	d
�\}}Wn
t	y]t
��w|��dkrgt
��t|���}	g}
g}|D]�}|	dkr�d
d�|D�}d�|���}|s�qs|�d�r�|ddkr�|�dd�}
|
dkr�t	d|��|d|
�}||
d
d�}n z|dd��dd
�\}}Wnt	y�|dd�}d}Ynw|�d�}ng}|�r4z
|�dd
�\}}Wn
t	y�|}d}Ynwt
�d|�}|�rt|d�ft|�dd
��}|dt|d�d
�}nt|�dd��}|�t|g|�Rd|i��qs|
�|�qs|||
|	d�S)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
        �#r6�\z
\z*watchfile ended with \; skipping last lineN�r�=�r%�cSsg|]}|���qSr)�lstrip)�.0�chunkrrr�
<listcomp>�sz(WatchFile.from_lines.<locals>.<listcomp>r1�r0����zNot matching " in %rr-z/([^/]*\([^/]*\)[^/]*)$�r3)r&r'r%)�
startswith�strip�rstrip�endswith�appendr#r2�pop�split�
ValueErrorr�int�index�re�findall�str�tuple�len�Watch�extend)�cls�linesr"�joined_lines�	continued�line�	firstline�key�valuer%�persistent_optionsr&�chunked�optend�opts_strr3r8�m�partsrrr�
from_lines�s�





�
���zWatchFile.from_lines)F)
rrrr�DEFAULT_VERSIONr)r,r=�classmethodrkrrrrr$[s	
�
 r$c@s2eZdZdZ				d	dd�Zdd�Zdd�ZdS)
r[aOWatch 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
    NcCs.||_||_||_||_|durg}||_dSr )r8r9r%r:r')r(r8r9r%r:r3rrrr)�s
zWatch.__init__cCs"d|jj|j|j|j|j|jfS)Nz;%s(%r, matching_pattern=%r, version=%r, script=%r, opts=%r))�	__class__rr8r9r%r:r'r+rrr�__repr__s
��zWatch.__repr__cCsJt|t�sdS|j|jko$|j|jko$|j|jko$|j|jko$|j|jkS)NF)�
isinstancer[r8r9r%r:r')r(�otherrrr�__eq__	s

�
�
�
�zWatch.__eq__)NNNN)rrrrr)rorrrrrrr[�s

�r[)rrV�warningsr�typingrrrrrrr	�ImportErrorrlr�	ExceptionrrSrrr#�objectr$r[rrrr�<module>s*(	��
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY