File: //opt/alt/python37/lib/python3.7/site-packages/clcommon/__pycache__/clconfpars.cpython-37.opt-1.pyc
B
���;d,�� @ s� d dl Z d dlZd dlZd dlmZ d dlZG dd� de�ZG dd� de�ZdZ d+d d
�Z
dZeed�d
d�Z
d,dd�Zi Zd-dd�Zd.dd�Ze�dejejB ejB �Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zed%d&d'd(g�Zd)d*� ZdS )/� N)�
namedtuplec @ s e Zd Zdd� ZdS )�WebConfigParsingErrorc C s
|| _ d S )N)�message)�selfr � r ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.1-1.el9.cloudlinux.x86_64/opt/alt/python37/lib/python3.7/site-packages/clcommon/clconfpars.py�__init__ s zWebConfigParsingError.__init__N)�__name__�
__module__�__qualname__r r r r r r s r c @ s e Zd Zdd� ZdS )�WebConfigMissingc C s
|| _ d S )N)r )r r r r r r s zWebConfigMissing.__init__N)r r
r r r r r r r s r ZasectionFc C s� t jdd dd�}|rt|_|rJt| d��}|�� �t�� d�}W d Q R X nt| d��}|�� }W d Q R X |j dt
� d�| | d � t|jt
d
��S )NTF)Zallow_no_valueZ
interpolation�strict�rb�replace�r�[z]
)�source)Zsection)
�configparserZConfigParser�strZoptionxform�open�read�decode�localeZgetpreferredencodingZread_string�SECHEAD�dict�items)�pathZcase_sensitiveZignore_bad_encodingZconfig�f�rawr r r �load s r )�'�")�val�returnc C s$ | � t�r | �t�r | dd� S | S )zW
Strips single or double quote char only if the quote present from both sides.
� ���)�
startswith�_QUOTES�endswith)r"