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:
|
else:
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
|
||||||
def getdefaultint(self, section, option, default, *args, **kwargs):
|
def getdefaultint(self, section, option, default, *args, **kwargs):
|
||||||
"""Same as config.getint, but returns the value of `default`
|
"""Same as config.getint, but returns the value of `default`
|
||||||
if there is no such option specified."""
|
if there is no such option specified."""
|
||||||
@ -46,7 +45,6 @@ class CustomConfigParser(SafeConfigParser):
|
|||||||
else:
|
else:
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
|
||||||
def getdefaultfloat(self, section, option, default, *args, **kwargs):
|
def getdefaultfloat(self, section, option, default, *args, **kwargs):
|
||||||
"""Same as config.getfloat, but returns the value of `default`
|
"""Same as config.getfloat, but returns the value of `default`
|
||||||
if there is no such option specified."""
|
if there is no such option specified."""
|
||||||
@ -131,7 +129,6 @@ class CustomConfigParser(SafeConfigParser):
|
|||||||
if not self.has_option(section, option):
|
if not self.has_option(section, option):
|
||||||
self.set(section, option, value)
|
self.set(section, option, value)
|
||||||
|
|
||||||
|
|
||||||
def apply_xforms(self, string, transforms):
|
def apply_xforms(self, string, transforms):
|
||||||
"""Applies set of transformations to a string.
|
"""Applies set of transformations to a string.
|
||||||
|
|
||||||
@ -150,7 +147,6 @@ class CustomConfigParser(SafeConfigParser):
|
|||||||
return string
|
return string
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def CustomConfigDefault():
|
def CustomConfigDefault():
|
||||||
"""Just a constant that won't occur anywhere else.
|
"""Just a constant that won't occur anywhere else.
|
||||||
|
|
||||||
@ -161,7 +157,6 @@ def CustomConfigDefault():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ConfigHelperMixin(object):
|
class ConfigHelperMixin(object):
|
||||||
"""Allow comfortable retrieving of config values pertaining
|
"""Allow comfortable retrieving of config values pertaining
|
||||||
to a section.
|
to a section.
|
||||||
@ -208,8 +203,6 @@ class ConfigHelperMixin(object):
|
|||||||
raise NotImplementedError("ConfigHelperMixin.getconfig() "
|
raise NotImplementedError("ConfigHelperMixin.getconfig() "
|
||||||
"is to be overriden")
|
"is to be overriden")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getsection(self):
|
def getsection(self):
|
||||||
"""Returns name of configuration section in which our
|
"""Returns name of configuration section in which our
|
||||||
class keeps its configuration.
|
class keeps its configuration.
|
||||||
@ -219,7 +212,6 @@ class ConfigHelperMixin(object):
|
|||||||
raise NotImplementedError("ConfigHelperMixin.getsection() "
|
raise NotImplementedError("ConfigHelperMixin.getsection() "
|
||||||
"is to be overriden")
|
"is to be overriden")
|
||||||
|
|
||||||
|
|
||||||
def getconf(self, option, default=CustomConfigDefault):
|
def getconf(self, option, default=CustomConfigDefault):
|
||||||
"""Retrieves string from the configuration.
|
"""Retrieves string from the configuration.
|
||||||
|
|
||||||
@ -233,7 +225,6 @@ class ConfigHelperMixin(object):
|
|||||||
self.getconfig().getdefault,
|
self.getconfig().getdefault,
|
||||||
self.getconfig().get)
|
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.
|
"""Retrieves string from the configuration transforming the result.
|
||||||
|
|
||||||
@ -249,7 +240,6 @@ class ConfigHelperMixin(object):
|
|||||||
value = self.getconf(option, default)
|
value = self.getconf(option, default)
|
||||||
return self.getconfig().apply_xforms(value, xforms)
|
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.
|
"""Retrieves boolean value from the configuration.
|
||||||
|
|
||||||
@ -263,7 +253,6 @@ class ConfigHelperMixin(object):
|
|||||||
self.getconfig().getdefaultboolean,
|
self.getconfig().getdefaultboolean,
|
||||||
self.getconfig().getboolean)
|
self.getconfig().getboolean)
|
||||||
|
|
||||||
|
|
||||||
def getconfint(self, option, default=CustomConfigDefault):
|
def getconfint(self, option, default=CustomConfigDefault):
|
||||||
"""
|
"""
|
||||||
Retrieves integer value from the configuration.
|
Retrieves integer value from the configuration.
|
||||||
@ -279,7 +268,6 @@ class ConfigHelperMixin(object):
|
|||||||
self.getconfig().getdefaultint,
|
self.getconfig().getdefaultint,
|
||||||
self.getconfig().getint)
|
self.getconfig().getint)
|
||||||
|
|
||||||
|
|
||||||
def getconffloat(self, option, default=CustomConfigDefault):
|
def getconffloat(self, option, default=CustomConfigDefault):
|
||||||
"""Retrieves floating-point value from the configuration.
|
"""Retrieves floating-point value from the configuration.
|
||||||
|
|
||||||
@ -293,7 +281,6 @@ class ConfigHelperMixin(object):
|
|||||||
self.getconfig().getdefaultfloat,
|
self.getconfig().getdefaultfloat,
|
||||||
self.getconfig().getfloat)
|
self.getconfig().getfloat)
|
||||||
|
|
||||||
|
|
||||||
def getconflist(self, option, separator_re,
|
def getconflist(self, option, separator_re,
|
||||||
default=CustomConfigDefault):
|
default=CustomConfigDefault):
|
||||||
"""Retrieves strings from the configuration and splits it
|
"""Retrieves strings from the configuration and splits it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user