HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/primordial/__pycache__/config.cpython-39.pyc
a

�,�hm�@sJddlmZddlmZmZmZmZmZGdd�d�ZGdd�de�Z	dS)�)�ConfigParser)�Any�Callable�Dict�List�Optionalc@sleZdZdZdeeed�dd�Zd
eeeed�dd�Z	deee
e
d�dd	�Zdeeeed�d
d�Z
dS)�ConfigzBase configuration object.N��key�default�returncCsttd��dS)z�
        Get the config option as a string

        :param key: config option name
        :param default: default value if no value exists in the config
        :return: option value
        z.get()N)�NotImplementedError�__name__��selfr
r�r�B/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/primordial/config.py�get
sz
Config.getcCst|�||��S)z�
        Get the config option as a boolean

        :param key: config option name
        :param default: default value if no value exists in the config
        :return: option value
        )�boolrrrrr�get_boolszConfig.get_boolcCst|�||��S)z�
        Get the config option as an integer

        :param key: config option name
        :param default: default value if no value exists in the config
        :return: option value
        )�intrrrrr�get_intszConfig.get_intcCst|�||��S)z�
        Get the config option as a float

        :param key: config option name
        :param default: default value if no value exists in the config
        :return: option value
        )�floatrrrrr�	get_float(szConfig.get_float)N)N)N)N)r�
__module__�__qualname__�__doc__�strrrrrrrrrrrrrrrs



rc@s�eZdZdZdZdZgZdeeeeee	ee
fdd�dd�Zee
d�d	d
�Zde
ee
e
d�dd
�Zdee
e
d�dd�Zdeeeed�dd�Zdeeeed�dd�Zdeeeed�dd�ZdS)�
FileConfigzVConfig class that loads configuration options from the locally-cached ZooKeeper configz/var/cache/hfs/config.inizconfig-defaultN)�service_prefix�filename�defaultsrcCsx|dur|j}t|jdd�|_|j�|�g|_|rb|�d�}|rb|j�d�|�d�|�	�q>|j�d�||_
dS)N)�default_section�
interpolation�.�)�DEFAULT_FILENAMErr"�config�read�prefixes�split�append�join�popr!)rrr r!Zprefix_partsrrr�__init__9s

zFileConfig.__init__)r
rcCs
|�|�S)z�
        Get a config key value as a direct attribute of this class.

        :param key: The config key name
        :return: The config key value, if it exists, or None
        )r)rr
rrr�__getattr__KszFileConfig.__getattr__)�getfuncr
rrcCsN|dur|jr|j�|�}|jD]$}||}||j|dd�}|r qJq |}|S)N)�fallback)r!rr)r")rr0r
r�prefixZprefixed_key�valrrr�_getTs
zFileConfig._getr	cCs|�|jj||�S�N)r4r'rrrrrraszFileConfig.getcCs|�|jj||�Sr5)r4r'�
getbooleanrrrrrdszFileConfig.get_boolcCs|�|jj||�Sr5)r4r'�getintrrrrrgszFileConfig.get_intcCs|�|jj||�Sr5)r4r'�getfloatrrrrrjszFileConfig.get_float)NNN)N)N)N)N)N)rrrrr&r"r)rrrrr.r/rr4rrrrrrrrrrrr3s$��	
rN)
�configparserr�typingrrrrrrrrrrr�<module>s,