X 8W d Z ddlmZ ddlZddlmZ ddlmZ ddlm Z m Z e rddlmZm Z mZmZmZ G d d ZdS ) zUniversal 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_CHECKINGTextIO) BaseLayoutEvaluationSection ParagraphSectionTablec d e Zd ZdZej dfddZdd ZdddZddZ ddZ ddZd dZd!dZ dS )" BaseWriterzBase class for ureport writers.Nlayoutr streamr encoding str | NonereturnNonec |st |dd }|pd| _ || _ | | | | dS )zFormat 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 outbegin_formataccept end_format)selfr r r s w/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/reporters/ureports/base_writer.pyformatzBaseWriter.format sj <vz7;;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> VZ44 ELL r stringstrc 6 | |dz dS )z"Write a line in the output buffer. N)writer r&