|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /usr/lib64/python2.7/site-packages/django/utils/ |
Upload File : |
�
r�\c @ s d Z d d l m Z m Z d d l m Z d e f d � � YZ d e e f d � � YZ d e j
e f d � � YZ e j r� e Z
n e Z
e Z d
e f d � � YZ d e e f d
� � YZ d e j
e f d � � YZ e j r� e Z n e Z e Z d � Z d � Z d S( s8
Functions for working with "safe strings": strings that can be displayed safely
without further escaping in HTML. Marking something as a "safe string" means
that the producer of the string has already turned characters that should not
be interpreted by the HTML engine (e.g. '<') into the appropriate entities.
i����( t curryt Promise( t sixt
EscapeDatac B s e Z RS( ( t __name__t
__module__( ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR
s t EscapeBytesc B s e Z d Z RS( s@
A byte string that should be HTML-escaped when output.
( R R t __doc__( ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR
s t
EscapeTextc B s e Z d Z RS( sJ
A unicode string object that should be HTML-escaped when output.
( R R R ( ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR s t SafeDatac B s e Z RS( ( R R ( ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR s t SafeBytesc B s5 e Z d Z d � Z d � Z e e d e j �Z RS( s�
A bytes subclass that has been specifically marked as "safe" (requires no
further escaping) for HTML output purposes.
c C sN t t | � j | � } t | t � r1 t | � St | t � rJ t | � S| S( s�
Concatenating a safe byte string with another safe byte string or safe
unicode string is safe. Otherwise, the result is no longer safe.
( t superR
t __add__t
isinstancet SafeText( t selft rhst t( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR ( s
c O sH | j d � } | | | | � } t | t � r: t | � St | � Sd S( s�
Wrap a call to a normal unicode method up so that we return safe
results. The method that is being wrapped is passed in the 'method'
argument.
t methodN( t popR
t bytesR
R ( R t argst kwargsR t data( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyt
_proxy_method4 s
R ( R R R R R R R t decode( ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR
# s
R c B s8 e Z d Z d � Z d � Z e e d e j j �Z RS( s�
A unicode (Python 2) / str (Python 3) subclass that has been specifically
marked as "safe" for HTML output purposes.
c C s5 t t | � j | � } t | t � r1 t | � S| S( s�
Concatenating a safe unicode string with another safe byte string or
safe unicode string is safe. Otherwise, the result is no longer safe.
( R R R R
R ( R R R ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR H s
c O sH | j d � } | | | | � } t | t � r: t | � St | � Sd S( s�
Wrap a call to a normal unicode method up so that we return safe
results. The method that is being wrapped is passed in the 'method'
argument.
R N( R R
R R
R ( R R R R R ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR R s
R ( R R R R R R R t text_typet encode( ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyR C s
c C sv t | t � r | St | t � s: t | t � rD | j rD t | � St | t j t f � rf t | � St t
| � � S( s�
Explicitly mark a string as safe for (HTML) output purposes. The returned
object can be used everywhere a string or unicode object is appropriate.
Can be called multiple times on a single string.
( R
R R R t _delegate_bytesR
R R R t
SafeStringt str( t s( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyt mark_safeh s '
c C s| t | t t f � r | St | t � s@ t | t � rJ | j rJ t | � St | t j t f � rl t | � St t | � � S( s�
Explicitly mark a string as requiring HTML escaping upon output. Has no
effect on SafeData subclasses.
Can be called multiple times on a single string (the resulting escaping is
only applied once).
(
R
R R R R R R R R R ( R ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyt mark_for_escapingw s '
N( R t django.utils.functionalR R t django.utilsR t objectR R R R R t PY3t EscapeStringt
EscapeUnicodeR R
R R t SafeUnicodeR R! ( ( ( s9 /tmp/pip-install-XxeQeY/django/django/utils/safestring.pyt <module> s$