ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyc

�
x�_c@@sVdZddlmZddlZddlZddlZddlZddlZddlm	Z
ddlmZddl
mZmZddlmZddlmZdd	lmZdd
lmZddlmZer�ddlmZdd
lmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(ee$e)e#fZ*ee#ge$e+effZ,ndgZ-ej.dej/�Z0ej.d�Z1ej.d�Z2ej3ej4ej5ej6ej7ej8ej9ej:ej;ej<ej=ej>ej?ej@gZAejBejCejDgZEgeED]ZFe+eF�jG�^q7ZHdeIfd��YZJdeIfd��YZKdddeMd�ZNd�ZOdd�ZPdddd�ZQdddd�ZRdeIfd��YZSd�ZTd �ZUd!eVfd"��YZWd#�ZXd$�ZYd%�ZZd&�Z[dd'�Z\ej.d(ej/�Z]dS()s
Requirements file parsing
i(tabsolute_importN(tparse(t
cmdoptions(tInstallationErrortRequirementsFileParseError(tSearchScope(traise_for_status(tauto_decode(tMYPY_CHECK_RUNNING(tget_url_scheme(tValues(	tAnytCallabletDicttIteratortListtNoReturntOptionaltTexttTuple(t
PackageFinder(t
PipSessiontparse_requirementss^(http|https|file):s(^|\s+)#.*$s#(?P<var>\$\{(?P<name>[A-Z0-9_]+)\})tParsedRequirementcB@seZddd�ZRS(cC@s:||_||_||_||_||_||_dS(N(trequirementtis_editablet
comes_fromtoptionst
constrainttline_source(tselfRRRRRR((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyt__init__Ps
					N(t__name__t
__module__tNoneR(((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyROst
ParsedLinecB@seZd�ZRS(cC@s�||_||_||_||_||_|rQt|_t|_||_	n7|j
rt|_t|_|j
d|_	n	t|_dS(Ni(tfilenametlinenoRtoptsRtTruetis_requirementtFalseRRt	editables(RR$R%RtargsR&R((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyRcs
										(R R!R(((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR#bsc
	c@sqt|�}t|||�}xL|j||�D]8}t|d|d|d|�}	|	dk	r1|	Vq1q1WdS(s�Parse a requirements file and yield ParsedRequirement instances.

    :param filename:    Path or url of requirements file.
    :param session:     PipSession instance.
    :param finder:      Instance of pip.index.PackageFinder.
    :param comes_from:  Origin description of requirements.
    :param options:     cli options.
    :param constraint:  If true, parsing a constraint file rather than
        requirements file.
    RtfindertsessionN(tget_line_parsertRequirementsFileParserRthandle_lineR"(
R$R-R,RRRtline_parsertparsertparsed_linet
parsed_req((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR�s	cC@s@t|j�dd�}t|�}t|�}t|�}|S(sxSplit, filter, and join lines, and return a line iterator

    :param content: the content of the requirements file
    tstarti(t	enumeratet
splitlinest
join_linestignore_commentstexpand_env_variables(tcontentt
lines_enum((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyt
preprocess�s
c
C@s&dj|jrdnd|j|j�}|js9t�|jrjtd|jd|jd|d|j�S|r�t	j
||j�ni}xGtD]?}||jj
kr�|jj
|r�|jj
|||<q�q�Wdj|j|j�}td|jd|jd|d|jd	|d
|�SdS(Ns{} {} (line {})s-cs-rRRRRs
line {} of {}RR(tformatRR$R%R(tAssertionErrorRRRRtcheck_install_build_globalR&tSUPPORTED_OPTIONS_REQ_DESTt__dict__(tlineRtline_comes_fromtreq_optionstdestR((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pythandle_requirement_line�s.$			

"			c@s��rP|jr|j�_n|jrP�jj�fd�|jD��qPn|r�|j}|j}|jr�|jg}n|jtkr�g}n|jr�|j|j�n|jr(|jd}t	j
jt	j
j|��}	t	j
j
|	|�}
t	j
j|
�r|
}n|j|�ntd|d|�}||_|jr\|j�n|jrr|j�n|r�x?|jp�gD]+}dj||�}
|j|d|
�q�Wq�ndS(Nc3@s$|]}|�jkr|VqdS(N(tfeatures_enabled(t.0tf(R(sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pys	<genexpr>�sit
find_linkst
index_urlss
line {} of {}tsource(trequire_hashesRHtextendRKRLt	index_urltno_indexR'textra_index_urlstostpathtdirnametabspathtjointexiststappendRtsearch_scopetpretset_allow_all_prereleasest
prefer_binarytset_prefer_binaryt
trusted_hostsR>tadd_trusted_host(R&R$R%R,RR-RKRLtvaluetreq_dirtrelative_to_reqs_fileRZthostRM((RsK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pythandle_option_line�sD
			 						
				
	
cC@sF|jrt||�}|St|j|j|j|||�dSdS(sHandle a single parsed requirements line; This can result in
    creating/yielding requirements, or updating the finder.

    :param line:        The parsed line to be processed.
    :param options:     CLI options.
    :param finder:      The finder - updated by non-requirement lines.
    :param session:     The session - updated by non-requirement lines.

    Returns a ParsedRequirement object if the line is a requirement line,
    otherwise returns None.

    For lines that contain requirements, the only options that have an effect
    are from SUPPORTED_OPTIONS_REQ, and they are scoped to the
    requirement. Other options from SUPPORTED_OPTIONS may be present, but are
    ignored.

    For lines that do not contain requirements, the only options that have an
    effect are from SUPPORTED_OPTIONS. Options from SUPPORTED_OPTIONS_REQ may
    be present, but are ignored. These lines may contain multiple options
    (although our docs imply only one is supported), and all our parsed and
    affect the finder.
    N(R(RGReR&R$R%R"(RCRR,R-R4((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR0s	R/cB@s,eZd�Zd�Zd�Zd�ZRS(cC@s||_||_||_dS(N(t_sessiont_line_parsert_comes_from(RR-R1R((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyRCs		cc@s&x|j||�D]}|VqWdS(s3Parse a given file, yielding parsed lines.
        N(t_parse_and_recurse(RR$RRC((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyRNscc@s�x�|j||�D]�}|jr�|jjs;|jjr�|jjr`|jjd}t}n|jjd}t}tj|�r�t	j
||�}n3tj|�s�tjj
tjj|�|�}nx'|j||�D]}|Vq�Wq|VqWdS(Ni(t_parse_fileR(R&trequirementstconstraintsR)R't	SCHEME_REtsearchturllib_parseturljoinRSRTRWRURi(RR$RRCtreq_pathtnested_constraintt
inner_line((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyRiUs"
			cc@s�t||jd|j�\}}t|�}x�|D]y\}}y|j|�\}}	Wn4tk
r�}
dj||
j�}t|��nXt	|||j||	|�Vq4WdS(NRsInvalid requirement: {}
{}(
tget_file_contentRfRhR=RgtOptionParsingErrorR>tmsgRR#(RR$Rt_R;R<tline_numberRCtargs_strR&teRv((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyRjvs (R R!RRRiRj(((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR/Bs			!c@s�fd�}|S(Nc@s�t�}|j�}d|_�r3�j|_nt|�\}}tjdkrf|jd�}n|j	t
j|�|�\}}||fS(Niiitutf8(iii(tbuild_parsertget_default_valuesR"RPtformat_controltbreak_args_optionstsystversion_infotencodet
parse_argstshlextsplit(RCR2tdefaultsRytoptions_strR&Rw(R,(sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyt
parse_line�s		((R,R�((R,sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR.�scC@s�|jd�}g}|}xJ|D]B}|jd�sG|jd�rKPq#|j|�|jd�q#Wdj|�dj|�fS(s�Break up the line into an args and options string.  We only want to shlex
    (and then optparse) the options, not the args.  args can contain markers
    which are corrupted by shlex.
    t t-s--i(R�t
startswithRYtpopRW(RCttokensR+Rttoken((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR�s

RucB@seZd�ZRS(cC@s
||_dS(N(Rv(RRv((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR�s(R R!R(((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyRu�scC@sYtjdt�}tt}x$|D]}|�}|j|�q#Wd�}||_|S(s7
    Return a parser for parsing requirement lines
    tadd_help_optioncS@st|��dS(N(Ru(RRv((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pytparser_exit�s(toptparsetOptionParserR)tSUPPORTED_OPTIONStSUPPORTED_OPTIONS_REQt
add_optiontexit(R2toption_factoriestoption_factorytoptionR�((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR|�s

			cc@sd}g}x�|D]�\}}|jd�s>tj|�r�tj|�rZd|}n|r�|j|�|dk	st�|dj|�fVg}q�||fVq|s�|}n|j|jd��qW|r|dk	s�t�|dj|�fVndS(s�Joins a line ending in '' with the previous line (except when following
    comments).  The joined line takes on the index of the first line.
    s\R�tN(R"tendswitht
COMMENT_REtmatchRYR?RWtstrip(R<tprimary_line_numbertnew_lineRxRC((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR8�s$

		cc@sMxF|D]>\}}tjd|�}|j�}|r||fVqqWdS(s1
    Strips comments and filter empty lines.
    R�N(R�tsubR�(R<RxRC((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR9�s
cc@ssxl|D]d\}}xJtj|�D]9\}}tj|�}|sJq#n|j||�}q#W||fVqWdS(s�Replace all environment variables that can be retrieved via `os.getenv`.

    The only allowed format for environment variables defined in the
    requirement file is `${MY_VARIABLE_1}` to ensure two things:

    1. Strings that contain a `$` aren't accidentally (partially) expanded.
    2. Ensure consistency across platforms for requirement files.

    These points are the result of a discussion on the `github pull
    request #3514 <https://github.com/pypa/pip/pull/3514>`_.

    Valid characters in variable names follow the `POSIX standard
    <http://pubs.opengroup.org/onlinepubs/9699919799/>`_ and are limited
    to uppercase letter, digits and the `_` (underscore).
    N(t
ENV_VAR_REtfindallRStgetenvtreplace(R<RxRCtenv_vartvar_nameRa((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyR:sc
C@s�t|�}|d
krA|j|�}t|�|j|jfS|dkr!|r}|jd�r}tdj||���n|jdd�d}|j	dd�}t
j|�}|r�|jd�d|jd	d�d}nt
j|�}|jd�rd|jd�}n|}ny.t|d
��}t|j��}WdQXWn(tk
ry}	tdj|	���nX||fS(sZGets the content of a file; it may be a filename, file: URL, or
    http: URL.  Returns (location, content).  Content is unicode.
    Respects # -*- coding: declarations on the retrieved files.

    :param url:         File path or url.
    :param session:     PipSession instance.
    :param comes_from:  Origin description of requirements.
    thttpthttpstfiles6Requirements file {} references URL {}, which is localt:is\t/t|trbNs$Could not open requirements file: {}(R�R�(R	tgetRturlttextR�RR>R�R�t_url_slash_drive_reR�tgroupRotunquotetlstriptopenRtreadtIOError(
R�R-RtschemetrespRTR�RJR;texc((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyRt#s4

*	s/*([a-z])\|(^t__doc__t
__future__RR�RStreR�R�tpip._vendor.six.moves.urllibRRotpip._internal.cliRtpip._internal.exceptionsRRt!pip._internal.models.search_scopeRtpip._internal.network.utilsRtpip._internal.utils.encodingRtpip._internal.utils.typingRtpip._internal.utils.urlsR	R
ttypingRRR
RRRRRRt"pip._internal.index.package_finderRtpip._internal.network.sessionRtinttReqFileLineststrt
LineParsert__all__tcompiletIRmR�R�RPtextra_index_urlRQRlRkteditableRKt	no_binarytonly_binaryR]RNR[ttrusted_hosttuse_new_featureR�tinstall_optionstglobal_optionsthashR�toRFRAtobjectRR#R"R)RR=RGReR0R/R.Rt	ExceptionRuR|R8R9R:RtR�(((sK/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_file.pyt<module>s�@ 	%!	.7)N				 		-

Zerion Mini Shell 1.0