Your IP : 216.73.216.213


Current Path : /opt/alt/python27/lib/python2.7/site-packages/setuptools_git/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyc

�
\�Sc	@s�ddlZddlZddlZddlZddlZddlZejdkrpddlmZ	e
ZnddlmZ	dddddd	d
ddg	Z
ydd
lmZWn'ek
r�defd��YZnXyddlmZWnek
rd�ZnXyddlmZWnek
r@d�ZnXd�Zdd�Zd�Zd�Zd�Zd�Zd�ZdS(i����Ni(tquotet
check_calltcheck_outputtrmtreetbtposixtfsdecodet	hfs_quotetcomposet	decompose(tCalledProcessErrorR
cBs#eZdZdd�Zd�ZRS(s
        This exception is raised when a process run by check_call() or
        check_output() returns a non-zero exit status.

        The exit status will be stored in the returncode attribute;
        check_output() will also store the output in the output attribute.
        cCs||_||_||_dS(N(t
returncodetcmdtoutput(tselfRRR
((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyt__init__s		cCsd|j|jfS(Ns-Command '%s' returned non-zero exit status %d(RR(R((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyt__str__#sN(t__name__t
__module__t__doc__tNoneRR(((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyR
s(RcOscddlm}|||�}|jd�}|dkrG|d}n|r_t||��n|S(Ni����(tcalltargsi(t
subprocessRtgetRR
(t	popenargstkwargsRtretcodeR((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyR+s
(Rc	Os�ddlm}ddlm}d|kr;td��n|d|||�}|j�\}}|j�}|r�|jd�}|dkr�|d}nt||��n|S(Ni����(tPIPE(tPopentstdouts3stdout argument not allowed, it will be overridden.Ri(	RRRt
ValueErrortcommunicatetpollRRR
(	RRRRtprocessR
t
unused_errRR((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyR:s
cCsBtjdkr.d�}tj|t|�ntj|t�dS(Ntwin32cSs!tj|tj�||�dS(N(tostchmodtstattS_IWRITE(tfunctpathtexcinfo((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pytonerrorNs(tsystplatformtshutilRtFalse(R*R,((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyRLs	sutf-8cCs tjdkr|j|�S|S(Ni(i(R-tversion_infotencode(tstencoding((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyRWs
cCs)tjdkr%|jtjtj�S|S(NR$(R-R.treplaceR%tsept	posixpath(R*((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyR^scCsYtjdkrUt|t�sUtjdkr6d}nd}|jtj�|�Sn|S(NiR$tstricttsurrogateescape(i(R-R1t
isinstancetstrR.tdecodetgetfilesystemencoding(R*terrors((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyRes	cCstt|t�rtd��ny|jd�Wn>tk
rot|�}tjdkrp|jd�}qpnX|S(Nsbytes are requiredsutf-8itascii(i(	R:tunicodet	TypeErrorR<tUnicodeDecodeErrort	url_quoteR-R1R2(R*((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyRqs
cCskt|t�rtjd|�Sy4|jd�}tjd|�}|jd�}Wntk
rfnX|S(NtNFCsutf-8(R:R@tunicodedatat	normalizeR<R2tUnicodeError(R*((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyR~s
cCskt|t�rtjd|�Sy4|jd�}tjd|�}|jd�}Wntk
rfnX|S(NtNFDsutf-8(R:R@RERFR<R2RG(R*((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyR	�s
(i(R-R%R'R/RER7R1turllib.parseRRCR;R@turllibt__all__RR
tImportErrort	ExceptionRRRRRRRRR	(((sE/opt/alt/python27/lib/python2.7/site-packages/setuptools_git/utils.pyt<module>s<