B
Ud @ s^ d dl mZ d dl mZ d dl mZ d dlmZ d dlmZ d dl m
Z
G dd dejZd S )
)print_function)division)absolute_import)configparser)StringIO)
basestringc @ s@ e Zd ZdZdd Zdd Zdd Zdd Zd
d Zdd
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__'
c O s8 | dd }tjj| f|| d | _| |p0d d S )Ndefault_section
__config__)popConfigParserRawConfigParser__init___default_sectionset_default_section)selfargskwargsr r I/opt/alt/python37/lib/python3.7/site-packages/lvemanager/config_parser.pyr s z SectionlessConfigParser.__init__c C s | j S )N)r )r r r r get_default_section s z+SectionlessConfigParser.get_default_sectionc C sh | | y| | j}| | j W n tjk
r< Y n"X x|D ]\}}| ||| qDW || _d S )N)add_sectionitemsr remove_sectionr NoSectionErrorset)r sectiondefault_section_itemskeyvaluer r r r "