[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@13.59.19.39: ~ $
U

'�7`J�@s�ddlZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZddlmZedd	�ZGd
d�de�ZdS)�N)�
namedtuple)�Any�Callable�Dict�Iterable�List�Tuple�)�AbstractAccessLogger)�BaseRequest)�StreamResponse�	KeyMethodz
key methodcs�eZdZdZdddddddd	d
ddd
�ZdZe�d�Ze�d�Z	iZ
efeje
dd��fdd�
Ze
ee
eefd�dd�Zee
eeee
d�dd��Zee
eeee
d�dd��Zeeeee
d�dd��Zeeeee
d�d d!��Zeeeee
d�d"d#��Zeeeee
d�d$d%��Zeeeeed�d&d'��Zeeeeed�d(d)��Zeeeee
d�d*d+��Z eeeee
d�d,d-��Z!eeeee
d�d.d/��Z"eeee#ee
e$eeege
ffd�d0d1�Z%eeedd�d2d3�Z&�Z'S)4�AccessLoggera�Helper object to log access.

    Usage:
        log = logging.getLogger("spam")
        log_format = "%a %{User-Agent}i"
        access_logger = AccessLogger(log, log_format)
        access_logger.log(request, response, time)

    Format:
        %%  The percent sign
        %a  Remote IP-address (IP-address of proxy if using reverse proxy)
        %t  Time when the request was started to process
        %P  The process ID of the child that serviced the request
        %r  First line of request
        %s  Response status code
        %b  Size of response in bytes, including HTTP headers
        %T  Time taken to serve the request, in seconds
        %Tf Time taken to serve the request, in seconds with floating fraction
            in .06f format
        %D  Time taken to serve the request, in microseconds
        %{FOO}i  request.headers['FOO']
        %{FOO}o  response.headers['FOO']
        %{FOO}e  os.environ['FOO']

    Zremote_addressZrequest_start_timeZ
process_idZfirst_request_lineZresponse_statusZ
response_sizeZrequest_timeZrequest_time_fracZrequest_time_microZrequest_headerZresponse_header)�a�t�P�r�s�b�TZTf�D�i�oz/%a %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"z.%(\{([A-Za-z0-9\-_]+)\}([ioe])|[atPrsbOD]|Tf?)z(%[^s])N)�logger�
log_format�returncsDt�j||d�tj�|�}|s4|�|�}|tj|<|\|_|_dS)z�Initialise the logger.

        logger is a logger object to be used for logging.
        log_format is a string with apache compatible log format description.

        )rN)�super�__init__r�
_FORMAT_CACHE�get�compile_format�_log_format�_methods)�selfrrZ_compiled_format��	__class__��B/opt/alt/python38/lib64/python3.8/site-packages/aiohttp/web_log.pyr>s

zAccessLogger.__init__)rrcCs�t�}|j�|�D]�}|ddkrN|j|d}ttd|d�}t||�}n>|j|d|df}ttd|d�}t|t�||d��}|�	|�q|j�
d|�}|j�
d|�}||fS)a�Translate log_format into form usable by modulo formatting

        All known atoms will be replaced with %s
        Also methods for formatting of those atoms will be added to
        _methods in appropriate order

        For example we have log_format = "%a %t"
        This format will be translated to "%s %s"
        Also contents of _methods will be
        [self._format_a, self._format_t]
        These method will be called and results will be passed
        to translated string format.

        Each _format_* method receive 'args' which is list of arguments
        given to self.log

        Exceptions are _format_e, _format_i and _format_o methods which
        also receive key name (by functools.partial)

        r	�rz
