403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/hgweb/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/hgweb/__pycache__/wsgiheaders.cpython-39.pyc
a

�+�b��@sDdZddlmZmZddlZe�d�Zd
dd�ZGdd	�d	e�Z	dS)a0This was forked from cpython's wsgiref.headers module to work on bytes.

Header from old file showing copyright is below.

Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
�)�absolute_import�print_functionNs[ ()<>@,;:\\"/\[\]?=]�cCsX|durPt|�dkrP|s"t�|�rB|�dd��dd�}d||fSd||fSn|SdS)	z}Convenience function to format and return a key=value pair.
    This will quote the value if needed or if quote is true.
    Nr�\s\\�"z\"s%s="%s"s%s=%s)�len�	tspecials�search�replace)Zparam�value�quote�r
�A/usr/lib64/python3.9/site-packages/mercurial/hgweb/wsgiheaders.py�_formatparamsrc@s�eZdZdZd%dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zd&dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)'�Headersz,Manage a collection of HTTP response headersNcCsP|dur|ng}t|�tur$td��||_|D]\}}|�|�|�|�q.dS)Ns+Headers must be a list of name/value tuples)�type�list�	TypeError�_headers�_convert_string_type)�selfZheaders�k�vr
r
r�__init__$s
zHeaders.__init__cCs$t|�tur|Stdt|���dS)zConvert/check value type.z2Header names/values must be of type bytes (got %s)N)r�bytes�AssertionError�repr)rrr
r
rr.s��zHeaders._convert_string_typecCs
t|j�S)z9Return the total number of headers, including duplicates.)rr�rr
r
r�__len__7szHeaders.__len__cCs&||=|j�|�|�|�|�f�dS)zSet the value of a header.N)r�appendr)r�name�valr
r
r�__setitem__;s�zHeaders.__setitem__cs0|�������fdd�|jD�|jdd�<dS)zxDelete all occurrences of a header, if present.
        Does *not* raise an exception if the header is missing.
        cs g|]}|d���kr|�qS)r��lower��.0Zkv�r r
r�
<listcomp>G�z'Headers.__delitem__.<locals>.<listcomp>N�rr$r�rr r
r'r�__delitem__BszHeaders.__delitem__cCs
|�|�S)aFGet the first header value for 'name'
        Return None if the header is missing instead of raising an exception.
        Note that if the header appeared multiple times, the first exactly which
        occurrence gets returned is undefined.  Use getall() to get all
        the values matching a header field name.
        ��getr+r
r
r�__getitem__IszHeaders.__getitem__cCs|�|�duS)z/Return true if the message contains the header.Nr-r+r
r
r�__contains__RszHeaders.__contains__cs"|�������fdd�|jD�S)apReturn a list of all the values for the named field.
        These will be sorted in the order they appeared in the original header
        list or were added to this instance, and may contain duplicates.  Any
        fields deleted and re-inserted are always appended to the header list.
        If no fields exist with the given name, returns an empty list.
        cs$g|]}|d���kr|d�qS)rrr#r%r'r
rr(^r)z#Headers.get_all.<locals>.<listcomp>r*r+r
r'r�get_allVszHeaders.get_allcCs6|�|���}|jD]\}}|��|kr|Sq|S)z:Get the first header value for 'name', or return 'default'r*)rr �defaultrrr
r
rr.`s

zHeaders.getcCsdd�|jD�S)a)Return a list of all the header field names.
        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cSsg|]\}}|�qSr
r
�r&rrr
r
rr(or)z Headers.keys.<locals>.<listcomp>�rrr
r
r�keyshszHeaders.keyscCsdd�|jD�S)a Return a list of all header values.
        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cSsg|]\}}|�qSr
r
r3r
r
rr(xr)z"Headers.values.<locals>.<listcomp>r4rr
r
r�valuesqszHeaders.valuescCs|jdd�S)aGet all the header fields and values.
        These will be sorted in the order they were in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        Nr4rr
r
r�itemszsz
Headers.itemscCsd|jj|jfS)Nz%s(%r))�	__class__�__name__rrr
r
r�__repr__�szHeaders.__repr__cCsd�dd�|jD�ddg�S)zkstr() returns the formatted headers, complete with end line,
        suitable for direct HTTP transmission.s
cSsg|]}d|�qS)s%s: %sr
r%r
r
rr(�r)z#Headers.__str__.<locals>.<listcomp>r))�joinrrr
r
r�__str__�s�zHeaders.__str__cCst|��d�S)Nz
iso-8859-1)�str�encoderr
r
r�	__bytes__�szHeaders.__bytes__cCs:|�|�}|dur2|j�|�|�|�|�f�|S|SdS)z�Return first matching header value for 'name', or 'value'
        If there is no header named 'name', add a new header with name 'name'
        and value 'value'.N)r.rrr)rr r�resultr
r
r�
setdefault�s
��zHeaders.setdefaultcKs�g}|dur |�|�}|�|�|��D]P\}}|�|�}|durV|�|�dd��q(|�|�}|�t|�dd�|��q(|j�|�|�d�|�f�dS)abExtended header setting.
        _name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.
        Example:
        h.add_header('content-disposition', 'attachment', filename='bud.gif')
        Note that unlike the corresponding 'email.message' method, this does
        *not* handle '(charset, language, value)' tuples: all values must be
        strings or None.
        N�_�-s; )rrr7r
rrr;)r�_name�_valueZ_params�partsrrr
r
r�
add_header�s



�zHeaders.add_header)N)N)r9�
__module__�__qualname__�__doc__rrrr"r,r/r0r1r.r5r6r7r:r<r?rArGr
r
r
rr!s$

		

			r)Nr)
rJZ
__future__rr�re�compilerr�objectrr
r
r
r�<module>s




Youez - 2016 - github.com/yon3zu
LinuXploit