ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/
Upload File :
Current File : //proc/self/root/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyo

�
Bu�_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/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyt__init__Ps
					N(t__name__t
__module__tNoneR(((sK/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyRcs
										(R R!R(((sK/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyt
preprocess�s
c
C@sdj|jrdnd|j|j�}|jr[td|jd|jd|d|j�S|rwtj||j	�ni}xGt
D]?}||j	jkr�|j	j|r�|j	j|||<q�q�Wdj|j|j�}td|jd|jd|d|jd	|d
|�SdS(Ns{} {} (line {})s-cs-rRRRRs
line {} of {}RR(tformatRR$R%RRRRtcheck_install_build_globalR&tSUPPORTED_OPTIONS_REQ_DESTt__dict__(tlineRtline_comes_fromtreq_optionstdestR((sK/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pys	<genexpr>�sit
find_linkst
index_urlss
line {} of {}tsource(trequire_hashesRGtextendRJRKt	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-RJRKtvaluetreq_dirtrelative_to_reqs_fileRYthostRL((RsK/opt/alt/python36/lib/python3.6/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(RFRdR&R$R%R"(RBRR,R-R4((sK/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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$RRB((sK/opt/alt/python36/lib/python3.6/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_parseturljoinRRRSRVRTRh(RR$RRBtreq_pathtnested_constraintt
inner_line((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyRhUs"
			cc@s�t||jd|j�\}}t|�}x�|D]y\}}y|j|�\}}	Wn4tk
r�}
dj||
j�}t|��nXt	|||j||	|�Vq4WdS(NRsInvalid requirement: {}
{}(
tget_file_contentReRgR=RftOptionParsingErrorR>tmsgRR#(RR$Rt_R;R<tline_numberRBtargs_strR&teRu((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyRivs (R R!RRRhRi(((sK/opt/alt/python36/lib/python3.6/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"ROtformat_controltbreak_args_optionstsystversion_infotencodet
parse_argstshlextsplit(RBR2tdefaultsRxtoptions_strR&Rv(R,(sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyt
parse_line�s		((R,R�((R,sK/opt/alt/python36/lib/python3.6/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
startswithRXtpopRV(RBttokensR+Rttoken((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyR~�s

RtcB@seZd�ZRS(cC@s
||_dS(N(Ru(RRu((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyR�s(R R!R(((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyRt�scC@sYtjdt�}tt}x$|D]}|�}|j|�q#Wd�}||_|S(s7
    Return a parser for parsing requirement lines
    tadd_help_optioncS@st|��dS(N(Rt(RRu((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pytparser_exit�s(toptparsetOptionParserR)tSUPPORTED_OPTIONStSUPPORTED_OPTIONS_REQt
add_optiontexit(R2toption_factoriestoption_factorytoptionR�((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyR{�s

			cc@s�d}g}x�|D]�\}}|jd�s>tj|�r�tj|�rZd|}n|r�|j|�|dj|�fVg}q�||fVq|s�|}n|j|jd��qW|r�|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_REtmatchRXRVtstrip(R<tprimary_line_numbertnew_lineRwRB((sK/opt/alt/python36/lib/python3.6/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<RwRB((sK/opt/alt/python36/lib/python3.6/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_REtfindallRRtgetenvtreplace(R<RwRBtenv_vartvar_nameR`((sK/opt/alt/python36/lib/python3.6/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�tgroupRntunquotetlstriptopenRtreadtIOError(
R�R-RtschemetrespRSR�RIR;texc((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyRs#s4

*	s/*([a-z])\|(^t__doc__t
__future__RR�RRtreR�Rtpip._vendor.six.moves.urllibRRntpip._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__tcompiletIRlR�R�ROtextra_index_urlRPRkRjteditableRJt	no_binarytonly_binaryR\RMRZttrusted_hosttuse_new_featureR�tinstall_optionstglobal_optionsthashR�toRER@tobjectRR#R"R)RR=RFRdR0R/R.R~t	ExceptionRtR{R8R9R:RsR�(((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_file.pyt<module>s�@ 	%!	.7)N				 		-

Zerion Mini Shell 1.0