Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cherrypy/tutorial/__pycache__/tut10_http_errors.cpython-39.pyc
Ðазад
a v�h� � @ s� d Z ddlZddlZddlZej�e�Zej�ej� e� � e��ZG dd� de�Z ej� ej�e�d�Zedkr�eje � ed� dS )z� Tutorial: HTTP errors HTTPError is used to return an error response to the client. CherryPy has lots of options regarding how such errors are logged, displayed, and formatted. � Nc @ sV e Zd Zdej�ed�iZej dd� �Z ej dd� �Zej dd� �Zej d d � �Z dS )� HTTPErrorDemozerror_page.403zcustom_error.htmlc C s t jj}|rd}nd}d| S )N�off�ona( <html><body> <p>Toggle tracebacks <a href="toggleTracebacks">%s</a></p> <p><a href="/doesNotExist">Click me; I'm a broken link!</a></p> <p> <a href="/error?code=403"> Use a custom error page from a file. </a> </p> <p>These errors are explicitly raised by the application:</p> <ul> <li><a href="/error?code=400">400</a></li> <li><a href="/error?code=401">401</a></li> <li><a href="/error?code=402">402</a></li> <li><a href="/error?code=500">500</a></li> </ul> <p><a href="/messageArg">You can also set the response body when you raise an error.</a></p> </body></html> )�cherrypy�request�show_tracebacks)�self� tracebacks�trace� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cherrypy/tutorial/tut10_http_errors.py�index s �zHTTPErrorDemo.indexc C s( t jj}t j�d| i� t �d��d S )Nzrequest.show_tracebacks�/)r r r �config�updateZHTTPRedirect)r r r r r �toggleTracebacks8 s zHTTPErrorDemo.toggleTracebacksc C s t j|d��d S )N)�status�r � HTTPError)r �coder r r �errorA s zHTTPErrorDemo.errorc C s d}t jd|d��d S )Nz�If you construct an HTTPError with a 'message' argument, it wil be placed on the error page (underneath the status line by default).i� )�messager )r r r r r � messageArgF s zHTTPErrorDemo.messageArgN)�__name__� __module__�__qualname__�os�path�join�curpathZ _cp_configr Zexposer r r r r r r r r s � r z tutorial.conf�__main__)r )�__doc__r �os.pathr r �dirname�__file__ZlocalDir�normpathr �getcwdr �objectr Ztutconfr Z quickstartr r r r �<module> s :
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка