HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyc
�
1�3\c@@s�ddlmZddlmZddlmZmZmZdefd��YZ	ej
de�defd	��Y�Zdddd
�Zdefd��YZd
efd��YZd�ZdS(i(tabsolute_importi(tattr(terrortpycompattutilt	multidictcB@steZdZd�Zd�Zd�Zd�Zd�Zd�Zdd�Z
d�Zd	�Zd
�Z
d�ZRS(
s�A dict like object that can store multiple values for a key.

    Used to store parsed request parameters.

    This is inspired by WebOb's class of the same name.
    cC@s
i|_dS(N(t_items(tself((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt__init__scC@s|j|dS(s%Returns the last set value for a key.i����(R(Rtkey((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt__getitem__ scC@s|g|j|<dS(s,Replace a values for a key with a new value.N(R(RR	tvalue((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt__setitem__$scC@s|j|=dS(sDelete all values for a key.N(R(RR	((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt__delitem__(scC@s
||jkS(N(R(RR	((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt__contains__,scC@s
t|j�S(N(tlenR(R((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt__len__/scC@s*y|j|�SWntk
r%|SXdS(N(R
tKeyError(RR	tdefault((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytget2s
cC@s |jj|g�j|�dS(s<Add a new value for a key. Does not replace existing values.N(Rt
setdefaulttappend(RR	R((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytadd8scC@s|jj|g�S(sObtains all values for a key.(RR(RR	((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytgetall<scC@s:|j|}t|�dkr2td|��n|dS(stObtain a single value for a key.

        Raises KeyError if key not defined or it has multiple values set.
        ismultiple values for %ri(RRR(RR	tvals((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytgetone@s
cC@sd�|jj�D�S(NcS@s%i|]\}}t|�|�qS((tlist(t.0tktv((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pys
<dictcomp>Ms	(Rt	iteritems(R((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt
asdictoflistsLsN(t__name__t
__module__t__doc__RR
RR
RRtNoneRRRRR(((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyRs									tfrozent
parsedrequestcB@s�eZdZej�Zej�Zej�Zej�Zej�Z	ej�Z
ej�Zej�Zej�Z
ej�Zej�Zej�Zej�Zej�Zej�Zej�Zej�ZRS(stRepresents a parsed WSGI request.

    Contains both parsed parameters as well as a handle on the input stream.
    (R R!R"Rtibtmethodturltbaseurlt
advertisedurltadvertisedbaseurlt	urlschemet
remoteusert
remotehosttapppatht
dispatchpartstdispatchpathtreponametquerystringtqsparamstheaderstbodyfhtrawenv(((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyR%Os$c#C@sOtjr8d�|j�D�}d�|j�D�}n|sP|jd�}n|rhtj|�}n|dd}|r�|jr�|jd}n|}d�}|jd�r�||d7}n!||d7}|||d	�}|rv|jrv||j7}|jr|j}nN|jd
kr8|jr8d}n,|jdkrZ|jrZd
}n
|d	}|||�}n!||d7}|||d	�}|}|}	|tj	j
|jdd��7}|tj	j
|jdd��7}|r8|jp�d}
|
r|
jd�rd|
}
n|tj	j
|
�7}n"|tj	j
|jdd��7}|tj	j
|jdd��7}|jd�r�|d|d7}|d|d7}n|r�|jp�d}|r�|jd�r�d|}q�n|jdd�}|r�d|j
d�}|jd�s9tjd��n|dj|�sltjd|d|f��n|dt|�}
|
r�|
jd�r�tjd|d|f��n|jd�|}|
j
d�jd�}dj|�}
nhd|krO|dj
d�r@|dj
d�jd�}dj|�}
q[g}d}
ng}d9}
|jdd�}t�}x6tj	j|dt�D]\}}|j||�q�Wg}xU|j�D]G\}}|jd�r�|j|td�jdd�|f�q�q�Wddlm}|j|�}d|krUd|krU|d|d<nd |kr~d!|kr~|d |d"<n|d9kr�|d#}d|kr�tj|t|dp�d$��}q�nt d%|d&d'|d(|d)|d*|	d+|dd,|jd-�d.|jd/�d0|d1|d2|
d3|d4|d5|d6|d7|d8|�S(:s�Parse URL components from environment variables.

    WSGI defines request attributes via environment variables. This function
    parses the environment variables into a data structure.

    If ``reponame`` is defined, the leading path components matching that
    string are effectively shifted from ``PATH_INFO`` to ``SCRIPT_NAME``.
    This simulates the world view of a WSGI application that processes
    requests from the base URL of a repo.

    If ``altbaseurl`` (typically comes from ``web.baseurl`` config option)
    is defined, it is used - instead of the WSGI environment variables - for
    constructing URL components up to and including the WSGI application path.
    For example, if the current WSGI application is at ``/repo`` and a request
    is made to ``/rev/@`` with this argument set to
    ``http://myserver:9000/prefix``, the URL and path components will resolve as
    if the request were to ``http://myserver:9000/prefix/rev/@``. In other
    words, ``wsgi.url_scheme``, ``SERVER_NAME``, ``SERVER_PORT``, and
    ``SCRIPT_NAME`` are all effectively replaced by components from this URL.

    ``bodyfh`` can be used to specify a file object to read the request body
    from. If not defined, ``wsgi.input`` from the environment dict is used.
    cS@s(i|]\}}||jd��qS(slatin-1(tencode(RRR((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pys
<dictcomp>�s	cS@s=i|]3\}}t|t�r0|jd�n||�qS(slatin-1(t
isinstancetstrR8(RRR((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pys
<dictcomp>�s	t	REPO_NAMEswsgi.url_schemes://cS@sP|jd�r/|dkrL|d|7}qLn|dkrL|d|7}n|S(Nshttps://t443t:t80(t
startswith(tstport((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytaddport�st	HTTP_HOSTtSERVER_NAMEtSERVER_PORTthttpR>thttpsR<tSCRIPT_NAMEtt	PATH_INFOt/tQUERY_STRINGt?sreponame requires PATH_INFOs0PATH_INFO does not begin with repo name: %s (%s)sDreponame prefix of PATH_INFO does not end at path delimiter: %s (%s)tkeep_blank_valuestHTTP_t_t-i(twsgiheaderstCONTENT_LENGTHtHTTP_CONTENT_LENGTHsContent-LengthtCONTENT_TYPEtHTTP_CONTENT_TYPEsContent-Types
wsgi.inputt0R'tREQUEST_METHODR(R)R*R+R,R-tREMOTE_USERR.tREMOTE_HOSTR/R0R1R2R3R4R5R6R7N(!Rtispy3RRRR(tschemethostRAturlreqtquotetpathR?tstripRtProgrammingErrorRtrstriptsplittjoinR#RtparseqsltTrueRRtreplaceRIRRtHeaderstcappedreadertintR%(tenvR2t
altbaseurlR6tfullurltadvertisedfullurlRBRAR)R+R`R/t
repoprefixR1R0R3R4RRR5RR((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytparserequestfromenvs�#		

			
""
""				%0
	
toffsettrackingwritercB@s2eZdZd�Zd�Zd�Zd�ZRS(s�A file object like object that is append only and tracks write count.

    Instances are bound to a callable. This callable is called with data
    whenever a ``write()`` is attempted.

    Instances track the amount of written data so they can answer ``tell()``
    requests.

    The intent of this class is to wrap the ``write()`` function returned by
    a WSGI ``start_response()`` function. Since ``write()`` is a callable and
    not a file object, it doesn't implement other file object methods.
    cC@s||_d|_dS(Ni(t_writet_offset(Rtwritefn((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyR\s	cC@sF|j|�}|dkr3|jt|�7_n|j|7_dS(N(RsR#RtR(RR@tres((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytwrite`scC@sdS(N((R((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytflushhscC@s|jS(N(Rt(R((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyttellks(R R!R"RRwRxRy(((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyRrOs
			twsgiresponsecB@sMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(sPRepresents a response to a WSGI request.

    A response consists of a status line, headers, and a body.

    Consumers must populate the ``status`` and ``headers`` fields and
    make a call to a ``setbody*()`` method before the response can be
    issued.

    When it is time to start sending the response over the wire,
    ``sendresponse()`` is called. It handles emitting the header portion
    of the response message. It then yields chunks of body data to be
    written to the peer. Typically, the WSGI application itself calls
    and returns the value from ``sendresponse()``.
    cC@sn||_||_d|_ddlm}|jg�|_d|_d|_	t
|_t
|_d|_
dS(s�Create an empty response tied to a specific request.

        ``req`` is a ``parsedrequest``. ``startresponse`` is the
        ``start_response`` function passed to the WSGI application.
        i(RRN(t_reqt_startresponseR#tstatusRIRRRiR5t
_bodybytest_bodygentFalset_bodywillwritet_startedt_bodywritefn(Rtreqt
startresponseRR((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyR~s							cC@s=|jdk	s'|jdk	s'|jr9tjd��ndS(Ns!cannot define body multiple times(R~R#RR�RRb(R((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt_verifybody�s	cC@s.|j�||_dt|�|jd<dS(stDefine the response body as static bytes.

        The empty string signals that there is no response body.
        s%dsContent-LengthN(R�R~RR5(Rtb((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytsetbodybytes�s
	cC@s|j�||_dS(s1Define the response body as a generator of bytes.N(R�R(Rtgen((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt
setbodygen�s
cC@s|j�t|_dS(sSignal an intent to use write() to emit the response body.

        **This is the least preferred way to send a body.**

        It is preferred for WSGI applications to emit a generator of chunks
        constituting the response body. However, some consumers can't emit
        data this way. So, WSGI provides a way to obtain a ``write(data)``
        function that can be used to synchronously perform an unbuffered
        write.

        Calling this function signals an intent to produce the body in this
        manner.
        N(R�RgR�(R((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytsetbodywillwrite�s
c	c@s�|jrtjd��nt|_|js?tjd��n|jdkry|jdkry|jrytjd��n|jj	d�r!|j
jd�dkr�|j
d=nd�|j
j�D�}|r�tjdd	j
t|����n|jdk	s|jr!tjd
��q!nt}t}|jj
jdd�j�d
krTn<|jjdkrin't|jjtj�s�t}nt}|r�d|j
d<n|r�t|jjtj�s�t�x,tr�|jjjd�}|s�Pq�q�Wng|j
j�D]*\}}tj|�tj|�f^q	}|jtj|j�|�}|jrk|jVne|jr�xY|jD])}t|t�r�t|�}n|Vq~Wn"|jr�||_ n
tjd�dS(s�Send the generated response to the client.

        Before this is called, ``status`` must be set and one of
        ``setbodybytes()`` or ``setbodygen()`` must be called.

        Calling this method multiple times is not allowed.
        s$sendresponse() called multiple timessstatus line not definedsresponse body not defineds304 sContent-LengthRWc
S@s(h|]}|j�dkr|�qS(tdatetetagtexpiress
cache-controlscontent-locationscontent-security-policytvary(R�R�R�s
cache-controlscontent-locationscontent-security-policyR�(tlower(RR((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pys	<setcomp>�s		s"illegal header on 304 response: %ss, s,must use setbodybytes('') with 304 responsestExpectRIs100-continuetPOSTtPUTtCloset
Connectioni�sdo not know how to send bodyN(R�R�(!R�RRbRgR}R~R#RR�R?R5RtkeysRetsortedR�R{R�R'R9R6RRjtAssertionErrortreadtitemsRtstrurlR|tsysstrt	bytearraytbytesR�(	Rt
badheaderstdraintclosetchunkRRt
strheadersRw((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytsendresponse�sb			
	

$		=				cC@sR|jstjd��n|js6tjd��n|jsEt�t|j�S(s�Obtain a file object like object representing the response body.

        For this to work, you must call ``setbodywillwrite()`` and then
        ``sendresponse()`` first. ``sendresponse()`` is a generator and the
        function won't run to completion unless the generator is advanced. The
        generator yields not items. The easiest way to consume it is with
        ``list(res.sendresponse())``, which should resolve to an empty list -
        ``[]``.
        s"must call setbodywillwrite() firstsWmust call sendresponse() first; did you remember to consume it since it is a generator?(R�RRbR�R�R�Rr(R((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytgetbodyfile+s
		(
R R!R"RR�R�R�R�R�R�(((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyRzns							vc@s|���fd�}|S(s{For compatibility with old CGI scripts. A plain hgweb() or hgwebdir()
    can and should now be used as a WSGI application.c@s
�||�S(N((Rltrespond(tapplication(s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytrun_wsgiDs((t	app_makerR�((R�s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pytwsgiapplication@s	N(t
__future__Rt
thirdpartyRRIRRRtobjectRR@RgR%R#RqRrRzR�(((s=/usr/lib64/python2.7/site-packages/mercurial/hgweb/request.pyt<module>	s9/��