%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/python3/debpython/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/python3/debpython/__pycache__/version.cpython-312.pyc

�

���f�7����ddlZddlZddlmZddlmZddlmZddlm	Z	dZ
eje
�Zejdej�Zeje�Zej$d�Zej$d	�ZeresSe�Zej-d
�esej%dd�d
dZes"ej%dd�j/dd�Z	ed�ej3d�D��Z	ed�ej3d�D��ZGd�d�Zdd�Zd�Z d�Z!d�Z"d�Z#d�Z$d d�Z%y#e$rej9d�Y�YwxYw#e$rej9d�Y�VwxYw)!�N)�environ��exists)�ConfigParser)�
GeneratorTypez(-)?(\d\.\d+)(?:(-)(\d\.\d+)?)?z�
    (?P<major>\d+)\.?
    (?P<minor>\d+)?\.?
    (?P<micro>\d+)?[.\s]?
    (?P<releaselevel>alpha|beta|candidate|final)?[.\s]?
    (?P<serial>\d+)?�DEBPYTHON3_SUPPORTED�DEBPYTHON3_DEFAULTz"/usr/share/python3/debian_defaults�DEFAULTzdefault-version�zsupported-versions�python�c#�2K�|]}t|����y�w�N��int��.0�is  �'/usr/share/python3/debpython/version.py�	<genexpr>r5s����8�q�C��F�8����.zcannot read debian_defaultsc#�zK�|]3}td�|j�jd�D�����5y�w)c3�2K�|]}t|����y�wrr)r�js  rrz<genexpr>.<genexpr>9s����A�q�C��F�A�rrN)�tuple�strip�splitrs  rrr9s2����6���A�A�G�G�I�O�O�C�,@�A�A�6�s�9;�,c�h�eZdZ		dd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zdd�Zy)�VersionNc	��t|ttf�rdjd�|D��}t|t�rdD]}t||t
||���yt�}|d=|d=|rMtj|�}	|	r|	j�j�ngD]\}}|��	||��|||<�|j�D]$\}}|dk7r
|�t|�}t|||��&|jstd��y)Nrc3�2K�|]}t|����y�wr��strrs  rrz#Version.__init__.<locals>.<genexpr>Cs����3��S��V�3�r��major�minor�micro�releaselevel�serial�self�valuer*zmajor component is required)�
isinstancer�list�joinr!�setattr�getattr�locals�
VERSION_RE�match�	groupdict�itemsrr'�
ValueError)
r,r-r'r(r)r*r+�name�compr5s
          r�__init__zVersion.__init__@s���e�e�T�]�+��H�H�3�U�3�3�E��e�W�%�M�
:����d�G�E�4�$8�9�
:���x����L���M���$�$�U�+�E�<A�u���0�6�6�8�r�
'���e��$��d��);�!&�D��J�
'� �:�:�<�	'�K�D�%��~�%�%�*;��E�
���D�$��&�	'��z�z��:�;�;��c��t|j�}|j�|dj|j�z
}|S)z�Return major.minor or major string.

        >>> str(Version(major=3, minor=2, micro=1, releaselevel='final', serial=4))
        '3.2'
        >>> str(Version(major=2))
        '2'
        �.{})r%r'r(�format)r,�results  r�__str__zVersion.__str__Ws7���T�Z�Z����:�:�!��e�l�l�4�:�:�.�.�F��
