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 : |
a �+�b� � @ sD d Z ddlmZmZ ddlZe�d�Zd dd�ZG dd � d e�Z dS )a0 This 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 [ ()<>@,;:\\"/\[\]?=]� c C sX |durPt |�dkrP|s"t�|�rB|�dd��dd�}d| |f S d| |f S n| S dS ) 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�_formatparam s r c @ s� e Zd ZdZd%dd�Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zd&dd�Zdd� Z dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� ZdS )'�Headersz,Manage a collection of HTTP response headersNc C sP |d ur|ng }t |�tur$td��|| _|D ]\}}| �|� | �|� q.d S )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__c C s$ t |�tu r|S tdt|� ��dS )zConvert/check value type.z2Header names/values must be of type bytes (got %s)N)r �bytes�AssertionError�repr)r r r r r r . s ��zHeaders._convert_string_typec C s t | j�S )z9Return the total number of headers, including duplicates.)r r �r r r r �__len__7 s zHeaders.__len__c C s&