Fix some pylint warnings

This commit is contained in:
Benjamin Renard 2021-11-23 13:08:44 +01:00
parent 31b994ad3c
commit 4d4e8f133b
2 changed files with 7 additions and 2 deletions

View file

@ -533,6 +533,9 @@ class ConfigSection:
class RawWrappedTextHelpFormatter(argparse.RawDescriptionHelpFormatter): class RawWrappedTextHelpFormatter(argparse.RawDescriptionHelpFormatter):
"""
Custom TextHelpFormatter for argparse.ArgumentParser that allowing line to keep line return
"""
def _split_lines(self, text, width): def _split_lines(self, text, width):
result = [] result = []
@ -551,7 +554,7 @@ class RawWrappedTextHelpFormatter(argparse.RawDescriptionHelpFormatter):
return result return result
class Config: class Config: # pylint: disable=too-many-instance-attributes
""" Configuration helper """ """ Configuration helper """
def __init__(self, appname, shortname=None, version=None, encoding=None, def __init__(self, appname, shortname=None, version=None, encoding=None,

View file

@ -372,7 +372,9 @@ class LdapClient:
""" Configure options on registered mylib.Config object """ """ Configure options on registered mylib.Config object """
assert self._config, "mylib.Config object not registered. Must be passed to __init__ as config keyword argument." assert self._config, "mylib.Config object not registered. Must be passed to __init__ as config keyword argument."
from mylib.config import StringOption, PasswordOption # Load configuration option types only here to avoid global
# dependency of ldap module with config one.
from mylib.config import StringOption, PasswordOption # pylint: disable=import-outside-toplevel
section = self._config.add_section( section = self._config.add_section(
self._config_section, self._config_section,