File: //var/opt/nydus/ops/primordial/__pycache__/config.cpython-39.pyc
a
�,�hm � @ sJ d dl mZ d dlmZmZmZmZmZ G dd� d�ZG dd� de�Z dS )� )�ConfigParser)�Any�Callable�Dict�List�Optionalc @ sl e Zd ZdZdeeed�dd�Zd
eee ed�dd�Z deee
e
d�dd �Zdeee ed�d
d�Z
dS )�ConfigzBase configuration object.N��key�default�returnc C s t td ��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
s z
Config.getc C s t | �||��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
)�boolr r r r r �get_bool s zConfig.get_boolc C s t | �||��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
)�intr r r r r �get_int s zConfig.get_intc C s t | �||��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
)�floatr r r r r � get_float( s zConfig.get_float)N)N)N)N)r �
__module__�__qualname__�__doc__�strr r r r r r r r r r r r r r s
r c @ s� e Zd ZdZdZdZg Zdee ee ee ee
f dd�dd�Zee
d�d d
�Zde
ee
e
d�dd
�Zdee
e
d�dd�Zdeee ed�dd�Zdeee ed�dd�Zdeee ed�dd�ZdS )�
FileConfigzVConfig class that loads configuration options from the locally-cached ZooKeeper configz/var/cache/hfs/config.inizconfig-defaultN)�service_prefix�filename�defaultsr c C sx |d u r| j }t| jd d�| _| j�|� g | _|rb|�d�}|rb| j�d�|�d � |� � q>| j�d� || _
d S )N)�default_section�
interpolation�.� )�DEFAULT_FILENAMEr r"