File "util.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyc
File size: 55.54 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


abc@sddlZddlmZddlZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZyddlZWnek
rdZnXddlZddlZddlZddlZddlZyddlZWnek
r9ddlZnXddlZddlmZddlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e
j1e2Z3dZ4e
j5e4Z6dZ7d	e7d
Z8e7dZ9dZ:d
e:de9de4d
e:de9dZ;dZ<de;de<de;dZ=e8d
e4e8dZ>de>dZ?de7de?de=dZ@e
j5e@ZAde:de9d
ZBe
j5eBZCdZDd ZEd!ZFd"ZGddd#ZHd$ZId%ZJd&ZKejLd'ZMejLd(ZNejLd)d*ZOd+ePfd,YZQd-ZRd.ePfd/YZSd0ZTd1ePfd2YZUe
j5d3e
jVZWd4ZXdd5ZYd6ZZd7Z[d8Z\d9Z]d:Z^e
j5d;e
j_Z`e
j5d<Zadd=Zbe
j5d>Zcd?Zdd@ZedAZfdBZgdCZhdDZidEePfdFYZjdGePfdHYZkdIePfdJYZldZmdendRZodSZpdZqdZePfd[YZre
j5d\Zse
j5d]Zte
j5d^Zud_Zd`ZverddalmwZxmyZymzZzdbe%j{fdcYZ{ddexfdeYZwdfewe(fdgYZ|nej}dh Z~e~dkrdje%jfdkYZerdle%jfdmYZqndne&jfdoYZerFdpe&jfdqYZndre&jfdsYZdtZduePfdvYZdwefdxYZdyefdzYZd{e)fd|YZd}ePfd~YZdZdS(iN(tdeque(tiglobi(tDistlibException(tstring_typest	text_typetshutilt	raw_inputtStringIOtcache_from_sourceturlopenturljointhttplibt	xmlrpclibt	splittypetHTTPHandlertBaseConfiguratortvalid_identt	ContainertconfigparsertURLErrortZipFiletfsdecodetunquotes\s*,\s*s
(\w|[.-])+s(\*|:(\*|\w+):|t)s\*?s([<>=!~]=)|[<>]t(s)?\s*(s)(s)\s*(s))*s(from\s+(?P<diref>.*))s\(\s*(?P<c1>t|s)\s*\)|(?P<c2>s\s*)s)*s\[\s*(?P<ex>s)?\s*\]s(?P<dn>s	\s*)?(\s*s)?$s(?P<op>s)\s*(?P<vn>c

Cskd}d}tj|}|rg|j}|d}|dpK|d}|dsad}nd}|dj}|sd}d}|d}	n{|ddkrd	|}ntj|}
g|
D]}||^q}d
|djg|D]}d|^qf}	|d
s$d}ntj	|d
}t
d|d|d|d|	d|d|}n|S(NcSs|j}|d|dfS(Ntoptvn(t	groupdict(tmtd((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_constraintYstdntc1tc2tdireftis<>!=s~=s%s (%s)s, s%s %stextnametconstraintstextrastrequirementtsourceturl(tNonetREQUIREMENT_REtmatchRtstriptRELOP_IDENT_REtfinditertjointCOMMA_REtsplitR(
tsRtresultRRR&tconsR+tconstrtrstiteratortconR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_requirementWs4	

	

0
	cCsd}i}x|D]\}}}tjj||}xt|D]}tjj||}	xt|	D]v}