r<c�*�tt|��Sr)�hash�repr)r,s r�__hash__zVersion.__hash__ds���D��J��r<c��dj|�}dD]*}t||�}|s|dzS|dj|�z
}�,|dzS)z�Return full version string.

        >>> repr(Version(major=3, minor=2, micro=1, releaselevel='final', serial=4))
        "Version('3.2.1.final.4')"
        >>> repr(Version(major=2))
        "Version('2')"
        zVersion('{})r)r*r+r>z'))r?r2)r,r@r9r-s    r�__repr__zVersion.__repr__gs`���%�%�d�+��7�	*�D��D�$�'�E�����}��
�e�l�l�5�)�)�F�		*�
��}�r<c��t|�}|j� |xjt|�z
c_|S|xjt|�z
c_|S)z�Return next version.

        >>> Version('3.1') + 1
        Version('3.2')
        >>> Version('2') + '1'
        Version('3')
        )r!r(r'r)r,�otherr@s   r�__add__zVersion.__add__wsI�������:�:���L�L�C��J�&�L��
�
�L�L�C��J�&�L��
r<c��t|�}|j�+|xjt|�zc_|j}n*|xjt|�zc_|j}|dkrt	d��|S)z�Return previous version.

        >>> Version('3.1') - 1
        Version('3.0')
        >>> Version('3') - '1'
        Version('2')
        rzcannot decrease version further)r!r(r'rr8)r,rIr@�news    r�__sub__zVersion.__sub__�se�������:�:���L�L�C��J�&�L��,�,�C��L�L�C��J�&�L��,�,�C���7��>�?�?��
r<c�*�|j|�dk(S�Nr��
_Version__cmp�r,rIs  r�__eq__zVersion.__eq__�����z�z�%� �A�%�%r<c�*�|j|�dkSrOrPrRs  r�__lt__zVersion.__lt__�����z�z�%� �1�$�$r<c�*�|j|�dkSrOrPrRs  r�__le__zVersion.__le__�rTr<c�*�|j|�dkDSrOrPrRs  r�__gt__zVersion.__gt__�rWr<c�*�|j|�dk\SrOrPrRs  r�__ge__zVersion.__ge__�rTr<c��t|t�st|�}|j�|j�|j|d��dkS|j|d��dkS)akCompare major.minor or major only (if minor is not set).

        >>> Version('2.6') << Version('2.7')
        True
        >>> Version('2.6') << Version('2.6.6')
        False
        >>> Version('3') << Version('2')
        False
        >>> Version('3.1') << Version('2')
        False
        >>> Version('2') << Version('3.2.1.alpha.3')
        True
        r(��ignorerr)�r.r!r(rQrRs  r�
__lshift__zVersion.__lshift__��Z���%��)��E�N�E��:�:�����!4��:�:�e�G�:�4�q�8�8��:�:�e�G�:�4�q�8�8r<c��t|t�st|�}|j�|j�|j|d��dkDS|j|d��dkDS)aoCompare major.minor or major only (if minor is not set).

        >>> Version('2.6') >> Version('2.7')
        False
        >>> Version('2.6.7') >> Version('2.6.6')
        False
        >>> Version('3') >> Version('2')
        True
        >>> Version('3.1') >> Version('2')
        True
        >>> Version('2.1') >> Version('3.2.1.alpha.3')
        False
        r(r_rr)rarRs  r�
__rshift__zVersion.__rshift__�rcr<c��t|t�st|�}dD]k}||k(ryt||�xsd}t||�xsd}|dk(r+ddddd�}|j|d�}|j|d�}||k(r�`||kD||kz
cSy)Nr&rr*���������)�alpha�beta�	candidate�final)r.r!r2�get)r,rIr`r9�value1�value2�rmaps       r�__cmpz
Version.__cmp�s����%��)��E�N�E�I�	9�D��v�~����T�4�(�-�A�F��U�D�)�.�Q�F��~�%�!#�R�b�1�M�����&�!�,�����&�!�,�������V�O����8�8�	9�r<)NNNNNNr)�__name__�
__module__�__qualname__r;rArErGrJrMrSrVrYr[r]rbrerQ�r<rr!r!?sN��AE�+/�<�.� �� 
��&&�%�&�%�&�9�*9�*r<r!c����t|t�rt|�}|rt|�ddgk(rt	t
�}nU|d�dn|d�|d�dn|d���k(rt	�t
vr�fn	t
��}nt	��fd�t
D��}|rt	d�|D��}|S|durt	d	�|D��}|S)
aJReturn a set of requested and supported Python versions.

    :param available: if set to `True`, return installed versions only,
        if set to `False`, return requested versions that are not installed.
        By default returns all requested versions.
    :type available: bool

    >>> sorted(get_requested_versions([(3, 0), None]))
    [(3, 2), (3, 3)]
    >>> sorted(get_requested_versions('')) == sorted(SUPPORTED)
    True
    >>> sorted(get_requested_versions([None, None])) == sorted(SUPPORTED)
    True
    >>> get_requested_versions([(5, 0), None]) == set()
    True
    Nr)rr�)�cryc3�@�K�|]}�|cxkr�ks�nn|���y�wrrv)r�v�maxv�minvs  ��rrz)get_requested_versions.<locals>.<genexpr>s�����D��4�1�3C�t�3C�1�D�s��
c3�<K�|]}td|z�r|���y�w�z/usr/bin/python%d.%dNr�rr{s  rrz)get_requested_versions.<locals>.<genexpr>s%����>�Q� �!7�!�!;�<��>���Fc3�<K�|]}td|z�s|���y�wrrr�s  rrz)get_requested_versions.<locals>.<genexpr>s'����B�Q�$�%;�a�%?�@��B�r�)r.r%�parse_vranger/�set�	SUPPORTEDr)�vrange�	available�versionsr|r}s   @@r�get_requested_versionsr��s����"�&�#���f�%���T�&�\�d�D�\�1��y�>�����*�v��q�	��!�!�9�,�x�&��)���4�<��d�i�&7�D�7�U�W�E�H��D�i�D�D�H���>�(�>�>���O�	
�e�	��B�(�B�B���Or<c��|dvrytj|�}|std|z��|j�}t	|�jd�dk(r(t
d�|djd�D��}||fSdx}}|d	r|d}n
|d}|d}|r!t
d
�|jd�D��nd}|r!t
d�|jd�D��nd}|r|r||kDrtd|z��||fS)a�Return minimum and maximum Python version from given range.

    >>> parse_vrange('3.0-')
    ((3, 0), None)
    >>> parse_vrange('3.1-3.3')
    ((3, 1), (3, 3))
    >>> parse_vrange('3.2-4.0')
    ((3, 2), (4, 0))
    >>> parse_vrange('-3.7')
    (None, (3, 7))
    >>> parse_vrange('3.2')
    ((3, 2), (3, 2))
    >>> parse_vrange('') == parse_vrange('-') == (None, None)
    True
    )r
�-�NNzversion range is invalid: %sN�c3�2K�|]}t|����y�wrrrs  rrzparse_vrange.<locals>.<genexpr>%s����:��S��V�:�rrxrrc3�2K�|]}t|����y�wrrrs  rrzparse_vrange.<locals>.<genexpr>/�����1�A��Q��1�rc3�2K�|]}t|����y�wrrrs  rrzparse_vrange.<locals>.<genexpr>0r�r)�RANGE_REr5r8�groupsr/�countrr)r-r5r�r}r|s     rr�r�s�� 
�	����N�N�5�!�E���7�%�?�@�@�
�\�\�^�F��F�|���$��1�$��:�V�A�Y�_�_�S�%9�:�:���T�z����D�4�
�a�y��a�y���a�y���a�y��59�5�1����C��1�1�t�D�59�5�1����C��1�1�t�D�������7�%�?�@�@���:�r<c�`�dx}}t�}|jd�D]�}|j�}tjd|�}|rd|jd�z}�@tjd|�}|rd|jd�z}�mtjd|�}|s��|j
d|jd�z���t|�dk(r&|j�}t|�t|�fS|s|rt|�d}|rt|�nd|rt|�fSdfS)	aParse X-Python3-Version.

    >>> parse_pycentral_vrange('>= 3.1')
    ((3, 1), None)
    >>> parse_pycentral_vrange('<< 4.0')
    (None, (4, 0))
    >>> parse_pycentral_vrange('3.1')
    ((3, 1), (3, 1))
    >>> parse_pycentral_vrange('3.1, 3.2')
    ((3, 1), None)
    Nrz>=\s*([\d\.]+)z%.3srxz<<\s*([\d\.]+)z	^[\d\.]+$r)r�rr�rer5�group�add�len�pop�getver�sorted)r-r}r|�	hardcoded�itemr5�vers       r�parse_pycentral_vranger�8s����D�4���I����C� �
