관리-도구
편집 파일: limits_validator.cpython-311.opt-1.pyc
� �EBg�0 � � � d dl mZ d dlmZ d dlmZmZmZmZm Z m Z d dlmZ d dl mZmZ d dlmZ ddlmZmZmZmZmZ dd lmZ G d � d� � ZdS ) � )�defaultdict)�chain)�Any�Dict�List�Optional�Tuple�Union)�LveCtl)�DEFAULTS�LimitsDataStorage)�DEFAULT_PROVIDER� )�ENTITY_DEFAULTS�ENTITY_PACKAGE�ENTITY_RESELLER�ENTITY_USER� BaseValidator)�EpNprocValidatorc � � e Zd Zddddd�ZddiZegZdd iZdd�Ze d� � � Z d � Zefd�Z d� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Ze defd�� � Zd S )�LimitsValidatorzUser(s)z Package(s)zReseller(s)zDefaults of resellers)�user�package�reseller�defaultsr zHoster defaults limitszinherited from Globalzinherited from HosterNc � � |p t � � | _ |pt | j � � g| _ d d d d d�| _ d S )N)� common_msg�specific_msg�affected_entity� entity_id)r �limits_providerr �_list_validators�message_dict)�self�_limits_data_storage� validatorss �)py/cllimits_validator/limits_validator.py�__init__zLimitsValidator.__init__2 sY � �3�J�7H�7J�7J��� *� ! ��T�1�2�2�/ ��� � �#�� � ����� c � � | d }| d }| d }| d }|�M|�K|t k rd}n?|t k rd|� d�}n-|t k rd |� d�}n|t k rd |� d�}n d|� d�}nd}|�d}|� d |� d |� �}|S )z� Format message string from single message dict. That function should be used for formatting message while validation input limits r r r r Nz"Hoster defaults limits is affectedzDefaults limits of Reseller "z" are affected.zLimits of user with LVE ID "zLimits of Reseller "zLimits of package "� � )r r r r )�msg_dictr r r r �msg_about_affect� result_msgs r'