HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/cherrypy/__pycache__/__init__.cpython-310.pyc
o

�N�g,�@sdZzddlZWn	eyYnwddlmZddlmZmZm	Z	m
Z
mZddlm
ZddlmZmZddlmZmZmZdd	lmZmZmZmZmZddlmmZdd
lm Z ddlm!Z"ddlm#Z#zdd
l#m$Z$e$�%�Z&e$�'e&�e&_([$Wney�e#j)Z&Ynwddlm*Z*dZ+e,d�e,d�e�-�Z.z
e�/d�dj0Z1Wne2y�dZ1Ynwe3�e&j4d<e3�e&j4d<e#j5�6e&�e&_7e&j7�8�e#j5�9e&�e&_:e&j:�8�e#j5�;e&�e&_<Gdd�de=�Z>e>e&�e&_?e�@�ZAeA�8�d1dd�ZBGdd�de�ZCeC�ZDGdd�de=�ZEeEd�ZFeEd �ZGGd!d"�d"e�ZHeH�ZId2d#d$�ZJz
ddlKZLeLjMeL_NeJeL_MWn
e�y8YnwGd%d&�d&ejO�ZPeP�ZQd'eQ_RdeQ_SdeQ_Te&�8d(�d)d*��ZUe�V�ZWZXd'd'd'd'd+�eW_Yd,d-�eWjZd(<d.d-�eWjZd/<eW�[�e*�\�Z]e&�8d0e]�dS)3a�CherryPy is a pythonic, object-oriented HTTP framework.

CherryPy consists of not one, but four separate API layers.

The APPLICATION LAYER is the simplest. CherryPy applications are written as
a tree of classes and methods, where each branch in the tree corresponds to
a branch in the URL path. Each method is a 'page handler', which receives
GET and POST params as keyword arguments, and returns or yields the (HTML)
body of the response. The special method name 'index' is used for paths
that end in a slash, and the special method name 'default' is used to
handle multiple paths via a single handler. This layer also includes:

 * the 'exposed' attribute (and cherrypy.expose)
 * cherrypy.quickstart()
 * _cp_config attributes
 * cherrypy.tools (including cherrypy.session)
 * cherrypy.url()

The ENVIRONMENT LAYER is used by developers at all levels. It provides
information about the current request and response, plus the application
and server environment, via a (default) set of top-level objects:

 * cherrypy.request
 * cherrypy.response
 * cherrypy.engine
 * cherrypy.server
 * cherrypy.tree
 * cherrypy.config
 * cherrypy.thread_data
 * cherrypy.log
 * cherrypy.HTTPError, NotFound, and HTTPRedirect
 * cherrypy.lib

The EXTENSION LAYER allows advanced users to construct and share their own
plugins. It consists of:

 * Hook API
 * Tool API
 * Toolbox API
 * Dispatch API
 * Config Namespace API

Finally, there is the CORE LAYER, which uses the core API's to construct
the default components which are available at higher layers. You can think
of the default components as the 'reference implementation' for CherryPy.
Megaframeworks (and advanced users) may replace the default components
with customized or extended components. The core API's are:

 * Application API
 * Engine API
 * Request API
 * Server API
 * WSGI API

These API's are described in the `CherryPy specification
<https://github.com/cherrypy/cherrypy/wiki/CherryPySpec>`_.
�N)�local�)�	HTTPError�HTTPRedirect�InternalRedirect�NotFound�CherryPyException)�_cpdispatch)�default_toolbox�Tool)�expose�popargs�url)�
_cprequest�	_cpserver�_cptree�
_cplogging�	_cpconfig)�Application)�_cpwsgi)�process)�win32)�
_cpchecker)rrrrr�dispatch�toolsrr�wsgir�tree�engine�
quickstart�serving�request�response�thread_data�logrr
r�configzcherrypy._cptoolszcherrypy._cprequestZcherrypy�unknownZbefore_requestZ
after_requestc@� eZdZdZdd�Zdd�ZdS)�_HandleSignalsPluginz_Handle signals from other processes.

    Based on the configured platform handlers above.
    cC�
||_dS�N)�bus)�selfr*�r,�E/opt/saltstack/salt/lib/python3.10/site-packages/cherrypy/__init__.py�__init__��
z_HandleSignalsPlugin.__init__cCs8t|jd�r|jj��t|jd�r|jj��dSdS)z'Add the handlers based on the platform.�signal_handler�console_control_handlerN)�hasattrr*r0�	subscriber1�r+r,r,r-r3�s
�z_HandleSignalsPlugin.subscribeN)�__name__�
__module__�__qualname__�__doc__r.r3r,r,r,r-r'�sr'�cCs:|rt�|�t�|||�tj��t��t��dS)anMount the given root, start the builtin server (and engine), then block.

    root: an instance of a "controller class" (a collection of page handler
        methods) which represents the root of the application.
    script_name: a string containing the "mount point" of the application.
        This should start with a slash, and be the path portion of the URL
        at which to mount the given root. For example, if root.index() will
        handle requests to "http://www.example.com:8080/dept/app1/", then
        the script_name argument would be "/dept/app1".

        It MUST NOT end in a slash. If the script_name refers to the root
        of the URI, it MUST be an empty string (not "/").
    config: a file or dict containing application config. If this contains
        a [global] section, those entries will be used in the global
        (site-wide) config.
    N)	�_global_conf_alias�updaterZmountr�signalsr3�start�block)�root�script_namer$r,r,r-r�s

