Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/web/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/web/__pycache__/error.cpython-310.pyc
o

�b�2�@s8dZgd�ZddlmZddlmZddlmZddlm	Z	dd�Z
Gd	d
�d
e�ZGdd�de�Z
Gd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&e�Zd'S)(z+
Exception definitions for L{twisted.web}.
)�Error�PageRedirect�InfiniteRedirection�RenderError�MissingRenderMethod�MissingTemplateLoader�UnexposedMethodError�UnfilledSlot�UnsupportedType�FlattenerError�RedirectWithNoLocation�)�Sequence)�cast)�nativeString)�	RESPONSESc	Cs*zt�t|��WSttfyYdSw)a
    Returns the response message corresponding to an HTTP code, or None
    if the code is unknown or unrecognized.

    @type code: L{bytes}
    @param code: Refers to an HTTP status code, for example C{http.NOT_FOUND}.

    @return: A string message or none
    @rtype: L{bytes}
    N)r�get�int�
ValueError�AttributeError)�code�r�3/usr/lib/python3/dist-packages/twisted/web/error.py�_codeToMessages
�rc@s(eZdZdZddd�Zdefdd�ZdS)	raH
    A basic HTTP error.

    @type status: L{bytes}
    @ivar status: Refers to an HTTP status code, for example C{http.NOT_FOUND}.

    @type message: L{bytes}
    @param message: A short error message, for example "NOT FOUND".

    @type response: L{bytes}
    @ivar response: A complete HTML document for an error page.
    NcCsF|pt|�}t�||||�t|t�rd|f}||_||_||_dS)a)
        Initializes a basic exception.

        @type code: L{bytes} or L{int}
        @param code: Refers to an HTTP status code (for example, 200) either as
            an integer or a bytestring representing such. If no C{message} is
            given, C{code} is mapped to a descriptive bytestring that is used
            instead.

        @type message: L{bytes}
        @param message: A short error message, for example "NOT FOUND".

        @type response: L{bytes}
        @param response: A complete HTML document for an error page.
        s%dN)r�	Exception�__init__�
isinstancer�status�message�response)�selfrrrrrrr>s


zError.__init__�returncCst|jd|j�S)N� )rrr�rrrr�__str__\sz
Error.__str__)NN)�__name__�
__module__�__qualname__�__doc__r�strr#rrrrr0s

rc@�eZdZdZddd�ZdS)rz�
    A request resulted in an HTTP redirect.

    @type location: L{bytes}
    @ivar location: The location of the redirect which was not followed.
    NcC�4t�||||�|jr|r|jd||_||_dS)a�
        Initializes a page redirect exception.

        @type code: L{bytes}
        @param code: Refers to an HTTP status code, for example
            C{http.NOT_FOUND}. If no C{message} is given, C{code} is mapped to a
            descriptive string that is used instead.

        @type message: L{bytes}
        @param message: A short error message, for example "NOT FOUND".

        @type response: L{bytes}
        @param response: A complete HTML document for an error page.

        @type location: L{bytes}
        @param location: The location response-header field value. It is an
            absolute URI used to redirect the receiver to a location other than
            the Request-URI so the request can be completed.
        � to N�rrr�location�rrrrr-rrrrh�

zPageRedirect.__init__�NNN�r$r%r&r'rrrrrr`src@r))rz�
    HTTP redirection is occurring endlessly.

    @type location: L{bytes}
    @ivar location: The first URL in the series of redirections which was
        not followed.
    NcCr*)a�
        Initializes an infinite redirection exception.

        @type code: L{bytes}
        @param code: Refers to an HTTP status code, for example
            C{http.NOT_FOUND}. If no C{message} is given, C{code} is mapped to a
            descriptive string that is used instead.

        @type message: L{bytes}
        @param message: A short error message, for example "NOT FOUND".

        @type response: L{bytes}
        @param response: A complete HTML document for an error page.

        @type location: L{bytes}
        @param location: The location response-header field value. It is an
            absolute URI used to redirect the receiver to a location other than
            the Request-URI so the request can be completed.
        r+Nr,r.rrrr�r/zInfiniteRedirection.__init__r0r1rrrrr�src@seZdZdZdd�ZdS)rz�
    Exception passed to L{ResponseFailed} if we got a redirect without a
    C{Location} header field.

    @type uri: L{bytes}
    @ivar uri: The URI which failed to give a proper location header
        field.

    @since: 11.1
    cCs(t�|||�|jd||_||_dS)a
        Initializes a page redirect exception when no location is given.

        @type code: L{bytes}
        @param code: Refers to an HTTP status code, for example
            C{http.NOT_FOUND}. If no C{message} is given, C{code} is mapped to
            a descriptive string that is used instead.

        @type message: L{bytes}
        @param message: A short error message.

        @type uri: L{bytes}
        @param uri: The URI which failed to give a proper location header
            field.
        r+N)rrr�uri)rrrr2rrrr�s
