Your IP : 216.73.216.213
B
�b O � 3 @ s� d dl Z d dlmZmZmZmZ d dlmZ dd� Zdd� Z dd � Z
d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<�2Zd
d=dd>d?d@�ZdS )A� N)�escape�string_types�text_� text_type)�
_trans_keyc C s� | dkrdS t | dd�}|dk r0t|�r0| �� S t| t�sht | dd�}|dk r`t|�r`| �� } nt| �} t| d�} t| t�r�| � dd�} t
| �S )a9 HTML-escape a string or object
This converts any non-string objects passed into it to strings
(actually, using ``unicode()``). All values returned are
non-unicode strings (using ``&#num;`` entities for all non-ASCII
characters).
None is treated specially, and returns the empty string.
N� �__html__�__unicode__T�ascii�xmlcharrefreplace)�getattr�callabler �
isinstancer r �strr r �encoder )�sr r � r �;/opt/alt/python37/lib/python3.7/site-packages/webob/util.py�html_escape s
r c C s8 | � � rt| �} |�d�d }d||f }d| ||f S )N�.r z<http://www.w3.org/Protocols/rfc2616/rfc2616-sec%s.html#sec%sz?Gets and sets the ``%s`` header (`HTTP spec section %s <%s>`_).)�isupperr �split)�headerZrfc_sectionZ
major_section�linkr r r �header_docstring&