%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/python/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/python/__pycache__/_release.cpython-312.pyc

�

Ϫ�fG"����dZddlZddlmZmZmZddlmZddlm	Z	m
Z
ddlmZd�Z
Gd�d	e	�Ze
e�Gd
�d��Zd�ZGd
�d�Zd�Zd�ZGd�de�Zd�ZGd�de�Zy)aL
Twisted's automated release system.

This module is only for use within Twisted's release system. If you are anyone
else, do not use it. The interface and behaviour will change without notice.

Only Linux is supported by this code.  It should not be used by any tools
which must run on multiple platforms (eg the setup.py script).
�N)�STDOUT�CalledProcessError�check_output)�Dict)�	Interface�implementer)�execfilec�,�t|d<t|fi|��S)a�Execute a vector of arguments.

    This is a wrapper around L{subprocess.check_output}, so it takes
    the same arguments as L{subprocess.Popen} with one difference: all
    arguments after the vector must be keyword arguments.

    @param args: arguments passed to L{subprocess.check_output}
    @param kwargs: keyword arguments passed to L{subprocess.check_output}
    @return: command output
    @rtype: L{bytes}
    �stderr)rr)�args�kwargss  �9/usr/lib/python3/dist-packages/twisted/python/_release.py�
runCommandrs���F�8����'��'�'�c�(�eZdZdZd�Zd�Zd�Zd�Zy)�IVCSCommandz(
    An interface for VCS commands.
    c��y)z�
        Ensure that C{path} is a working directory of this VCS.

        @type path: L{twisted.python.filepath.FilePath}
        @param path: The path to check.
        N���paths r�ensureIsWorkingDirectoryz$IVCSCommand.ensureIsWorkingDirectory-��rc��y)��
        Return the Git status of the files in the specified path.

        @type path: L{twisted.python.filepath.FilePath}
        @param path: The path to get the status from (can be a directory or a
            file.)
        Nrrs r�
isStatusCleanzIVCSCommand.isStatusClean5rrc��y)z�
        Remove the specified path from a the VCS.

        @type path: L{twisted.python.filepath.FilePath}
        @param path: The path to remove from the repository.
        Nrrs r�removezIVCSCommand.remove>rrc��y)a�
        Export the content of the VCSrepository to the specified directory.

        @type fromDir: L{twisted.python.filepath.FilePath}
        @param fromDir: The path to the VCS repository to export.

        @type exportDir: L{twisted.python.filepath.FilePath}
        @param exportDir: The directory to export the content of the
            repository to. This directory doesn't have to exist prior to
            exporting the repository.
        Nr��fromDir�	exportDirs  r�exportTozIVCSCommand.exportToFrrN)�__name__�
__module__�__qualname__�__doc__rrrr"rrrrr(s������rrc�P�eZdZdZed��Zed��Zed��Zed��Zy)�
GitCommandzJ
    Subset of Git commands to release Twisted from a Git repository.
    c��	tddg|j��y#ttf$rt	|j�d���wxYw)z�
        Ensure that C{path} is a Git working directory.

        @type path: L{twisted.python.filepath.FilePath}
        @param path: The path to check.
        �gitz	rev-parse)�cwdz( does not appear to be a Git repository.N)rrr�OSError�NotWorkingDirectoryrs rrz#GitCommand.ensureIsWorkingDirectoryZsJ��	���{�+����;��"�G�,�	�%��9�9�+�E�F��
�	�s	��(Ac�\�tdd|jddg�j�}|dk(S)rr*�-C�statusz--shortr)rr�strip)rr0s  rrzGitCommand.isStatusCleanis0���U�D�$�)�)�X�y�I�J�P�P�R����}�rc�T�tdd|j�d|jg�y)z�
        Remove the specified path from a Git repository.

        @type path: L{twisted.python.filepath.FilePath}
        @param path: The path to remove from the repository.
        r*r/�rmN)r�dirnamerrs rrzGitCommand.removeus!��	�E�4������t�y�y�A�Brc�X�tdd|jdddd|jdzg�y)	a�
        Export the content of a Git repository to the specified directory.

        @type fromDir: L{twisted.python.filepath.FilePath}
        @param fromDir: The path to the Git repository to export.

        @type exportDir: L{twisted.python.filepath.FilePath}
        @param exportDir: The directory to export the content of the
            repository to. This directory doesn't have to exist prior to
            exporting the repository.
        r*r/zcheckout-indexz--allz--forcez--prefix�/N)rrrs  rr"zGitCommand.exportTos8��	������ ��������$�
�
	
