o
    FDi                     @   s  d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
mZmZ edeeeedZedeeeeeeeeddd	ZG d
d de	ZG dd de	Zede
eef eeeeeedZG dd deeeZe
ee eee f Zeegdf ZG dd de	Zee Zeeegef ZdS )z#
https://peps.python.org/pep-3333/
    )TracebackType)	AnyCallableIterableListOptionalProtocolTupleType	TypedDictCGIRequiredDefined)REQUEST_METHODSERVER_NAMESERVER_PORTSERVER_PROTOCOLCGIOptionalDefined)REQUEST_URIREMOTE_ADDRREMOTE_PORTSCRIPT_NAME	PATH_INFOQUERY_STRINGCONTENT_TYPECONTENT_LENGTHF)totalc                   @   sP   e Zd ZdZddedefddZddedefdd	Zdd
edee fddZ	dS )InputStreamas  
    An input stream (file-like object) from which the HTTP request body bytes can be
    read. (The server or gateway may perform reads on-demand as requested by the
    application, or it may pre- read the client's request body and buffer it in-memory
    or on disk, or use any other technique for providing such an input stream, according
    to its preference.)
    sizereturnc                C      t )aB  
        The server is not required to read past the client's specified Content-Length,
        and should simulate an end-of-file condition if the application attempts to read
        past that point. The application should not attempt to read more data than is
        specified by the CONTENT_LENGTH variable.
        A server should allow read() to be called without an argument, and return the
        remainder of the client's input stream.
        A server should return empty bytestrings from any attempt to read from an empty
        or exhausted input stream.
        NotImplementedError)selfr    r#   K/var/www/Datamplify/venv/lib/python3.10/site-packages/a2wsgi/wsgi_typing.pyreadN   s   zInputStream.readlimitc                C   r   )a  
        Servers should support the optional "size" argument to readline(), but as in
        WSGI 1.0, they are allowed to omit support for it.
        (In WSGI 1.0, the size argument was not supported, on the grounds that it might
        have been complex to implement, and was not often used in practice... but then
        the cgi module started using it, and so practical servers had to start
        supporting it anyway!)
        r    )r"   r&   r#   r#   r$   readline[   s   	zInputStream.readlinehintc                C   r   )z
        Note that the hint argument to readlines() is optional for both caller and
        implementer. The application is free not to supply it, and the server or gateway
        is free to ignore it.
        r    )r"   r(   r#   r#   r$   	readlinesf   s   zInputStream.readlinesN)r   )
__name__
__module____qualname____doc__intbytesr%   r'   r   r)   r#   r#   r#   r$   r   E   s
    r   c                   @   sB   e Zd ZdZdddZdedefddZd	ee defd
dZ	dS )ErrorStreama  
    An output stream (file-like object) to which error output can be written,
    for the purpose of recording program or other errors in a standardized and
    possibly centralized location. This should be a "text mode" stream;
    i.e., applications should use "
" as a line ending, and assume that it will
    be converted to the correct line ending by the server/gateway.
    (On platforms where the str type is unicode, the error stream should accept
    and log arbitrary unicode without raising an error; it is allowed, however,
    to substitute characters that cannot be rendered in the stream's encoding.)
    For many servers, wsgi.errors will be the server's main error log. Alternatively,
    this may be sys.stderr, or a log file of some sort. The server's documentation
    should include an explanation of how to configure this or where to find the
    recorded output. A server or gateway may supply different error streams to
    different applications, if this is desired.
    r   Nc                 C   r   )a  
        Since the errors stream may not be rewound, servers and gateways are free to
        forward write operations immediately, without buffering. In this case, the
        flush() method may be a no-op. Portable applications, however, cannot assume
        that output is unbuffered or that flush() is a no-op. They must call flush()
        if they need to ensure that output has in fact been written.
        (For example, to minimize intermingling of data from multiple processes writing
        to the same error log.)
        r    )r"   r#   r#   r$   flush   s   
zErrorStream.flushsc                C   r   Nr    )r"   r2   r#   r#   r$   write      zErrorStream.writeseqc                C   r   r3   r    )r"   r6   r#   r#   r$   
writelines   r5   zErrorStream.writelines)r   N)
r*   r+   r,   r-   r1   strr   r4   r   r7   r#   r#   r#   r$   r0   o   s
    
r0   WSGIDefined)zwsgi.versionzwsgi.url_schemez
wsgi.inputzwsgi.errorszwsgi.multithreadzwsgi.multiprocesszwsgi.run_oncec                   @   s   e Zd ZdZdS )Environz
    WSGI Environ
    N)r*   r+   r,   r-   r#   r#   r#   r$   r:      s    r:   Nc                	   @   s:   e Zd Z	ddedeeeef  dee defddZ	dS )	StartResponseNstatusresponse_headersexc_infor   c                C   r   r3   r    )r"   r<   r=   r>   r#   r#   r$   __call__   s   zStartResponse.__call__r3   )
r*   r+   r,   r8   r   r	   r   ExceptionInfoWriteCallabler?   r#   r#   r#   r$   r;      s    r;   )r-   typesr   typingr   r   r   r   r   r   r	   r
   r   r8   r   r   r   r0   r.   boolr9   r:   BaseExceptionr@   r/   rA   r;   IterableChunksWSGIAppr#   r#   r#   r$   <module>   sV    ,*$
