U
    
W[¨  ã                   @   sj   d Z ddlmZ ddlZddlmZ G dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZ	ddd„Z
dd„ ZdS )zf
A release-automation toolkit.

Don't use this outside of Twisted.

Maintainer: Christopher Armstrong
é    )Úprint_functionN)Ú	raw_inputc                   @   s   e Zd ZdZdS )ÚDirectoryExistsz2
    Some directory exists when it shouldn't.
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
   r
   ú8/usr/lib/python3/dist-packages/twisted/python/release.pyr      s   r   c                   @   s   e Zd ZdZdS )ÚDirectoryDoesntExistz6
    Some directory doesn't exist when it should.
    Nr   r
   r
   r
   r   r      s   r   c                   @   s   e Zd ZdS )ÚCommandFailedN)r   r   r   r
   r
   r
   r   r   %   s   r   TFc                 C   sF   t d| ƒ |r tdƒ d¡r dS |r,d|  } t | ¡dkrBt| ƒ‚dS )z½
    I'll try to execute C{command}, and if C{prompt} is true, I'll
    ask before running it.  If the command returns something other
    than 0, I'll raise C{CommandFailed(command)}.
    z--$zrun ?? ÚnNz%s > /dev/nullr   )Úprintr   Ú
startswithÚosÚsystemr   )ZcommandZnullÚpromptr
   r
   r   Úsh,   s    
r   c              	   O   s,   t j d¡}z| ||ŽW ¢S t  |¡ X d S )NÚ.)r   ÚpathÚabspathÚchdir)ÚfÚargsÚkwZorigdirr
   r
   r   ÚrunChdirSafe>   s    r   )TF)r	   Z
__future__r   r   Ztwisted.python.compatr   ÚOSErrorr   r   r   r   r   r
   r
   r
   r   Ú<module>   s   
