관리-도구
편집 파일: writer.cpython-311.pyc
� �܋f^ � � � d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z m Z ddlmZm Z mZmZmZ ddlmZmZmZmZ ddlmZ dd lmZ G d � d� � ZdS )z,Utilities for creating VCG and Dot diagrams.� )�annotationsN)�Iterable)�modutils�nodes)�ClassDiagram�ClassEntity� DiagramEntity�PackageDiagram� PackageEntity)�EdgeType�NodeProperties�NodeType�Printer)�get_printer_for_filetype)�is_exceptionc �Z � e Zd ZdZdd�Zdd �Zdd�Zd d�Zd!d�Zd"d�Z d#d�Z d$d�Zd%d�ZdS )&� DiagramWriterz(Base class for writing project diagrams.�config�argparse.Namespace�return�Nonec �� � || _ t | j j � � | _ | d| _ | j j | _ t j | j j � � | _ i | _ d S )N� )r r � output_format� printer_class� file_name�max_color_depth�depth� itertools�cycle� color_palette�available_colors�used_colors)�selfr s �h/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/pyreverse/writer.py�__init__zDiagramWriter.__init__ s\ � ����5�d�k�6O�P�P���������[�0�� � )����0I� J� J���+-����� �diadefs�'Iterable[ClassDiagram | PackageDiagram]c �2 � |D �]}|j � � � � dd� � � dd� � }|� d| j j � �}t j � | j j � � r*t j � | j j |� � }| � ||� � t |t � � r| � |� � n| � |� � | � � � ��dS )z1Write files for <project> according to <diadefs>.�/�_� �.N)�title�strip�replacer r �os�path�exists�output_directory�join�set_printer� isinstancer �write_packages� write_classes�save)r$ r( �diagram�basenamer s r% �writezDiagramWriter.write) s� � �� � �G��}�*�*�,�,�4�4�S�#�>�>�F�F�s�C�P�P�H�#�A�A�d�k�&?�A�A�I��w�~�~�d�k�:�;�;� R��G�L�L���)E�y�Q�Q� ����Y��1�1�1��'�>�2�2� ,��#�#�G�,�,�,�,��"�"�7�+�+�+��I�I�K�K�K�K� � r'