3���z�z�|�����*�D�1����E�K�K��N�*�D�����*�D�1����E�K�K��N�*�D������t�,����M�M�&�5�;�;�q�>�1�2�
3��9�~����m�m�o���c�{�F�3�K�'�'��I��i� ��#���6�$�<�T�4�6�$�<�I�I�T�I�Ir<c�j�|d|dcxur�y|d|dk(rdjd�|dD��S|d�ddjd�|dD��zS|d�djd�|dD��dzSdjd�|dD���ddjd	�|dD����S)
aMReturn version range string from given range.

    >>> vrange_str(((3, 4), None))
    '3.4-'
    >>> vrange_str(((3, 4), (3, 6)))
    '3.4-3.6'
    >>> vrange_str(((3, 4), (4, 0)))
    '3.4-4.0'
    >>> vrange_str((None, (3, 7)))
    '-3.7'
    >>> vrange_str(((3, 5), (3, 5)))
    '3.5'
    >>> vrange_str((None, None))
    '-'
    rrxr�rc3�2K�|]}t|����y�wrr$rs  rrzvrange_str.<locals>.<genexpr>v�����2�1��A��2�rc3�2K�|]}t|����y�wrr$rs  rrzvrange_str.<locals>.<genexpr>xs����8��c�!�f�8�rc3�2K�|]}t|����y�wrr$rs  rrzvrange_str.<locals>.<genexpr>zr�rc3�2K�|]}t|����y�wrr$rs  rrzvrange_str.<locals>.<genexpr>|�����"=�a�3�q�6�"=�rc3�2K�|]}t|����y�wrr$rs  rrzvrange_str.<locals>.<genexpr>}r�r)r0)r�s r�
