관리-도구
편집 파일: base_writer.cpython-311.pyc
� �܋ff � � � d Z ddlmZ ddlZddlmZ ddlmZ ddlm Z m Z e rddlmZm Z mZmZmZ G d� d � � ZdS ) z�Universal report objects and some formatting drivers. A way to create simple reports using python objects, primarily designed to be formatted as text and html. � )�annotationsN)�Iterator)�StringIO)� TYPE_CHECKING�TextIO)� BaseLayout�EvaluationSection� Paragraph�Section�Tablec �d � e Zd ZdZej dfdd�Zdd �Zddd�Zdd�Z dd�Z dd�Zd d�Zd!d�Z dS )"� BaseWriterzBase class for ureport writers.N�layoutr �streamr �encoding� str | None�return�Nonec �� � |st |dd� � }|pd| _ || _ | � � � |� | � � | � � � dS )z�Format and write the given layout into the stream object. unicode policy: unicode strings may be found in the layout; try to call 'stream.write' with it, but give it back encoded using the given encoding if it fails r zUTF-8N)�getattrr �out�begin_format�accept� end_format)�selfr r r s �v/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/reporters/ureports/base_writer.py�formatzBaseWriter.format sj � � � <��v�z�7�;�;�H� �+�G�� ����������� � �d������������ �'EvaluationSection | Paragraph | Sectionc �X � t |dd� � D ]}|� | � � �dS )zgRecurse on the layout children and call their accept method (see the Visitor pattern). �children� N)r r )r r �childs r �format_childrenzBaseWriter.format_children3 s>