|||
}|dkr|j|dqo|||
}|jtjjdjd}
|
d|||<qoWqGWqW|S(s%Find destinations for resources filescSs\|jtjjd}|jtjjd}|j|sEt|t|jdS(Nt/(treplacetostpathtsept
startswithtAssertionErrortlentlstrip(tbaseR@((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_rel_pathsR=N(	R?R@R2RR,tpopR>RAtrstrip(tresources_roottrulesRGtdestinationsRFtsuffixtdesttprefixtabs_basetabs_globtabs_patht
resource_filetrel_pathtrel_dest((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_resources_dests|s	!cCs:ttdrt}ntjttdtjk}|S(Ntreal_prefixtbase_prefix(thasattrtsystTrueROtgetattr(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytin_venvs	cCs7tjjtj}t|ts3t|}n|S(N(R?R@tnormcaseRZt
executablet
isinstanceRR(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_executables
cCs|}xwtrt|}|}|r7|r7|}n|r	|dj}||kr]Pn|r|d|||f}q|q	q	W|S(Nis	%c: %s
%s(R[Rtlower(tpromptt
allowed_charsterror_prompttdefaulttpR5tc((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytproceeds	
	cCsVt|tr|j}ni}x+|D]#}||kr+||||<q+q+W|S(N(R`RR4(RtkeysR6tkey((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytextract_by_keys
cCstjddkr+tjd|}n|j}t|}ytj|}|ddd}xo|jD]a\}}xR|jD]D\}}d||f}t	|}	|	dk	st|	||<qWqtW|SWn!tk
r|j
ddnXd}
tj}y|
||WnFtjk
rp|jtj|}t|}|
||nXi}xz|jD]l}i||<}xU|j|D]D\}
}d|
|f}t	|}	|	dk	st|	||
<qWqW|S(	Niisutf-8t
extensionsspython.exportstexportss%s = %scSs0t|dr|j|n
|j|dS(Nt	read_file(RYRotreadfp(tcptstream((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytread_streams(RZtversion_infotcodecst	getreadertreadRtjsontloadtitemstget_export_entryR,RCt	ExceptiontseekRtConfigParsertMissingSectionHeaderErrortclosettextwraptdedenttsections(RrtdatatjdataR6tgrouptentriestktvR5tentryRsRqRkR&tvalue((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytread_exportssD
	
cCstjddkr+tjd|}ntj}x|jD]\}}|j|x|jD]u}|j	dkr|j}nd|j|j	f}|jrd|dj
|jf}n|j||j|qjWqDW|j|dS(Niisutf-8s%s:%ss%s [%s]s, (RZRtRut	getwriterRR~Rztadd_sectiontvaluesRMR,ROtflagsR2tsetR&twrite(RnRrRqRRRR5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt
write_exportss
	ccs*tj}z	|VWdtj|XdS(N(ttempfiletmkdtempRtrmtree(ttd((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyttempdirs	ccs7tj}ztj|dVWdtj|XdS(N(R?tgetcwdtchdir(Rtcwd((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs

	iccs7tj}ztj|dVWdtj|XdS(N(tsockettgetdefaulttimeouttsetdefaulttimeout(tsecondstcto((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytsocket_timeouts

	tcached_propertycBseZdZddZRS(cCs
||_dS(N(tfunc(tselfR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__init__)scCs<|dkr|S|j|}tj||jj||S(N(R,Rtobjectt__setattr__t__name__(RtobjtclsR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__get__.s
N(Rt
__module__RR,R(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR(s	cCstjdkr|S|s|S|ddkr@td|n|ddkrctd|n|jd}x#tj|kr|jtjquW|stjStjj|S(sReturn 'pathname' as a name that will work on the native filesystem.

    The path is split on '/' and put back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    R=ispath '%s' cannot be absoluteispath '%s' cannot end with '/'(R?RAt
ValueErrorR4tcurdirtremoveR@R2(tpathnametpaths((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytconvert_path6s
tFileOperatorcBseZedZdZdZdZedZddZ
dZdZdZ
d	Zd
ZeeddZdZd
ZdZdZRS(cCs#||_t|_|jdS(N(tdry_runRtensuredt_init_record(RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRRs	cCs%t|_t|_t|_dS(N(tFalsetrecordRt
files_writtentdirs_created(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRWs	cCs |jr|jj|ndS(N(RRtadd(RR@((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytrecord_as_written\s	cCsitjj|s1tdtjj|ntjj|sGtStj|jtj|jkS(sTell if the target is newer than the source.

        Returns true if 'source' exists and is more recently modified than
        'target', or if 'source' exists and 'target' doesn't.

        Returns false if both exist and 'target' is the same age or younger
        than 'source'. Raise PackagingFileError if 'source' does not exist.

        Note that this test is not very accurate: files created in the same
        second will have the same "age".
        sfile '%r' does not exist(R?R@texistsRtabspathR[tstattst_mtime(RR*ttarget((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytnewer`scCs|jtjj|tjd|||jsd}|rtjj|r`d|}qtjj	|rtjj
|rd|}qn|rt|dntj
||n|j|dS(s8Copy a file respecting dry-run and force flags.
        sCopying %s to %ss%s is a symlinks%s is a non-regular files which would be overwrittenN(t
ensure_dirR?R@tdirnametloggertinfoRR,tislinkRtisfileRRtcopyfileR(Rtinfiletoutfiletchecktmsg((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt	copy_filets	
%cCstjj|st|jtjj|tjd|||js|dkrlt
|d}ntj
|dd|}ztj
||Wd|jXn|j|dS(NsCopying stream %s to %stwbtwtencoding(R?R@tisdirRCRRRRRR,topenRuRtcopyfileobjRR(RtinstreamRRt	outstream((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytcopy_streams	cCs[|jtjj||jsJt|d}|j|WdQXn|j|dS(NR(RR?R@RRRRR(RR@Rtf((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytwrite_binary_files
	cCsd|jtjj||jsSt|d}|j|j|WdQXn|j|dS(NR(	RR?R@RRRRtencodeR(RR@RRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytwrite_text_files
	cCstjdks-tjdkrtjdkrxj|D]_}|jrVtjd|q4tj|j|B|@}tjd||tj||q4WndS(Ntposixtjavaschanging mode of %sschanging mode of %s to %o(	R?R&t_nameRRRRtst_modetchmod(RtbitstmasktfilesRtmode((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytset_modes-
	cCs|jdd|S(Nimi(R(R5R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt<lambda>R$cCstjj|}||jkrtjj|r|jj|tjj|\}}|j|tj	d||j
stj|n|jr|j
j|qndS(NsCreating %s(R?R@RRRRR4RRRRtmkdirRR(RR@RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs"
		cCst||}tjd|||js|sD|j||r{|sSd}q{|j|sht|t|}nt	j
|||tn|j||S(NsByte-compiling %s to %s(
RRRRRR,RBRCRDt
py_compiletcompileR[R(RR@toptimizetforceROtdpathtdiagpath((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytbyte_compiles		
cCstjj|rtjj|rtjj|rtjd||js`tj	|n|j
r||jkr|jj|qqqtjj|rd}nd}tjd|||jstj|n|j
r||j
kr|j
j|qqndS(NsRemoving directory tree at %stlinktfilesRemoving %s %s(R?R@RRRRtdebugRRRRRRR(RR@R5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytensure_removeds"%					cCsjt}x]|setjj|r:tj|tj}Pntjj|}||kr\Pn|}q	W|S(N(RR?R@RtaccesstW_OKR(RR@R6tparent((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytis_writables	
cCs/|jst|j|jf}|j|S(sV
        Commit recorded changes, turn off recording, return
        changes.
        (RRCRRR(RR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytcommits
cCs|jsx9t|jD](}tjj|rtj|qqWt|jdt	}xq|D]f}tj
|}|r|dgksttjj||d}tj
|ntj
|qaWn|jdS(Ntreverset__pycache__i(RtlistRR?R@RRtsortedRR[tlistdirRCR2trmdirR(RRtdirsRtflisttsd((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytrollbacks	
N(RRRRRRRR[RR,RRRRtset_executable_modeRRRRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRQs 											
cCs|tjkrtj|}nt|}|dkr@|}nG|jd}t||jd}x|D]}t||}qnW|S(Nt.i(RZtmodulest
__import__R,R4R\RH(tmodule_nametdotted_pathtmodR6tpartsRg((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytresolves	
tExportEntrycBs;eZdZedZdZdZejZRS(cCs(||_||_||_||_dS(N(R&RORMR(RR&RORMR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs			cCst|j|jS(N(R
RORM(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRscCs d|j|j|j|jfS(Ns<ExportEntry %s = %s:%s %s>(R&RORMR(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__repr__!scCsdt|tst}nH|j|jko]|j|jko]|j|jko]|j|jk}|S(N(R`RRR&RORMR(RtotherR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__eq__%s	(	RRRRRRRRt__hash__(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs
			
s(?P<name>(\w|[-.+])+)
                      \s*=\s*(?P<callable>(\w+)([:\.]\w+)*)
                      \s*(\[\s*(?P<flags>\w+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])?
                      cCsStj|}|sId}d|ks3d|krOtd|qOn|j}|d}|d}|jd}|dkr|d}}n4|dkrtd|n|jd\}}|d	}	|	dkrd|ksd|kr	td|ng}	n(g|	jd
D]}
|
j^q"}	t||||	}|S(Nt[t]sInvalid specification '%s'R&tcallablet:iiRt,(	tENTRY_REtsearchR,RRtcountR4R/R(t
specificationRR6RR&R@tcolonsRORMRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR{7s2




	(cCs|d
krd}ntjdkrHdtjkrHtjjd}ntjjd}tjj|rtj|tj	}|st
jd|qnGytj|t
}Wn-tk
rt
jd|dt
t}nX|s	tj}t
jd	|ntjj||S(s
    Return the default base location for distlib caches. If the directory does
    not exist, it is created. Use the suffix provided for the base directory,
    and default to '.distlib' if it isn't provided.

    On Windows, if LOCALAPPDATA is defined in the environment, then it is
    assumed to be a directory, and will be the parent directory of the result.
    On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home
    directory - using os.expanduser('~') - will be the parent directory of
    the result.

    The result is just the directory '.distlib' in the parent directory as
    determined above, or with the name specified with ``suffix``.
    s.distlibtnttLOCALAPPDATAs
$localappdatat~s(Directory exists but is not writable: %ssUnable to create %stexc_infos#Default location unusable, using %sN(R,R?R&tenvironR@t
expandvarst
expanduserRRRRtwarningtmakedirsR[tOSErrorRRRR2(RMR6tusable((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_cache_baseVs&	



cCs`tjjtjj|\}}|r?|jdd}n|jtjd}||dS(s
    Convert an absolute path to a directory name for use in a cache.

    The algorithm used is:

    #. On Windows, any ``':'`` in the drive is replaced with ``'---'``.
    #. Any occurrence of ``os.sep`` is replaced with ``'--'``.
    #. ``'.cache'`` is appended.
    Rs---s--s.cache(R?R@t
splitdriveRR>RA(R@RRg((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytpath_to_cache_dirs

$cCs|jds|dS|S(NR=(tendswith(R5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytensure_slashscCskd}}d|kr^|jdd\}}d|krC|}q^|jdd\}}n|||fS(Nt@iR(R,R4(tnetloctusernametpasswordRO((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_credentialss
	cCs tjd}tj||S(Ni(R?tumask(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_process_umasks
cCsXt}d}x3t|D]%\}}t|tst}PqqW|dk	sTt|S(N(R[R,t	enumerateR`RRRC(tseqR6tiR5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytis_string_sequencess3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)s
-py(\d\.?\d?)cCsd}d}t|jdd}tj|}|r[|jd}||j }n|rt|t|dkrtj	tj
|d|}|r|j}|| ||d|f}qn|dkrtj	|}|r|jd|jd|f}qn|S(sw
    Extract name, version, python version from a filename (no extension)

    Return name, version, pyver or None
    t t-is\biN(
R,RR>tPYTHON_VERSIONRRtstartRDtreR.tescapetendtPROJECT_NAME_AND_VERSION(tfilenametproject_nameR6tpyverRtn((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytsplit_filenames""!'s-(?P<name>[\w .-]+)\s*\(\s*(?P<ver>[^\s)]+)\)$cCsRtj|}|s(td|n|j}|djj|dfS(s
    A utility method used to get name and version from a string.

    From e.g. a Provides-Dist value.

    :param p: A value in a form 'foo (1.0)'
    :return: The name and version as a tuple.
    s$Ill-formed name/version string: '%s'R&tver(tNAME_VERSION_RER.RRR/Rb(RgRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_name_and_versions
	cCs	t}t|pg}t|p'g}d|krS|jd||O}nx|D]}|dkr||j|qZ|jdr|d}||krtjd|n||kr|j|qqZ||krtjd|n|j|qZW|S(Nt*R6isundeclared extra: %s(RRRRBRR!(t	requestedt	availableR6trtunwanted((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt
get_extrass&	



cCsi}yqt|}|j}|jd}|jdsRtjd|n$tjd|}tj	|}Wn&t
k
r}tjd||nX|S(NsContent-Typesapplication/jsons(Unexpected response for JSON request: %ssutf-8s&Failed to get external data for %s: %s(R	RtgetRBRRRuRvRxRyR|t	exception(R+R6tresptheaderstcttreaderte((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt_get_external_datass'https://www.red-dove.com/pypi/projects/cCs9d|dj|f}tt|}t|}|S(Ns%s/%s/project.jsoni(tupperR
t_external_data_base_urlRR(R&R+R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_project_datascCs6d|dj||f}tt|}t|S(Ns%s/%s/package-%s.jsoni(RSR
RTRR(R&tversionR+((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_package_datastCachecBs)eZdZdZdZdZRS(s
    A class implementing a cache for resources that need to live in the file system
    e.g. shared libraries. This class was moved from resources to here because it
    could be used by other modules, e.g. the wheel module.
    cCsvtjj|s"tj|ntj|jd@dkrQtjd|ntjjtjj	||_
dS(su
        Initialise an instance.

        :param base: The base directory where the cache should be located.
        i?isDirectory '%s' is not privateN(R?R@RR"RRRR!RtnormpathRF(RRF((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR"s
cCs
t|S(sN
        Converts a resource prefix to a directory name in the cache.
        (R'(RRO((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt
prefix_to_dir0scCsg}xtj|jD]}tjj|j|}yZtjj|s^tjj|rntj|n"tjj|rt	j
|nWqtk
r|j|qXqW|S(s"
        Clear the cache.
        (
R?RRFR@R2RRRRRRR|tappend(Rtnot_removedtfn((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytclear6s$
(RRt__doc__RRZR^(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRXs		t
EventMixincBs>eZdZdZedZdZdZdZRS(s1
    A very simple publish/subscribe system.
    cCs
i|_dS(N(t_subscribers(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRKscCs\|j}||kr+t|g||<n-||}|rK|j|n
|j|dS(s`
        Add a subscriber for an event.

        :param event: The name of an event.
        :param subscriber: The subscriber to be added (and called when the
                           event is published).
        :param append: Whether to append or prepend the subscriber to an
                       existing subscriber list for the event.
        N(RaRR[t
appendleft(Rteventt
subscriberR[tsubstsq((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRNs
	
cCs=|j}||kr(td|n||j|dS(s
        Remove a subscriber for an event.

        :param event: The name of an event.
        :param subscriber: The subscriber to be removed.
        sNo subscribers: %rN(RaRR(RRcRdRe((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRbs	cCst|jj|dS(s
        Return an iterator for the subscribers for an event.
        :param event: The event to return subscribers for.
        ((titerRaRK(RRc((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_subscribersnscOsg}xa|j|D]P}y||||}Wn$tk
rXtjdd}nX|j|qWtjd|||||S(s^
        Publish a event and return a list of values returned by its
        subscribers.

        :param event: The event to publish.
        :param args: The positional arguments to pass to the event's
                     subscribers.
        :param kwargs: The keyword arguments to pass to the event's
                       subscribers.
        s"Exception during event publications/publish %s: args = %s, kwargs = %s, result = %sN(RhR|RRLR,R[R(RRctargstkwargsR6RdR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytpublishus


	(	RRR_RR[RRRhRk(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR`Gs			t	SequencercBsheZdZdZedZdZdZdZdZ	e
dZe
dZRS(	cCs"i|_i|_t|_dS(N(t_predst_succsRt_nodes(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs		cCs|jj|dS(N(RoR(Rtnode((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytadd_nodescCs
||jkr"|jj|n|r	x3t|jj|dD]}|j||qDWx3t|jj|dD]}|j||qzWx6t|jjD]\}}|s|j|=qqWx9t|jjD]\}}|s|j|=qqWndS(N(((RoRRRmRKRnRRz(RRptedgesRgR5RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytremove_nodes""""cCsT||kst|jj|tj||jj|tj|dS(N(RCRmt
setdefaultRRRn(Rtpredtsucc((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRscCs||ksty|j|}|j|}Wn!tk
rStd|nXy|j||j|Wn'tk
rtd||fnXdS(Ns%r not a successor of anythings%r not a successor of %r(RCRmRntKeyErrorRR(RRuRvtpredstsuccs((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs



cCs+||jkp*||jkp*||jkS(N(RmRnRo(Rtstep((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytis_stepscCs|j|s"td|ng}g}t}|j|x|r|jd}||kr||kr|j||j|qqG|j||j||jj|d}|j	|qGWt
|S(NsUnknown: %ri((R{RRR[RHRRRmRKtextendtreversed(RtfinalR6ttodotseenRzRx((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt	get_stepss"	
	


csydggiig|jfdx'D]}|krR|qRqRWS(Nics@d|<d|<dcd7<j|y|}Wntk
r`g}nXxl|D]d}|kr|t|||<qh|krht|||<qhqhW||kr<g}x3trj}|j|||krPqqWt|}j|ndS(Nii(R[R|tminR[RHttuple(Rpt
successorst	successortconnected_componentt	component(tgraphtindext
index_countertlowlinksR6tstackt
strongconnect(s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs.




"	
(Rn(RRp((RRRRR6RRs</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytstrong_connectionss		!"
cCsdg}xF|jD];}|j|}x%|D]}|jd||fq-WqWx"|jD]}|jd|q\W|jddj|S(Nsdigraph G {s  %s -> %s;s  %s;t}s
(RmR[RoR2(RR6RvRxRuRp((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytdot
s	


(
RRRRqRRsRRR{RtpropertyRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRls				
		3s.tar.gzs.tar.bz2s.tars.zips.tgzs.tbzs.whlc
sfd}tjjtd}|dkr|jdrZd}q|jdrxd}d}q|jdrd}d}q|jd
rd}d}qtd|nz|dkrt|d}|rZ|j}x|D]}||qWqZnBt	j
||}|rZ|j}x|D]}||qCWn|dkrtj
ddkrxA|jD]0}	t|	jts|	jjd|	_qqWn|jWd|r|jnXdS(Ncs|t|ts!|jd}ntjjtjj|}|jse|tjkrxt	d|ndS(Nsutf-8spath outside destination: %r(
R`RtdecodeR?R@RR2RBRAR(R@Rg(tdest_dirtplen(s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt
check_paths
!#s.zips.whltzips.tar.gzs.tgzttgzsr:gzs.tar.bz2s.tbzttbzsr:bz2s.tarttarRHsUnknown format for %riisutf-8(s.zips.whl(s.tar.gzs.tgz(s.tar.bz2s.tbz(R?R@RRDR,R(RRtnamelistttarfileRtgetnamesRZRtt
getmembersR`R&RRt
extractallR(
tarchive_filenameRtformatRRtarchiveRtnamesR&ttarinfo((RRs</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt	unarchivesH				

c	Cstj}t|}t|d}xutj|D]d\}}}xR|D]J}tjj||}||}	tjj|	|}
|j||
qPWq:WWdQX|S(s*zip a directory tree into a BytesIO objectRN(	tiotBytesIORDRR?twalkR@R2R(t	directoryR6tdlentzftrootRRR&tfulltrelRN((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytzip_dirSs

R$tKtMtGtTtPtProgresscBseZdZdddZdZdZdZdZedZ	ed	Z
d
ZedZedZ
RS(
tUNKNOWNiidcCsV|dks||kst||_|_||_d|_d|_t|_dS(Ni(	R,RCRtcurtmaxtstartedtelapsedRtdone(Rtminvaltmaxval((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRjs			cCs}|j|kst|jdks9||jks9t||_tj}|jdkri||_n||j|_dS(N(RRCRR,RttimeRR(Rtcurvaltnow((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytupdaters$	cCs*|dkst|j|j|dS(Ni(RCRR(Rtincr((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt	increment|scCs|j|j|S(N(RR(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR8scCs/|jdk	r"|j|jnt|_dS(N(RR,RR[R(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytstopscCs|jdkr|jS|jS(N(RR,tunknown(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytmaximumscCsZ|jrd}nD|jdkr*d}n,d|j|j|j|j}d|}|S(Ns100 %s ?? %gY@s%3d %%(RRR,RR(RR6R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt
percentages			"
cCsU|dkr|jdks-|j|jkr6d}ntjdtj|}|S(Nis??:??:??s%H:%M:%S(RR,RRRtstrftimetgmtime(RtdurationR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytformat_durations-	cCs|jrd}|j}nd}|jdkr9d}ne|jdksZ|j|jkrcd}n;t|j|j}||j|j:}|d|j}d||j|fS(NtDonesETA iiis%s: %s(RRRR,RRtfloatR(RROtt((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytETAs		!	cCsh|jdkrd}n|j|j|j}x(tD] }|dkrLPn|d:}q6Wd||fS(Nigig@@s%d %sB/s(RRRtUNITS(RR6tunit((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytspeeds	
(RRRRRRR8RRRRRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRgs	
					s\{([^}]*)\}s[^/\\,{]\*\*|\*\*[^/\\,}]s^[^{]*\}|\{[^}]*$cCsZtj|r(d}t||ntj|rPd}t||nt|S(sAExtended globbing function that supports ** and {opt1,opt2,opt3}.s7invalid glob %r: recursive glob "**" must be used alones2invalid glob %r: mismatching set marker '{' or '}'(t_CHECK_RECURSIVE_GLOBRRt_CHECK_MISMATCH_SETt_iglob(t	path_globR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRsccstj|d}t|dkrt|dksBt||\}}}x3|jdD]4}x+tdj|||fD]}|VqWqaWnd|krxt|D]}|VqWn|jdd\}}|dkrd}n|dkr	d}n|jd}|jd	}x]tj	|D]L\}}}	tj
j|}x(ttj
j||D]}
|
VqtWq7WdS(
NiiRR$s**RRER=s\(t	RICH_GLOBR4RDRCRR2t	std_iglobRER?RR@RY(Rtrich_path_globRORRMtitemR@tradicaltdirRR]((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs*%		"(tHTTPSHandlertmatch_hostnametCertificateErrortHTTPSConnectioncBseZdZeZdZRS(c
Cstj|j|jf|j}t|dtrI||_|jnt	t
ds|jrmt
j}n	t
j
}t
j||j|jd|dt
jd|j|_nt
jt
j}|jt
jO_|jr|j|j|jni}|jrHt
j|_|jd|jtt
dtrH|j|d<qHn|j|||_|jr|jry0t|jj|jtjd	|jWqtk
r|jjtj|jj qXndS(
Nt_tunnel_hostt
SSLContextt	cert_reqstssl_versiontca_certstcafiletHAS_SNItserver_hostnamesHost verified: %s(!Rtcreate_connectionthosttportttimeoutR\Rtsockt_tunnelRYtsslRt
CERT_REQUIREDt	CERT_NONEtwrap_sockettkey_filet	cert_filetPROTOCOL_SSLv23RtoptionstOP_NO_SSLv2tload_cert_chaintverify_modetload_verify_locationstcheck_domainRtgetpeercertRRRtshutdownt	SHUT_RDWRR(RRRtcontextRj((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytconnects>!	
					

N(RRR,RR[RR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRsRcBs&eZedZdZdZRS(cCs#tj|||_||_dS(N(tBaseHTTPSHandlerRRR(RRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR#s
	cOs7t||}|jr3|j|_|j|_n|S(s
            This is called to create a connection instance. Normally you'd
            pass a connection class to do_open, but it doesn't actually check for
            a class, and just expects a callable. As long as we behave just as a
            constructor would have, we should be OK. If it ever changes so that
            we *must* pass a class, we'll create an UnsafeHTTPSConnection class
            which just sets check_domain to False in the class definition, and
            choose which one to pass to do_open.
            (RRR(RRiRjR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt_conn_maker(s

	cCs_y|j|j|SWnAtk
rZ}dt|jkrTtd|jq[nXdS(Nscertificate verify faileds*Unable to verify server certificate for %s(tdo_openRRtstrtreasonRR(RtreqRQ((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt
https_open8s(RRR[RRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR"s	tHTTPSOnlyHandlercBseZdZRS(cCstd|dS(NsAUnexpected HTTP request on what should be a secure connection: %s(R(RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt	http_openLs(RRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRKsiitHTTPcBseZdddZRS(R$cKs5|dkrd}n|j|j|||dS(Ni(R,t_setupt_connection_class(RRRRj((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRXs	N(RRR,R(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR	WstHTTPScBseZdddZRS(R$cKs5|dkrd}n|j|j|||dS(Ni(R,R
R(RRRRj((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR`s	N(RRR,R(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR_st	TransportcBseZddZdZRS(icCs ||_tjj||dS(N(RRR
R(RRtuse_datetime((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRgs	cCs|j|\}}}tdkr<t|d|j}nN|jsY||jdkr}||_|tj|f|_n|jd}|S(NiiRii(ii(t
get_host_infot	_ver_infoR	Rt_connectiont_extra_headersRtHTTPConnection(RRthtehtx509R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytmake_connectionks	
(RRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR
fst
SafeTransportcBseZddZdZRS(icCs ||_tjj||dS(N(RRRR(RRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRxs	cCs|j|\}}}|s'i}n|j|d<tdkrUt|d|}nT|jsr||jdkr||_|tj|d|f|_n|jd}|S(NRiiii(ii(	RRRRR,RRRR(RRRRRjR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR|s	
	
(RRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRwstServerProxycBseZdZRS(c	Ks|jdd|_}|dk	rt|\}}|jdd}|dkr^t}nt}||d||d<}||_ntj	j
|||dS(NRRithttpst	transport(RHR,RR
RKRR
RRRR(	RturiRjRtschemet_RttclsR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs	(RRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRscKs:tjddkr |d7}n
d|d<t|||S(NiitbR$tnewline(RZRtR(R]RRj((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt	_csv_opens

tCSVBasecBsGeZiedd6edd6edd6ZdZdZRS(Rt	delimitert"t	quotechars
tlineterminatorcCs|S(N((R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt	__enter__scGs|jjdS(N(RrR(RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__exit__s(RRRtdefaultsR(R)(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR#s

	t	CSVReadercBs)eZdZdZdZeZRS(cKsd|krM|d}tjddkrAtjd|}n||_nt|dd|_tj|j|j|_dS(NRriisutf-8R@RH(	RZRtRuRvRrR"tcsvRPR*(RRjRr((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs
cCs|S(N((R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__iter__scCskt|j}tjddkrgxBt|D]1\}}t|ts/|jd||<q/q/Wn|S(Niisutf-8(tnextRPRZRtR1R`RR(RR6R3R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR.s(RRRR-R.t__next__(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR+s			t	CSVWritercBseZdZdZRS(cKs1t|d|_tj|j|j|_dS(NR(R"RrR,twriterR*(RR]Rj((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRscCsutjddkrag}x<|D]4}t|trG|jd}n|j|q W|}n|jj|dS(Niisutf-8(RZRtR`RRR[R1twriterow(RtrowRHR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR2s
	(RRRR2(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR0s	tConfiguratorcBsHeZeejZded<ddZdZdZdZ	RS(tinc_converttinccCs/tt|j||p%tj|_dS(N(tsuperR4RR?RRF(RtconfigRF((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRscs!fd|jd}t|s?j|}n|jdd}|jdd}|rtg|D]}|^qs}ng|D](}t|r|||f^q}t|}|||}	|rx3|jD]"\}
}t|	|
|qWn|	S(Ncst|ttfrCt|g|D]}|^q%}njt|trd|krpj|}qi}x4|D]}||||<q}Wnj|}|S(Ns()(R`RRttypetdicttconfigure_customtconvert(toR3R6R(R<R(s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR<s.
s()Rs[]((	RHRR
R,RRR:Rztsetattr(RR8RhtpropsRiR=RRzRjR6R@R((R<Rs</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR;s(5cCsI|j|}t|trEd|krE|j||j|<}n|S(Ns()(R8R`R:R;(RRkR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__getitem__s
cCsatjj|s-tjj|j|}ntj|ddd}tj|}WdQX|S(s*Default converter for the inc:// protocol.RHRsutf-8N(	R?R@tisabsR2RFRuRRxRy(RRRR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR5s
N(
RRR:Rtvalue_convertersR,RR;R@R5(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR4s
		tSubprocessMixincBs)eZeddZdZdZRS(cCs||_||_dS(N(tverbosetprogress(RRDRE((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs	cCs|j}|j}x{tr|j}|s1Pn|dk	rM|||q|sftjjdntjj|jdtjj	qW|j
dS(s
        Read lines from a subprocess' output stream and either pass to a progress
        callable (if specified) or write progress information to sys.stderr.
        Rsutf-8N(RERDR[treadlineR,RZtstderrRRtflushR(RRrRRERDR5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRP"s			cKstj|dtjdtj|}tjd|jd|jdf}|jtjd|jd|jdf}|j|j	|j
|j
|jdk	r|jddn|j
rtjjdn|S(NtstdoutRGRRisdone.tmainsdone.
(t
subprocesstPopentPIPEt	threadingtThreadRPRIR8RGtwaitR2RER,RDRZR(RtcmdRjRgtt1tt2((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytrun_command7s$
$



	N(RRRR,RRPRT(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRCs	cCstjdd|jS(s,Normalize a python package name a la PEP 503s[-_.]+R6(R9tsubRb(R&((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytnormalize_nameHs(s.tar.gzs.tar.bz2s.tars.zips.tgzs.tbzs.whl(R$RRRRR(ii(RutcollectionsRt
contextlibR,tglobRRRRxtloggingR?RR9RRRtImportErrorR,RKRZRRRRNtdummy_threadingRR$RtcompatRRRRRR	R
RRR
RRRRRRRRRt	getLoggerRRtCOMMARR3tIDENTtEXTRA_IDENTtVERSPECtRELOPtBARE_CONSTRAINTSt
DIRECT_REFtCONSTRAINTSt
EXTRA_LISTtEXTRAStREQUIREMENTR-tRELOP_IDENTR0R<RVR]RaRiRlRRtcontextmanagerRRRRRRRR
RtVERBOSERR{R%R'R)R.R0R4tIR<R7RARCRDRJRRRTRURWRXR`RltARCHIVE_EXTENSIONSR[RRRRRRRRRRRRRRRtRR	RR
RRR"R#R+R0R4RCRV(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt<module>s



.	%		
				/	
				)					
						,H6	]		*)	
	:+