zRedirectWithNoLocation.__init__Nr1rrrrr�src@s*eZdZdZdZdd�Zdefdd�ZdS)	�UnsupportedMethoda^
    Raised by a resource when faced with a strange request method.

    RFC 2616 (HTTP 1.1) gives us two choices when faced with this situation:
    If the type of request is known to us, but not allowed for the requested
    resource, respond with NOT_ALLOWED.  Otherwise, if the request is something
    we don't know how to deal with in any case, respond with NOT_IMPLEMENTED.

    When this exception is raised by a Resource's render method, the server
    will make the appropriate response.

    This exception's first argument MUST be a sequence of the methods the
    resource *does* support.
    rcGs0tj||g|�R�||_t|t�std��dS)Nz`First argument must be a sequence of supported methods, but my first argument is not a sequence.)rr�allowedMethodsrr
�	TypeError)rr4�argsrrrr�s
��zUnsupportedMethod.__init__r cCsd|j��S)NzExpected one of )r4r"rrrr#�szUnsupportedMethod.__str__N)r$r%r&r'r4rr(r#rrrrr3�s

r3c@�eZdZdZdS)�SchemeNotSupportedzB
    The scheme of a URI was not one of the supported values.
    N�r$r%r&r'rrrrr8��r8c@r7)rz\
    Base exception class for all errors which can occur during template
    rendering.
    Nr9rrrrr�r:rc@�&eZdZdZdd�Zdefdd�ZdS)rz�
    Tried to use a render method which does not exist.

    @ivar element: The element which did not have the render method.
    @ivar renderName: The name of the renderer which could not be found.
    cCst�|||�||_||_dS�N)rr�element�
renderName)rr=r>rrrr�s
zMissingRenderMethod.__init__r cCsd�|jj|j|j�S)Nz*{!r}: {!r} had no render method named {!r})�format�	__class__r$r=r>r"rrr�__repr__s
�zMissingRenderMethod.__repr__N�r$r%r&r'rr(rArrrrr�src@r;)rz�
    L{MissingTemplateLoader} is raised when trying to render an Element without
    a template loader, i.e. a C{loader} attribute.

    @ivar element: The Element which did not have a document factory.
    cCst�||�||_dSr<)rrr=)rr=rrrrs
zMissingTemplateLoader.__init__r cCs|jj�d|j�d�S)N�: z had no loader)r@r$r=r"rrrrAszMissingTemplateLoader.__repr__NrBrrrrrsrc@r7)rzK
    Raised on any attempt to get a method which has not been exposed.
    Nr9rrrrrr:rc@r7)rzL
    During flattening, a slot with no associated data was encountered.
    Nr9rrrrrr:rc@r7)r	z_
    During flattening, an object of a type which cannot be flattened was
    encountered.
    Nr9rrrrr	$r:r	c@r7)�ExcessiveBufferingErrorz�
    The HTTP/2 protocol has been forced to buffer an excessive amount of
    outbound data, and has therefore closed the connection and dropped all
    outbound data.
    Nr9rrrrrD+r:rDc@s<eZdZdZdd�Zdd�Zdefdd�Zdefd	d
�ZdS)r
a 
    An error occurred while flattening an object.

    @ivar _roots: A list of the objects on the flattener's stack at the time
        the unflattenable object was encountered.  The first element is least
        deeply nested object and the last element is the most deeply nested.
    cCs&||_||_||_t�||||�dSr<)�
_exception�_roots�
_tracebackrr)r�	exception�roots�	tracebackrrrr<szFlattenerError.__init__cCs�ddlm}t|ttf�r1t|�dkr-t|t�rd}nd}t|dd�||dd��St|�St||�rN|jdurBd	|jd
Sd|j|j	|j
|jfSt|�S)a�
        Convert an object from C{self._roots} to a string suitable for
        inclusion in a render-traceback (like a normal Python traceback, but
        can include "frame" source locations which are not in Python source
        files).

        @param obj: Any object which can be a render step I{root}.
            Typically, L{Tag}s, strings, and other simple Python types.

        @return: A string representation of C{obj}.
        @rtype: L{str}
        r)�Tag�(z<...>s<...>N�i��zTag <�>z&File "%s", line %d, column %d, in "%s")�twisted.web.templaterKr�bytesr(�len�ascii�filename�tagName�
lineNumber�columnNumber)r�objrK�ellipsisrrr�_formatRootBs$
 

�zFlattenerError._formatRootr cs�ddlm}�jrdd��fdd��jD��d}nd}�jr0d�d	d�|�j�D��d}nd}ttd
||�jjj	dt�j�d�S)z�
        Present a string representation which includes a template traceback, so
        we can tell where this error occurred in the template, as well as in
        Python.
        r)�format_listz  z
  csg|]}��|��qSr)rY)�.0�rr"rr�
<listcomp>{sz+FlattenerError.__repr__.<locals>.<listcomp>�
�cSsg|]}|��D]}|�qqSr)�
splitlines)r[�entry�linerrrr]�s���zException while flattening:
rC)
rJrZrF�joinrGrr(rEr@r$)rrZrIrJrr"rrAns>	 ������������zFlattenerError.__repr__cCst|�Sr<)�reprr"rrrr#�szFlattenerError.__str__N)	r$r%r&r'rrYr(rAr#rrrrr
3s,+r
c@r7)�UnsupportedSpecialHeaderzz
    A HTTP/2 request was received that contained a HTTP/2 pseudo-header field
    that is not recognised by Twisted.
    Nr9rrrrre�r:reN)r'�__all__�collections.abcr
�typingr�twisted.python.compatr�twisted.web._responsesrrrrrrrr3r8rrrrrr	rDr
rerrrr�<module>s,0"#! j

Spamworldpro Mini