HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/lvemanager/__pycache__/config_parser.cpython-37.pyc
B

���^�@s^ddlmZddlmZddlmZddlmZddlmZddl	m
Z
Gdd�dej�Zd	S)
�)�print_function)�division)�absolute_import)�configparser)�StringIO)�
basestringc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�SectionlessConfigParserz�
    Extends ConfigParser to allow files without sections.

    This is done by wrapping read files and prepending them with a placeholder
    section, which defaults to '__config__'
    cOs8|�dd�}tjj|f|�|�d|_|�|p0d�dS)N�default_section�
__config__)�pop�ConfigParser�RawConfigParser�__init__�_default_section�set_default_section)�self�args�kwargsr	�r�I/opt/alt/python37/lib/python3.7/site-packages/lvemanager/config_parser.pyrsz SectionlessConfigParser.__init__cCs|jS)N)r)rrrr�get_default_sectionsz+SectionlessConfigParser.get_default_sectioncCsh|�|�y|�|j�}|�|j�Wntjk
r<Yn"Xx|D]\}}|�|||�qDW||_dS)N)�add_section�itemsr�remove_sectionr�NoSectionError�set)r�section�default_section_items�key�valuerrrr"s
z+SectionlessConfigParser.set_default_sectionc
Csjt|t�r|g}g}xP|D]H}y"t|��}|�|�WdQRXWntk
rVwYqX|�|�qW|S)N)�
isinstancer�open�readfp�IOError�append)r�	filenames�read_ok�filename�fprrr�read1s


zSectionlessConfigParser.readcOslt�}y|j|_Wntk
r&YnX|�d|jd�|�|���|�dd�tjj	||f|�|�S)N�[z]
r)
r�name�AttributeError�writerr)�seekrr
r")rr(rr�streamrrrr"AszSectionlessConfigParser.readfpcCs�yJ|�|j�}|�|j�x"|D]\}}|�d�||��q W|�d�Wntjk
r`YnXtj�||�|�|j�x |D]\}}|�	|j||�q�WdS)Nz{0}={1}
�
)
rrrr-�formatrrr
rr)rr(rrrrrrr-PszSectionlessConfigParser.writeN)
�__name__�
__module__�__qualname__�__doc__rrrr)r"r-rrrrrsrN)
�
__future__rrr�future.movesrr�iorZ
past.builtinsrr
rrrrr�<module>	s