403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.118.212.165
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/paste/debug/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/paste/debug/__pycache__/wdg_validate.cpython-37.pyc
B

���]��@sXdZddlmZddlZddlmZddlZddlZdgZGdd�de	�Z
d
dd	�ZdS)z�
Middleware that tests the validity of all generated HTML using the
`WDG HTML Validator <http://www.htmlhelp.com/tools/validator/>`_
�)�StringION)�header_value�WDGValidateMiddlewarec@s@eZdZdZe�dej�Zd
dd�Zdd�Z	d	d
�Z
dd�ZdS)rab
    Middleware that checks HTML and appends messages about the validity of
    the HTML.  Uses: http://www.htmlhelp.com/tools/validator/ -- interacts
    with the command line client.  Use the configuration ``wdg_path`` to
    override the path (default: looks for ``validate`` in $PATH).

    To install, in your web context's __init__.py::

        def urlparser_wrap(environ, start_response, app):
            return wdg_validate.WDGValidateMiddleware(app)(
                environ, start_response)

    Or in your configuration::

        middleware.append('paste.wdg_validate.WDGValidateMiddleware')
    z</body>N�validatecCs||_||_dS)N)�app�wdg_path)�selfr�global_confr�r
�I/opt/alt/python37/lib/python3.7/site-packages/paste/debug/wdg_validate.py�__init__%szWDGValidateMiddleware.__init__c	st��g�d���fdd�	}|�||�}zx|D]}��|�q0WWdt|d�rX|��X���}�\}}t|d�pvd}	|	�d�s�|	�d�s�|	�d�s�|gSg}
|	�d	�r�|
�d
�|�	|j
|
|�}|�r|�||�d}|�dt
t|d
��f�|�dt
t|��f�|gS)Ncs ��||f��|||��jS)N)�extend�write)�status�headers�exc_info)�output�response�start_responser
r�writer_start_response-sz=WDGValidateMiddleware.__call__.<locals>.writer_start_response�closezcontent-type�z	text/htmlz
text/xhtmlzapplication/xhtmlztext/xhtml+xmlz--xmlrzContent-Lengthzcontent-length)N)rrr�hasattrr�getvaluer�
startswith�append�call_wdg_validater�	add_error�remove�str�len)r�environrrZapp_iter�s�pagerr�v�ops�html_errorsr
)rrrr�__call__)s8







zWDGValidateMiddleware.__call__cCsLtdkrtd��tj|g|ddtjtjtjd�}|�|�d}|��|S)Nz>This middleware requires the subprocess module from Python 2.4FT)�shell�	close_fds�stdout�stdin�stderrr)�
subprocess�
ValueError�Popen�PIPE�STDOUT�communicate�wait)rrr%r#�procr*r
r
rrPs
z'WDGValidateMiddleware.call_wdg_validatecCsRdt�|�}|j�|�}|rD|d|���|||��d�gS||gSdS)NzR<pre style="background-color: #ffd; color: #600; border: 1px solid #000;">%s</pre>)�cgi�escape�_end_body_regex�search�start)rZ	html_pager&Zadd_text�matchr
r
rr_s&zWDGValidateMiddleware.add_error)Nr)�__name__�
__module__�__qualname__�__doc__�re�compile�Ir7rr'rrr
r
r
rrs
'rcCst|||d�S)a
    Wraps the application in the WDG validator from
    http://www.htmlhelp.com/tools/validator/

    Validation errors are appended to the text of each page.
    You can configure this by giving the path to the validate
    executable (by default picked up from $PATH)
    )r)r)rr	rr
r
r�make_wdg_validate_middlewareks
rB)r)r>�	cStringIOrr-Zpaste.responserr?r5�__all__�objectrrBr
r
r
r�<module>s\

Youez - 2016 - github.com/yon3zu
LinuXploit