vrange_strr�cs��� �a�y�F�1�I�%��&�
�a�y�F�1�I���x�x�2��q�	�2�2�2�	���	��S�X�X�8�f�Q�i�8�8�8�8�	���	��x�x�2��q�	�2�2�S�8�8��(�(�"=�6�!�9�"=�=��(�(�"=�6�!�9�"=�=�?�	?r<c�P�t|t�r|St|ttf�s+t|dt�rdjd�|D��Sg}|D]K}t|t�r|j
|��%|j
djd�|D����M|S)z�
    >>> vrepr(([3, 4], [3, 2]))
    ['3.4', '3.2']
    >>> vrepr(('2.6', '3.1'))
    ['2.6', '3.1']
    >>> vrepr('3.2')
    '3.2'
    >>> vrepr((3, 2))
    '3.2'
    rrc3�2K�|]}t|����y�wrr$rs  rrzvrepr.<locals>.<genexpr>�s����.�1��A��.�rc3�2K�|]}t|����y�wrr$rs  rrzvrepr.<locals>.<genexpr>�s����";�a�3�q�6�";�r)r.r%rr�rr0�append)r-r@�versions   r�vreprr��s����%�����
��
�s�3�
4��E�!�H�c�9R��x�x�.��.�.�.�
�F��=���g�s�#��M�M�'�"��M�M�#�(�(�";�7�";�;�<�	=�
�Mr<c�|�|syt|t�r|ddStd�|jdd�D��ddS)z�Return pair of integers that represent version.

    >>> getver('3.2')
    (3, 2)
    >>> getver('3.1.4')
    (3, 1)
    >>> getver((3, 3, 1))
    (3, 3)
    >>> getver(None)
    ''
    r
N�c3�2K�|]}t|����y�wrrrs  rrzgetver.<locals>.<genexpr>�s����5�A��Q��5�rr)r.rr)r-s rr�r��sC�����%����R�a�y���5����S�!�!4�5�5�b�q�9�9r<c��g}g}t|�D]I}t|t�rt|�}|tkr|j|��9|j|��K|j
t|��|r
|rt|�S|S)a�Return sorted list of versions starting with default Python
    version (if available) then list of suppored versions greater than default
    one followed by reversed list of older versions.

    List of versions sorted this way can be used in Depends field.

    :param vrepr: return string represenatations of versions, by default the
        same format is used as in :param:`versions`

    >>> debsorted([(2, 6), (3, 1), (3, 2), (3, 3), (2, 7)])[0] == DEFAULT
    True
    >>> debsorted(('2.4', '3.2', '2.6', '2.7'))[-1]
    (2, 4)
    >>> debsorted(set([(2, 1), (2, 2)]))
    [(2, 2), (2, 1)]
    >>> debsorted([(2, 1), (2, 2)], return_str=True)
    ['2.2', '2.1']
    )	r�r.r%r�r
r��extend�reversedr�)r��
return_strr@�old_versionsr�s     r�	debsortedr��s~��&�F��L��(�#�#���g�s�#��W�o�G��W������(��M�M�'�"�
#��M�M�(�<�(�)��f��V�}���Mr<r�r)&�loggingr��osr�os.pathr�configparserr�typesr�
RANGE_PATTERN�compiler��VERBOSEr4�	getLoggerrs�logrn�
_supported�_default�_config�read�replacerrr
�	Exception�	exceptionr�r!r�r�r�r�r�r�r�rvr<r�<module>r�s���,�	���%��2�
��2�:�:�m�$��
�R�Z�Z��
���%�
��g����!���W�[�[�/�
0�
��7�;�;�+�,�����n�G��L�L�5�6���;�;�y�*;�<�Q�R�@����[�[��,@�A�
�W�X�r�
"�	�1��8�H�N�N�3�$7�8�8�G�1��6�)�/�/��4�6�6�I�b�b�J%�P)�X(J�V?�:�2:�&��m�1��M�M�/�0�1��
�1��M�M�/�0�1�s$� D?�?E�?E�E�E4�3E4

Zerion Mini Shell 1.0