rc@sHeZdZdZe�e�dd�e�dd��Z	e�	�Z
	dd�Zdd�Zd	S)
�_Servinga�An interface for registering request and response objects.

    Rather than have a separate "thread local" object for the request and
    the response, this class works as a single threadlocal container for
    both objects (and any others which developers wish to define). In this
    way, we can easily dump those objects when we stop/start a new HTTP
    conversation, yet still refer to them as module-level globals in a
    thread-safe way.
    z	127.0.0.1�PiWcCs||_||_dSr))r r!)r+r r!r,r,r-�load�s
z
_Serving.loadcCs|j��dS)zRemove all attributes of self.N)�__dict__�clearr4r,r,r-rE�sz_Serving.clearN)
r5r6r7r8rZRequest�	_httputil�Hostr ZResponser!rCrEr,r,r,r-rA�s

�rAc@steZdZddgZdd�Zdd�Zdd�Zd	d
�Zedd��Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZeZdS)�_ThreadLocalProxy�__attrname__rDcCr(r)�rI)r+�attrnamer,r,r-r.�r/z_ThreadLocalProxy.__init__cCstt|j�}t||�Sr)��getattrrrI�r+�name�childr,r,r-�__getattr__��
z_ThreadLocalProxy.__getattr__cCs6|dvr
t�|||�dStt|j�}t|||�dS)NrJ)�object�__setattr__rMrrI�setattr)r+rO�valuerPr,r,r-rT�sz_ThreadLocalProxy.__setattr__cCstt|j�}t||�dSr))rMrrI�delattrrNr,r,r-�__delattr__�sz_ThreadLocalProxy.__delattr__cCs(tt|j�}|jj��}|�|j�|Sr))rMrrI�	__class__rD�copyr;)r+rP�dr,r,r-rD�sz_ThreadLocalProxy.__dict__cCstt|j�}||Sr)rL�r+�keyrPr,r,r-�__getitem__��z_ThreadLocalProxy.__getitem__cCstt|j�}|||<dSr)rL)r+r]rVrPr,r,r-�__setitem__�sz_ThreadLocalProxy.__setitem__cCstt|j�}||=dSr)rLr\r,r,r-�__delitem__�rRz_ThreadLocalProxy.__delitem__cCstt|j�}||vSr)rLr\r,r,r-�__contains__r_z_ThreadLocalProxy.__contains__cC�tt|j�}t|�Sr))rMrrI�len�r+rPr,r,r-�__len__r_z_ThreadLocalProxy.__len__cCrcr))rMrrI�boolrer,r,r-�__nonzero__r_z_ThreadLocalProxy.__nonzero__N)r5r6r7�	__slots__r.rQrTrX�propertyrDr^r`rarbrfrh�__bool__r,r,r,r-rH�s
rHr r!c@seZdZdZdS)�_ThreadDataz%A container for thread-specific data.N)r5r6r7r8r,r,r,r-rlsrlcCs"t|t�rtt|j�}t�||�S)zDGiven an object or a path to an object, get the object and its name.)�
isinstancerHrMrrI�_pydoc�_builtin_resolve)�thingZ	forceloadr,r,r-�_cherrypy_pydoc_resolve#s
rqc@r&)�_GlobalLogManagera�A site-wide LogManager; routes to app.log or global log as appropriate.

    This :class:`LogManager<cherrypy._cplogging.LogManager>` implements
    cherrypy.log() and cherrypy.log.access(). If either
    function is called during a request, the message will be sent to the
    logger for the current Application. If they are called outside of a
    request, the message will be sent to the site-wide logger.
    cOs4ttd�rttjd�rtjj}n|}|j|i|��S)z�Log the given message to the app.log or global log.

        Log the given message to the app.log or global
        log as appropriate.
        �appr#)r2r rsr#�error)r+�args�kwargsr#r,r,r-�__call__<s
z_GlobalLogManager.__call__cCs.ztjj��WStytj�|�YSw)z�Log an access message to the app.log or global log.

        Log the given message to the app.log or global
        log as appropriate.
        )r rsr#�access�AttributeErrorr�
LogManagerr4r,r,r-rxJs
�z_GlobalLogManager.accessN)r5r6r7r8rwrxr,r,r,r-rr2s	rrTr#cCstj|d|d�dS)NZENGINE)Zseverity)r#rt)�msg�levelr,r,r-�_buslog^sr})ztools.log_tracebacks.onztools.log_headers.onztools.trailing_slash.onztools.encode.oncC�tt||�Sr))rUr#��k�vr,r,r-�<lambda>l�r�cCr~r))rU�checkerrr,r,r-r�mr�r�r=)Nr9N)r)^r8Z
pkg_resources�ImportError�	threadingr�_localZ_cperrorrrrrrr9r	rZ_cptoolsr
rrZ_helperrr
rrrrrrZcherrypy.lib.httputil�libZhttputilrFrrrrrZWin32BusrZConsoleCtrlHandlerr1r*r�__all__�
__import__ZTreerZrequire�version�__version__�	Exception�setZ	listenersZpluginsZAutoreloaderZ
autoreloadr3Z
ThreadManagerZthread_managerZ
SignalHandlerr0rSr'r<ZServerZserverrrArrHr r!rlr"rq�pydocrn�resolverorzrrr#ZscreenZ
error_fileZaccess_filer}ZConfigr$r:�defaultsZ
namespaces�resetZCheckerr�r,r,r,r-�<module>s�:�
�
�



;

�$