rN)	r#r$r%r&�staticmethodrrrr"rrrr(r(TsY��������	��	��C��C��
��
rr(c��	tj|�tS#ttf$rYnwxYwtd|j����)a�
    Detect the VCS used in the specified directory and return a L{GitCommand}
    if the directory is a Git repository. If the directory is not git, it
    raises a L{NotWorkingDirectory} exception.

    @type directory: L{FilePath}
    @param directory: The directory to detect the VCS used from.

    @rtype: L{GitCommand}

    @raise NotWorkingDirectory: if no supported VCS can be found from the
        specified directory.
    z!No supported VCS can be found in )r(rr-r,r��	directorys r�getRepositoryCommandr;�sL��
��+�+�I�6������)�
��
��� A�)�.�.�AQ�R�
S�Ss��/�/c�(�eZdZdZd�Zdefd�Zd�Zy)�ProjectaC
    A representation of a project that has a version.

    @ivar directory: A L{twisted.python.filepath.FilePath} pointing to the base
        directory of a Twisted-style Python package. The package should contain
        a C{_version.py} file and a C{newsfragments} directory that contains a
        C{README} file.
    c��||_y)Nr9)�selfr:s  r�__init__zProject.__init__�s	��"��r�returnc�N�|jj�d|j�d�S)N�(�))�	__class__r#r:)r?s r�__repr__zProject.__repr__�s%���.�.�)�)�*�!�D�N�N�+=�Q�?�?rc��i}|j}|sf|jdk(rtd��|j�dk(s|j	�}n%t|j
d�j|�|s�f|dS)z�
        @return: A L{incremental.Version} specifying the version number of the
            project based on live python modules.
        r6zNot inside a Twisted project.�twistedz_version.py�__version__)r:r�	Exception�basename�parentr	�child)r?�	namespacer:s   r�
getVersionzProject.getVersion�sw��
(*�	��N�N�	���~�~��$�� ?�@�@��'�'�)�Y�6�%�,�,�.�	������7�<�<�i�H�
���'�'rN)r#r$r%r&r@�strrFrOrrrr=r=�s���#�@�#�@�(rr=c��g}|j�D]@}|j�dk(s�|j�}|jt	|���B|S)z�
    Find all Twisted-style projects beneath a base directory.

    @param baseDirectory: A L{twisted.python.filepath.FilePath} to look inside.
    @return: A list of L{Project}.
    �
newsfragments)�walkrKrL�appendr=)�
baseDirectory�projects�filePath�projectDirectorys    r�findTwistedProjectsrY�sX���H�!�&�&�(�7������/�1�'���0���O�O�G�$4�5�6�7��Orc��tj||dz�t|dz�5}|j�}ddd�|j	�D]\}}j||�}�t|dzd�5}|j
�ddd�tj|dz|�tj|dz�y#1swY��xYw#1swY�GxYw)zP
    I replace the text `oldstr' with `newstr' in `filename' using science.
    z.bakNz.new�w)�os�rename�open�read�items�replace�write�unlink)�filename�oldToNew�f�d�k�vs      r�
replaceInFilerj�s����I�I�h��6�)�*�	
�h���	 ��A�
�F�F�H������ ����1�
�I�I�a��O���	
�h����	%���	����
���I�I�h����*��I�I�h��� ������s�C�:C�C�Cc��eZdZdZy)�NoDocumentsFoundz3
    Raised when no input documents are found.
    N�r#r$r%r&rrrrlrl�s��rrlc��d}|jjtj�}|jjtj�}t	||�D]\}}||k(r|dz
}�ndgt|�|z
z}|||dzS)a4
    Return a list of strings that represent C{destination} as a path relative
    to C{origin}.

    It is assumed that both paths represent directories, not files. That is to
    say, the delta of L{twisted.python.filepath.FilePath} /foo/bar to
    L{twisted.python.filepath.FilePath} /foo/baz will be C{../baz},
    not C{baz}.

    @type origin: L{twisted.python.filepath.FilePath}
    @param origin: The origin of the relative path.

    @type destination: L{twisted.python.filepath.FilePath}
    @param destination: The destination of the relative path.
    r�z..N)r�splitr\�sep�zip�len)�origin�destination�commonItems�path1�path2�elem1�elem2rs        r�
filePathDeltar{�s��� �K��K�K���b�f�f�%�E����"�"�2�6�6�*�E��E�5�)����u��E�>��1��K��	�

�6�S��Z�+�-�.�D��%���%�%�%rc��eZdZdZy)r-zf
    Raised when a directory does not appear to be a repository directory of a
    supported VCS.
    Nrmrrrr-r-s��rr-)r&r\�
subprocessrrr�typingr�zope.interfacerr�twisted.python.compatr	rrr(r;r=rYrjrJrlr{r-rrr�<module>r�s���
�
�?�?��1�*�
(� )�)�)�X
�[��D
�D
��D
�NT�0(�(�B�!��y��&�8�)�r

Zerion Mini Shell 1.0