Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cherrypy/test/__pycache__/logtest.cpython-39.pyc
Ðазад
a v�h� � @ s� d Z ddlZddlZddlmZ ddlZddlmZ zddlZdd� Z W n* e yr ddlZddlZdd� Z Y n0 G dd � d e �ZdS ) z;logtest, a unittest.TestCase helper for testing log output.� N)�UUID)� text_or_bytesc C s t �� S �N)�msvcrtZgetch� r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cherrypy/test/logtest.py�getchar s r c C s\ t j�� } t�| �}z0t�t j�� � t j�d�}W t�| tj |� nt�| tj |� 0 |S )N� ) �sys�stdin�fileno�termios� tcgetattr�ttyZsetraw�read� tcsetattr� TCSADRAIN)�fdZold_settings�chr r r r s $c @ st e Zd ZdZdZdZdZdZdd� Zdd� Z d d � Z ddd�Zdd d�Zddd�Z ddd�Zddd�Zddd�ZdS )�LogCasea� unittest.TestCase mixin for testing log messages. logfile: a filename for the desired log. Yes, I know modes are evil, but it makes the test functions so much cleaner to set this once. lastmarker: the last marker in the log. This can be used to search for messages since the last marker. markerPrefix: a string with which to prefix log markers. This should be unique enough from normal log output to use for marker identification. FNs test suite marker: c C sH t d� t d| � | js$t�|��d}tj�|d � tj�� t� � � }|dvrVqBt |� � � |dkr�t |�D ]T\}}|d | j dkr�tj�d � t� �� } tj�d � | dkr� q�t |� � � qrnh|dkr�t t|p�| j�� nL|d kr�t t|�� n6|dk�r d S |dk�r t�|��n|dk�r2| �� tj�|d � qBd S )N� z ERROR: %szH Show: [L]og [M]arker [P]attern; [I]gnore, [R]aise, or sys.e[X]it >> � ZMPLIRX�Lr r z<-- More --> z �q�M�P�I�R�X)�print�interactive�pytestZfailr �stdout�write�flushr �upper� enumerateZconsole_height�lower�rstrip�repr� lastmarker�exit) �self�msg�data�marker�pattern�p�i�x�line�mr r r �_handleLogError5 s>