File: //opt/alt/python37/lib/python3.7/site-packages/lvemanager/__pycache__/config_parser.cpython-37.pyc
B
���^ � @ s^ d dl mZ d dl mZ d dl mZ d dlmZ d dlmZ d dl m
Z
G dd� dej�Zd 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 )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.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_section�itemsr �remove_sectionr �NoSectionError�set)r �section�default_section_items�key�valuer r r r "