관리-도구
편집 파일: __init__.cpython-311.pyc
� P�Dg�r � �8 � d Z dZddlZddlZddlZddlmZmZ ddlZddl Z ddl Z ddlZddlm Z mZmZ ddlmZmZ ddlmZ G d� d e � � Z G d � de � � Z G d� d � � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Zd� Zd� Zd� Z G d� de� � Zd� Zd� Z d� Z!d:d�Z"d� Z#d � Z$d:d!�Z%d"� Z&d#� Z'd$� Z(d%� Z)d&� Z*d'� Z+d(� Z,d)� Z-d*� Z.d+d+d,d,d,d,d-�Z/ d.� Z0d/� Z1d0� Z2d:d1�Z3 G d2� d3� � Z4d4d5d6d7d8�Z5d:d9�Z6dS );z: Miscellaneous utilities for the documentation utilities. �reStructuredText� N)�PurePath�Path)�ApplicationError� DataError�__version_info__)�io�nodes)�unescapec � � e Zd Zd� ZdS )� SystemMessagec �n � t � | |� � � � � || _ d S �N)� Exception�__init__�astext�level)�self�system_messager s �w/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/docutils/utils/__init__.pyr zSystemMessage.__init__ s/ � ����4��!6�!6�!8�!8�9�9�9��� � � � N)�__name__� __module__�__qualname__r � r r r r s# � � � � � �� � � � r r c � � e Zd ZdS )�SystemMessagePropagationN�r r r r r r r r ! s � � � � � ��Dr r c � � e Zd ZdZd� � � Z ed� � \ ZZZ Z Z dd�Z dd�Z d � Zd � Zd� Zd� Zd � Zd� Zd� Zd� Zd� ZdS )�Reporteraq Info/warning/error reporter and ``system_message`` element generator. Five levels of system messages are defined, along with corresponding methods: `debug()`, `info()`, `warning()`, `error()`, and `severe()`. There is typically one Reporter object per process. A Reporter object is instantiated with thresholds for reporting (generating warnings) and halting processing (raising exceptions), a switch to turn debug output on or off, and an I/O stream for warnings. These are stored as instance attributes. When a system message is generated, its level is compared to the stored thresholds, and a warning or error is generated as appropriate. Debug messages are produced if the stored debug switch is on, independently of other thresholds. Message output is sent to the stored warning stream if not set to ''. The Reporter class also employs a modified form of the "Observer" pattern [GoF95]_ to track system messages generated. The `attach_observer` method should be called before parsing, with a bound method or function which accepts system messages. The observer can be removed with `detach_observer`, and another added in its place. .. [GoF95] Gamma, Helm, Johnson, Vlissides. *Design Patterns: Elements of Reusable Object-Oriented Software*. Addison-Wesley, Reading, MA, USA, 1995. zDEBUG INFO WARNING ERROR SEVERE� NF�backslashreplacec � � || _ || _ || _ || _ || _ t |t j � � st j |||� � }|| _ |pt |dd� � | _ g | _ d| _ dS )a7 :Parameters: - `source`: The path to or description of the source data. - `report_level`: The level at or above which warning output will be sent to `stream`. - `halt_level`: The level at or above which `SystemMessage` exceptions will be raised, halting execution. - `debug`: Show debug (level=0) system messages? - `stream`: Where warning output is sent. Can be file-like (has a ``.write`` method), a string (file name, opened for writing), '' (empty string) or `False` (for discarding all stream messages) or `None` (implies `sys.stderr`; default). - `encoding`: The output encoding. - `error_handler`: The error handler for stderr output encoding. �encoding�ascii���N) �source� error_handler� debug_flag�report_level� halt_level� isinstancer �ErrorOutput�stream�getattrr$ � observers� max_level)r r'