File: //usr/lib/python3.6/site-packages/SSSDConfig/__pycache__/ipachangeconf.cpython-36.opt-1.pyc
3
+�epJ � @ sR d Z ddlZddlZddlZddlZd
dd�ZG dd� de�ZG dd � d e�ZdS )a
ipachangeconf - configuration file manipulation classes and functions
partially based on authconfig code
Copyright (c) 1999-2007 Red Hat, Inc.
Author: Simo Sorce <ssorce@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
� NTc C s� d}t j}|r|t jB }y t j| ||�}tj|tj� W nb tk
r� } zF|j\}}|dkr�yt j |� W n tk
r~ Y nX t
||��W Y d d }~X nX t j|d�S )N� zr+���r )�os�O_RDWR�O_CREAT�open�fcntl�lockfZLOCK_EX�OSError�args�close�IOError�fdopen)�filenameZpermsZcreate�fd�flags�err�errnoZstrerr� r �#/usr/lib/python3.6/ipachangeconf.py�
openLocked s
r c @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zedd� �Zd6d d!�Zd"d#� Zd7d%d&�Zd8d'd(�Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5S )9�
IPAChangeConfc C sX || _ d| _d
| _| jd | _d| _| jd | _d| _| jd | _d| _d| _ d| _
d S )N� � = �=r �#�
�[�]�{�}z.ipabkp)r r r )r r )r )r )r r )r r )�progname�indent�assign�dassign�comment�dcomment�eol�deol�
sectnamdel�
subsectdel�
backup_suffix)�self�namer r r �__init__2 s zIPAChangeConf.__init__c C s
|| _ d S )N)r! )r, r- r r r �setProgName? s zIPAChangeConf.setProgNamec C s6 t |�tkr|| _nt |�tkr*|f| _ntd��d S )Nz Indent must be a list of strings)�type�tupler"