_format_%s�z%sz%\1)�list�	FORMAT_RE�findall�LOG_FORMAT_MAP�getattrrr
�	functools�partial�append�sub�
CLEANUP_RE)r#r�methodsZatomZformat_key1�mZ
key_methodZformat_key2r&r&r'r NszAccessLogger.compile_format)�key�request�response�timercCs|dkrdS|j�|d�S)Nz(no headers)�-�Zheadersr�r6r7r8r9r&r&r'�	_format_iwszAccessLogger._format_icCs|j�|d�S�Nr:r;r<r&r&r'�	_format_o�szAccessLogger._format_o)r7r8r9rcCs"|dkrdS|j}|dk	r|SdSr>)Zremote)r7r8r9Zipr&r&r'�	_format_a�szAccessLogger._format_acCs$tj��}|tj|d�}|�d�S)N)Zsecondsz[%d/%b/%Y:%H:%M:%S +0000])�datetimeZutcnowZ	timedelta�strftime)r7r8r9ZnowZ
start_timer&r&r'�	_format_t�s
zAccessLogger._format_tcCsdt��S)Nz<%s>)�os�getpid�r7r8r9r&r&r'�	_format_P�szAccessLogger._format_PcCs(|dkrdSd�|j|j|jj|jj�S)Nr:z{} {} HTTP/{}.{})�format�methodZpath_qs�version�major�minorrFr&r&r'�	_format_r�s�zAccessLogger._format_rcCs|jS�N)ZstatusrFr&r&r'�	_format_s�szAccessLogger._format_scCs|jSrN)Zbody_lengthrFr&r&r'�	_format_b�szAccessLogger._format_bcCstt|��SrN��str�roundrFr&r&r'�	_format_T�szAccessLogger._format_TcCsd|S)Nz%06fr&rFr&r&r'�
_format_Tf�szAccessLogger._format_TfcCstt|d��S)Ni@BrQrFr&r&r'�	_format_D�szAccessLogger._format_Dcs���fdd�|jD�S)Ncs g|]\}}||����f�qSr&r&)�.0r6rIrFr&r'�
<listcomp>�sz-AccessLogger._format_line.<locals>.<listcomp>)r")r#r7r8r9r&rFr'�_format_line�szAccessLogger._format_linecCs�z�|�|||�}t�}t�}|D]J\}}|�|�|jtkrF|||<q |\}	}
|�|	i�}|||
<|||	<q |jj|j	t
|�|d�Wn tk
r�|j�d�YnXdS)N)�extrazError in logging)
rYr*�dictr1r%rRrr�infor!�tuple�	ExceptionZ	exception)r#r7r8r9Zfmt_info�valuesrZr6�valueZk1Zk2Zdctr&r&r'�log�s



