File: //usr/lib/python3/dist-packages/fail2ban/client/__pycache__/configreader.cpython-311.pyc
�
�BdO4 � �� � d Z dZdZddlZddlZddlmZmZ ddlm Z m
Z
mZ dd lm
Z
mZmZmZ e
e� � Zeed
�Zd� Z G d� d
� � Z G d� de
� � Z G d� de� � ZdS )z?Cyril Jaquier, Yaroslav Halchenko, Serg G. Brester (aka sebres)z\Copyright (c) 2004 Cyril Jaquier, 2007 Yaroslav Halchenko, 2015 Serg G. Brester (aka sebres)�GPL� N)�
NoOptionError�NoSectionError� )�sys�SafeConfigParserWithIncludes�logLevel� )� getLogger�_as_bool�_merge_dicts�substituteRecursiveTags)�bool�intc # �� K � t | t t f� � r0| D ]+}t |� � dk r|\ }}}n|dc\ }}}|||fV � �,dS | D ]}| | \ }}|||fV � �dS )z�Iterator over the options template with default options.
Each options entry is composed of an array or tuple with:
[[type, name, ?default?], ...]
Or it is a dict:
{name: [type, default], ...}
r
N)�
isinstance�list�tuple�len)�options�optname�opttype�optvalues �>/usr/lib/python3/dist-packages/fail2ban/client/configreader.py�_OptionsTemplateGenr ) s� � � � � �w��e��%�%�
$�� $� $�g� �'�l�l�Q���!(��G�W�h�h�#*�D� ��W�g�� �'�8� #�#�#�#�#�$� $� � $� $�g��w�'��7�H� �'�8� #�#�#�#�#�$� $� c � � e Zd ZdZdd�Zd� Zd� Zed� � � Zdd�Z dd
�Z
d� Zd� Zdd
�Z
d� Zd� Zdd�Zdi fd�Zd� ZdS )�ConfigReaderzkGeneric config reader class.
A caching adapter which automatically reuses already shared configuration.
Nc � � d | _ d | _ |�|| _ |�|| _ || _ d | _ d S | j �t di |��| _ d S d S )N� )�
_cfg_share�_cfg�_cfg_share_kwargs�_cfg_share_basedir�ConfigReaderUnshared)�self�
use_config�share_config�kwargss r �__init__zConfigReader.__init__D si � ��$�/��$�)����4�9���!�4�?�"�4��!�4�����y��#�-�-�f�-�-�4�9�9�9� �r c �Z � | j r| j � |� � d S || _ d S �N)r"