Reformat offlineimap/CustomConfig.py
Add some spaces, remove lines,... now format is better (lintian).
This commit is contained in:
parent
9f15c05520
commit
8b35dbabe1
@ -36,7 +36,6 @@ class CustomConfigParser(SafeConfigParser):
|
||||
else:
|
||||
return default
|
||||
|
||||
|
||||
def getdefaultint(self, section, option, default, *args, **kwargs):
|
||||
"""Same as config.getint, but returns the value of `default`
|
||||
if there is no such option specified."""
|
||||
@ -46,7 +45,6 @@ class CustomConfigParser(SafeConfigParser):
|
||||
else:
|
||||
return default
|
||||
|
||||
|
||||
def getdefaultfloat(self, section, option, default, *args, **kwargs):
|
||||
"""Same as config.getfloat, but returns the value of `default`
|
||||
if there is no such option specified."""
|
||||
@ -74,7 +72,7 @@ class CustomConfigParser(SafeConfigParser):
|
||||
return re.split(separator_re, val)
|
||||
except re.error as e:
|
||||
six.reraise(Error,
|
||||
Error("Bad split regexp '%s': %s"%
|
||||
Error("Bad split regexp '%s': %s" %
|
||||
(separator_re, e)),
|
||||
exc_info()[2])
|
||||
|
||||
@ -131,7 +129,6 @@ class CustomConfigParser(SafeConfigParser):
|
||||
if not self.has_option(section, option):
|
||||
self.set(section, option, value)
|
||||
|
||||
|
||||
def apply_xforms(self, string, transforms):
|
||||
"""Applies set of transformations to a string.
|
||||
|
||||
@ -150,7 +147,6 @@ class CustomConfigParser(SafeConfigParser):
|
||||
return string
|
||||
|
||||
|
||||
|
||||
def CustomConfigDefault():
|
||||
"""Just a constant that won't occur anywhere else.
|
||||
|
||||
@ -161,7 +157,6 @@ def CustomConfigDefault():
|
||||
pass
|
||||
|
||||
|
||||
|
||||
class ConfigHelperMixin(object):
|
||||
"""Allow comfortable retrieving of config values pertaining
|
||||
to a section.
|
||||
@ -208,8 +203,6 @@ class ConfigHelperMixin(object):
|
||||
raise NotImplementedError("ConfigHelperMixin.getconfig() "
|
||||
"is to be overriden")
|
||||
|
||||
|
||||
|
||||
def getsection(self):
|
||||
"""Returns name of configuration section in which our
|
||||
class keeps its configuration.
|
||||
@ -219,8 +212,7 @@ class ConfigHelperMixin(object):
|
||||
raise NotImplementedError("ConfigHelperMixin.getsection() "
|
||||
"is to be overriden")
|
||||
|
||||
|
||||
def getconf(self, option, default = CustomConfigDefault):
|
||||
def getconf(self, option, default=CustomConfigDefault):
|
||||
"""Retrieves string from the configuration.
|
||||
|
||||
Arguments:
|
||||
@ -233,8 +225,7 @@ class ConfigHelperMixin(object):
|
||||
self.getconfig().getdefault,
|
||||
self.getconfig().get)
|
||||
|
||||
|
||||
def getconf_xform(self, option, xforms, default = CustomConfigDefault):
|
||||
def getconf_xform(self, option, xforms, default=CustomConfigDefault):
|
||||
"""Retrieves string from the configuration transforming the result.
|
||||
|
||||
Arguments:
|
||||
@ -249,8 +240,7 @@ class ConfigHelperMixin(object):
|
||||
value = self.getconf(option, default)
|
||||
return self.getconfig().apply_xforms(value, xforms)
|
||||
|
||||
|
||||
def getconfboolean(self, option, default = CustomConfigDefault):
|
||||
def getconfboolean(self, option, default=CustomConfigDefault):
|
||||
"""Retrieves boolean value from the configuration.
|
||||
|
||||
Arguments:
|
||||
@ -263,8 +253,7 @@ class ConfigHelperMixin(object):
|
||||
self.getconfig().getdefaultboolean,
|
||||
self.getconfig().getboolean)
|
||||
|
||||
|
||||
def getconfint(self, option, default = CustomConfigDefault):
|
||||
def getconfint(self, option, default=CustomConfigDefault):
|
||||
"""
|
||||
Retrieves integer value from the configuration.
|
||||
|
||||
@ -279,8 +268,7 @@ class ConfigHelperMixin(object):
|
||||
self.getconfig().getdefaultint,
|
||||
self.getconfig().getint)
|
||||
|
||||
|
||||
def getconffloat(self, option, default = CustomConfigDefault):
|
||||
def getconffloat(self, option, default=CustomConfigDefault):
|
||||
"""Retrieves floating-point value from the configuration.
|
||||
|
||||
Arguments:
|
||||
@ -293,9 +281,8 @@ class ConfigHelperMixin(object):
|
||||
self.getconfig().getdefaultfloat,
|
||||
self.getconfig().getfloat)
|
||||
|
||||
|
||||
def getconflist(self, option, separator_re,
|
||||
default = CustomConfigDefault):
|
||||
default=CustomConfigDefault):
|
||||
"""Retrieves strings from the configuration and splits it
|
||||
into the list of strings.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user