????

Your IP : 216.73.216.152


Current Path : /proc/self/root/lib/python2.7/site-packages/wheel/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/wheel/util.pyc

�
��]c@s�dZddlZddlZddlZddlZddlZyddlmZWnek
roe	ZnXdddddd	gZ
d
�Zd�Zd�Z
d
�Zd�Zyed�ZWnek
r�d�ZnXyed�Zd�ZWn#ek
r"d�Zd�ZnXdefd��YZdefd��YZejdkr�ddlZe	dddddd�Zd �Zd!�Zd"�Znd#�Zd$�Zd%�ZdS(&sUtility functions.i����N(tOrderedDictturlsafe_b64encodeturlsafe_b64decodetutf8tto_jsont	from_jsontmatches_requirementcCstj|�jtd��S(s!urlsafe_b64encode without paddingt=(tbase64Rtrstriptbinary(tdata((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyRscCs)ddt|�d@}tj||�S(s!urlsafe_b64decode without paddingRii(tlenRR(Rtpad((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyRscCstj|dt�S(sConvert given data to JSON.t	sort_keys(tjsontdumpstTrue(to((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyRscCs
tj|�S(sDecode a JSON payload.(Rtloads(tj((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR scCsItjddkr"i}d}nidd6}d}t||||�S(Niitbttnewline(tsystversion_infotopen(tnametmodetnltbin((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pytopen_for_csv$s	
cCs t|t�r|jd�S|S(sUtf-8 encode data.sutf-8(t
isinstancetunicodetencode(R((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR0s
cCs t|t�r|jd�S|S(sUtf-8 encode data.sutf-8(R tstrR"(R((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR6s
cCs|S(N((ts((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pytnativeAscCs t|t�r|jd�S|S(Ntascii(R R!R"(R$((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR
Cs
cCs t|t�r|jd�S|S(NR&(R tbytestdecode(R$((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR%Hs
cCs t|t�r|jd�SdS(NR&(R R#R"(R$((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR
LstHashingFilecBs/eZdd�Zd�Zd�Zd�ZRS(tsha256cCs1||_||_tj|�|_d|_dS(Ni(tfdthashtypethashlibtnewthashtlength(tselfR+R,((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyt__init__Qs		cCs9|jj|�|jt|�7_|jj|�dS(N(R/tupdateR0RR+twrite(R1R((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR4VscCs|jj�dS(N(R+tclose(R1((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR5ZscCsF|jdkr|jj�S|jj�}|jdtt|��S(Ntmd5R(R,R/t	hexdigesttdigestR%R(R1R8((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR8\s
(t__name__t
__module__R2R4R5R8(((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR)Ps		tOrderedDefaultDictcBseZd�Zd�ZRS(cOsu|sd|_nF|ddkp/t|d�sAtd��n|d|_|d}tt|�j||�dS(Nis'first argument must be callable or Nonei(tNonetdefault_factorytcallablet	TypeErrortsuperR;R2(R1targstkwargs((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR2cs 

cCs6|jdkrt|��n|j�||<}|S(N(R=R<tKeyError(R1tkeytdefault((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyt__missing__ms(R9R:R2RF(((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR;bs	
twin32t
CSIDL_APPDATAitCSIDL_LOCAL_APPDATAitCSIDL_COMMON_APPDATAi#cCsEd}tjtjj�}tjjjdt|d||�|jS(Ni(	tctypestcreate_unicode_buffertwintypestMAX_PATHtwindlltshell32tSHGetFolderPathWtcsidltvalue(RtSHGFP_TYPE_CURRENTtbuf((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pytget_pathys#cGsGtd�}tjj||�}tjj|�sCtj|�n|S(NRI(RVtostpathtjointisdirtmakedirs(tresourcetappdataRX((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pytsave_config_paths
cgs\ddg}xI|D]A}t|�}tjj||�}tjj|�r|VqqWdS(NRIRJ(RVRWRXRYtexists(R\tidstidtbaseRX((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pytload_config_paths�s
cGsddl}|jj|�S(Ni����(txdg.BaseDirectoryt
BaseDirectoryR^(R\txdg((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR^�scGsddl}|jj|�S(Ni����(RdReRc(R\Rf((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyRc�scCs�yddlm}m}Wntk
r9td��nX|j|�}g}xZ|D]R}|j}|d|jd�d|jd��}||krV|j|�qVqVW|S(s�List of wheels matching a requirement.

    :param req: The requirement to satisfy
    :param wheels: List of wheels to search.
    i����(tDistributiontRequirements-Cannot use requirements without pkg_resourcestproject_nameRtversiontver(	t
pkg_resourcesRgRhtImportErrortRuntimeErrortparsetparsed_filenametgrouptappend(treqtwheelsRgRhtselectedtwftftdist((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyR�s

	'( t__doc__RRWRRR-tcollectionsRRmtdictt__all__RRRRRR!Rt	NameErrorR%R
tobjectR)R;tplatformtctypes.wintypesRKRRRVR^RcR(((s)/tmp/pip-build-tmgNo5/wheel/wheel/util.pyt<module>sP