ok

Mini Shell

Direktori : /opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyc

�
Bu�_c@`s�dZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZm
Z
ddlmZer�ddlmZmZmZmZmZmZmZed�Zdefd	��YZnyddlZWn]ek
rdydd
lmZWqeek
r`ddlZeje_ej e_!qeXnXddd
dddddgZ"ej#e$�Z%er�ddl&Z&y
e&j'Z'Wne(k
r�dZ'nXe'dk	Z*ne+Z*ddl,m'Z'erd�Z-ej.de-�dZ/ndZ/d�Z0dd�Z1d�Z2d�Z3d�Z4dddhZ5e
j6j7d�p�e
j6d ko�ej8d!kZ9d"�Z:e;e	d�r�d#�Z<n	d$�Z<dd%�Z=e>ed&e=�Z?dS('sKStuff that differs in different Python versions and platform
distributions.i(tabsolute_importtdivisionN(tPY2t	text_type(tMYPY_CHECK_RUNNING(tCallabletOptionaltProtocoltTexttTupletTypeVartUniontFtLruCachecB`seZdd�ZRS(cC`s
t�dS(N(tNotImplementedError(tselftmaxsize((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyt__call__sN(t__name__t
__module__tNoneR(((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyR
s(t	ipaddressRtuses_pycachetconsole_to_strtget_path_uidtstdlib_pkgstWINDOWStsamefiletget_terminal_size(tcache_from_sourcec`sW�fd�t�j�j�D�}d�|D�}djtdj|���jfS(Nc3`s|]}�j|VqdS(N(tobject(t.0ti(terr(sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pys	<genexpr>Iscs`s|]}t|�VqdS(N(tord(Rtb((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pys	<genexpr>Ksuu\x{:x}(trangetstarttendtjointmaptformat(R!t	raw_bytes((R!sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pytbackslashreplace_decode_fnHs%tbackslashreplace_decodetbackslashreplacecC`s<yddl}tSWntk
r'nXddlm}|S(Ni(tIS_PYOPENSSL(t_ssltTruetImportErrortpip._vendor.urllib3.utilR.(R/R.((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pythas_tlsVs
cC`s�t|t�r|Stj�}|s>tj|�jdkrGd}ny|j|�}Wn?tk
r�t	j
d|p|d|�|j|dt�}nXttt
dd	�dd	�}|r�|j|dd�}|j|�}n|S(
s�
    For display or logging purposes, convert a bytes object (or text) to
    text (e.g. unicode in Python 2) safe for output.

    :param desc: An optional phrase describing the input data, for use in
        the log message if a warning is logged. Defaults to "Bytes object".

    This function should never error out and so can take a best effort
    approach. It is okay to be lossy if needed since the return value is
    just for display.

    We assume the data is in the locale preferred encoding. If it won't
    decode properly, we warn the user but decode as best we can.

    We also ensure that the output can be safely written to standard output
    without encoding errors.
    tasciisutf-8s&%s does not appear to be encoded as %ssBytes objectterrorst
__stderr__tencodingR-N(t
isinstanceRtlocaletgetpreferredencodingtcodecstlookuptnametdecodetUnicodeDecodeErrortloggertwarningR,tgetattrtsysRtencode(tdatatdescR7tdecoded_datatoutput_encodingtoutput_encoded((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pytstr_to_displaybs*	
		cC`st|dd�S(s<Return a string, safe for output, of subprocess output.
    RFsSubprocess output(RJ(RE((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyR�scC`s�ttd�rMtj|tjtjB�}tj|�j}tj|�n<tjj	|�sttj
|�j}ntdj|���|S(s)
    Return path's uid.

    Does not follow symlinks:
        https://github.com/pypa/pip/pull/935#discussion_r5307003

    Placed this function in compat due to differences on AIX and
    Jython, that should eventually go away.

    :raises OSError: When path is a symlink or can't be read.
    t
O_NOFOLLOWs1{} is a symlink; Will not return uid for symlinks(
thasattrtostopentO_RDONLYRKtfstattst_uidtclosetpathtislinktstattOSErrorR)(RStfdtfile_uid((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyR�s
cC`sAtjj|�}|jd�r=|jd�r=|d}n|S(sm
    Expand ~ and ~user constructions.

    Includes a workaround for https://bugs.python.org/issue14768
    s~/s//i(RMRSt
expandusert
startswith(RStexpanded((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyRY�s
tpythontwsgireftargparsetwintclitntcC`sottjd�r%tjj||�Stjjtjj|��}tjjtjj|��}||kSdS(s>Provide an alternative for os.path.samefile on Windows/Python2RN(RLRMRSRtnormcasetabspath(tfile1tfile2tpath1tpath2((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyR�s
cC`sttj��S(s�
        Returns a tuple (x, y) representing the width(x) and the height(y)
        in characters of the terminal window.
        (ttupletshutilR(((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyR�scC`s�d�}|d�p*|d�p*|d�}|s�tjdkr�y8tjtj�tj�}||�}tj|�Wq�tk
r�q�Xq�n|s�tjj	dd�tjj	dd	�f}nt
|d�t
|d�fS(
s�
        Returns a tuple (x, y) representing the width(x) and the height(y)
        in characters of the terminal window.
        cS`suyLddl}ddl}ddl}|jd|j||jd��}Wntk
r`dSX|dkrqdS|S(Nithht12345678(ii(tfcntlttermioststructtunpack_fromtioctlt
TIOCGWINSZt	ExceptionR(RWRlRmRntcr((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pytioctl_GWINSZ�s
iiitwin32tLINESitCOLUMNSiP(RCtplatformRMRNtctermidRORRRrtenvirontgettint(RtRsRW((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyR�s	$

-cC`s
d�}|S(NcS`s|S(N((tf((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyt_wrappers((RR~((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pytnoop_lru_caches	t	lru_cache(@t__doc__t
__future__RRR;t	functoolsR9tloggingRMRiRCtpip._vendor.sixRRtpip._internal.utils.typingRttypingRRRRR	R
RRR
RR1tpip._vendortipaddrt	IPAddresst
ip_addresst	IPNetworkt
ip_networkt__all__t	getLoggerRR@timpRtAttributeErrorRRR0timportlib.utilR+tregister_errorR,R3RJRRRYRRxRZR=RRRLRRRBR�(((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/compat.pyt<module>sp4

	


			C					$

Zerion Mini Shell 1.0