Indent errors
This commit is contained in:
parent
74d3d8f1bb
commit
30785db477
28
cfgfile.py
28
cfgfile.py
@ -17,16 +17,16 @@ class Conf(object):
|
||||
cfgfile = ''
|
||||
|
||||
def __init__(self, filename = None):
|
||||
"""if filename is set, open config file and initialize the ConfigParser
|
||||
"""
|
||||
"""if filename is set, open config file and initialize the ConfigParser
|
||||
"""
|
||||
if filename:
|
||||
self.setfilename(filename)
|
||||
# if filename
|
||||
# def __init__
|
||||
|
||||
def setfilename(self, filename):
|
||||
"""initialize the ConfigParser
|
||||
"""
|
||||
"""initialize the ConfigParser
|
||||
"""
|
||||
if len(self.confobj.read(filename)) == 0 or self.confobj.read(filename)[0] != filename:
|
||||
raise Exception('Cannot read config file ' + filename)
|
||||
# if cannot read
|
||||
@ -34,8 +34,8 @@ class Conf(object):
|
||||
# def setfilename
|
||||
|
||||
def get(self, section, option):
|
||||
"""returns the value of option in section
|
||||
"""
|
||||
"""returns the value of option in section
|
||||
"""
|
||||
if not self.cfgfile:
|
||||
raise Exception('No config file set')
|
||||
# if not cfgfile
|
||||
@ -43,22 +43,22 @@ class Conf(object):
|
||||
# def get
|
||||
|
||||
def set(self, section, option, value):
|
||||
"""docstring for update"""
|
||||
"""docstring for update"""
|
||||
self.confobj.set(section, option, value)
|
||||
# def set
|
||||
|
||||
|
||||
def getitems(self, section):
|
||||
"""returns all items in section
|
||||
"""
|
||||
"""returns all items in section
|
||||
"""
|
||||
if not self.cfgfile:
|
||||
raise Exception('No config file set')
|
||||
# if not cfgfile
|
||||
return self.confobj.items(section)
|
||||
# def getitems
|
||||
|
||||
def check(self, section, option):
|
||||
"""checks for option in section"""
|
||||
return self.confobj.has_option(section, option)
|
||||
# def check
|
||||
# class Conf
|
||||
|
||||
|
||||
def check(self, section, option):
|
||||
"""checks for option in section"""
|
||||
return self.confobj.has_option(section, option)
|
Loading…
Reference in New Issue
Block a user