zAccessLogger.log)(�__name__�
__module__�__qualname__�__doc__r-Z
LOG_FORMAT�re�compiler+r3r�loggingZLoggerrRrrrr
r �staticmethodrr�floatr=r?r@rCrGrM�intrOrPrTrUrVrrrYra�
__classcell__r&r&r$r'rsr�

)�	�
�r)rAr/rhrDrf�collectionsr�typingrrrrrr�abcr
Zweb_requestrZweb_responserr
rr&r&r&r'�<module>s 


Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 3.61 KB 0644
__init__.cpython-38.pyc File 3.61 KB 0644
abc.cpython-38.opt-1.pyc File 8.11 KB 0644
abc.cpython-38.pyc File 8.11 KB 0644
base_protocol.cpython-38.opt-1.pyc File 2.49 KB 0644
base_protocol.cpython-38.pyc File 2.58 KB 0644
client.cpython-38.opt-1.pyc File 27.85 KB 0644
client.cpython-38.pyc File 28 KB 0644
client_exceptions.cpython-38.opt-1.pyc File 10.03 KB 0644
client_exceptions.cpython-38.pyc File 10.03 KB 0644
client_proto.cpython-38.opt-1.pyc File 5.99 KB 0644
client_proto.cpython-38.pyc File 5.99 KB 0644
client_reqrep.cpython-38.opt-1.pyc File 26.76 KB 0644
client_reqrep.cpython-38.pyc File 27.02 KB 0644
client_ws.cpython-38.opt-1.pyc File 8.65 KB 0644
client_ws.cpython-38.pyc File 8.65 KB 0644
connector.cpython-38.opt-1.pyc File 30.14 KB 0644
connector.cpython-38.pyc File 30.27 KB 0644
cookiejar.cpython-38.opt-1.pyc File 9.07 KB 0644
cookiejar.cpython-38.pyc File 9.11 KB 0644
formdata.cpython-38.opt-1.pyc File 4.38 KB 0644
formdata.cpython-38.pyc File 4.41 KB 0644
frozenlist.cpython-38.opt-1.pyc File 2.56 KB 0644
frozenlist.cpython-38.pyc File 2.56 KB 0644
hdrs.cpython-38.opt-1.pyc File 3.53 KB 0644
hdrs.cpython-38.pyc File 3.53 KB 0644
helpers.cpython-38.opt-1.pyc File 22.43 KB 0644
helpers.cpython-38.pyc File 22.43 KB 0644
http.cpython-38.opt-1.pyc File 1.21 KB 0644
http.cpython-38.pyc File 1.21 KB 0644
http_exceptions.cpython-38.opt-1.pyc File 4.17 KB 0644
http_exceptions.cpython-38.pyc File 4.17 KB 0644
http_parser.cpython-38.opt-1.pyc File 15.58 KB 0644
http_parser.cpython-38.pyc File 15.66 KB 0644
http_websocket.cpython-38.opt-1.pyc File 14.34 KB 0644
http_websocket.cpython-38.pyc File 14.46 KB 0644
http_writer.cpython-38.opt-1.pyc File 4.88 KB 0644
http_writer.cpython-38.pyc File 4.88 KB 0644
locks.cpython-38.opt-1.pyc File 1.65 KB 0644
locks.cpython-38.pyc File 1.65 KB 0644
log.cpython-38.opt-1.pyc File 438 B 0644
log.cpython-38.pyc File 438 B 0644
multipart.cpython-38.opt-1.pyc File 25.11 KB 0644
multipart.cpython-38.pyc File 25.55 KB 0644
payload.cpython-38.opt-1.pyc File 12.8 KB 0644
payload.cpython-38.pyc File 12.8 KB 0644
payload_streamer.cpython-38.opt-1.pyc File 3.15 KB 0644
payload_streamer.cpython-38.pyc File 3.15 KB 0644
pytest_plugin.cpython-38.opt-1.pyc File 9.17 KB 0644
pytest_plugin.cpython-38.pyc File 9.22 KB 0644
resolver.cpython-38.opt-1.pyc File 3.7 KB 0644
resolver.cpython-38.pyc File 3.7 KB 0644
signals.cpython-38.opt-1.pyc File 1.26 KB 0644
signals.cpython-38.pyc File 1.26 KB 0644
streams.cpython-38.opt-1.pyc File 17.57 KB 0644
streams.cpython-38.pyc File 17.84 KB 0644
tcp_helpers.cpython-38.opt-1.pyc File 1.08 KB 0644
tcp_helpers.cpython-38.pyc File 1.08 KB 0644
test_utils.cpython-38.opt-1.pyc File 20.44 KB 0644
test_utils.cpython-38.pyc File 20.58 KB 0644
tracing.cpython-38.opt-1.pyc File 13.98 KB 0644
tracing.cpython-38.pyc File 13.98 KB 0644
typedefs.cpython-38.opt-1.pyc File 1.28 KB 0644
typedefs.cpython-38.pyc File 1.28 KB 0644
web.cpython-38.opt-1.pyc File 9.48 KB 0644
web.cpython-38.pyc File 9.48 KB 0644
web_app.cpython-38.opt-1.pyc File 14.85 KB 0644
web_app.cpython-38.pyc File 14.89 KB 0644
web_exceptions.cpython-38.opt-1.pyc File 11.73 KB 0644
web_exceptions.cpython-38.pyc File 11.73 KB 0644
web_fileresponse.cpython-38.opt-1.pyc File 4.47 KB 0644
web_fileresponse.cpython-38.pyc File 4.51 KB 0644
web_log.cpython-38.opt-1.pyc File 6.96 KB 0644
web_log.cpython-38.pyc File 6.96 KB 0644
web_middlewares.cpython-38.opt-1.pyc File 3.72 KB 0644
web_middlewares.cpython-38.pyc File 3.8 KB 0644
web_protocol.cpython-38.opt-1.pyc File 15.28 KB 0644
web_protocol.cpython-38.pyc File 15.46 KB 0644
web_request.cpython-38.opt-1.pyc File 22.07 KB 0644
web_request.cpython-38.pyc File 22.18 KB 0644
web_response.cpython-38.opt-1.pyc File 18.96 KB 0644
web_response.cpython-38.pyc File 19.87 KB 0644
web_routedef.cpython-38.opt-1.pyc File 7.62 KB 0644
web_routedef.cpython-38.pyc File 7.62 KB 0644
web_runner.cpython-38.opt-1.pyc File 11.35 KB 0644
web_runner.cpython-38.pyc File 11.45 KB 0644
web_server.cpython-38.opt-1.pyc File 2.69 KB 0644
web_server.cpython-38.pyc File 2.69 KB 0644
web_urldispatcher.cpython-38.opt-1.pyc File 40.38 KB 0644
web_urldispatcher.cpython-38.pyc File 41.2 KB 0644
web_ws.cpython-38.opt-1.pyc File 12.77 KB 0644
web_ws.cpython-38.pyc File 12.91 KB 0644
worker.cpython-38.opt-1.pyc File 6.7 KB 0644
worker.cpython-38.pyc File 6.77 KB 0644