diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-08-18 23:28:24 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-08-18 23:28:24 +0300 |
commit | c1ffe31653d24c6bf05bdfa1b11cf055491c4822 (patch) | |
tree | a58a9daa2864a97b1ff2bc20bc41830b1efc0d39 /pylint/utils.py | |
parent | 1e6c856095451396d8f0edaefe509df085e8c900 (diff) | |
download | pylint-c1ffe31653d24c6bf05bdfa1b11cf055491c4822.tar.gz |
Fix pylint warnings for the code imported from logilab-common.
Diffstat (limited to 'pylint/utils.py')
-rw-r--r-- | pylint/utils.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/pylint/utils.py b/pylint/utils.py index c0829d8..7d6e885 100644 --- a/pylint/utils.py +++ b/pylint/utils.py @@ -211,7 +211,7 @@ class MessageDefinition(object): desc += " It can't be emitted when using Python %s." % restr else: desc += " This message can't be emitted when using Python %s." % restr - desc = normalize_text(' '.join(desc.split()), indent=' ') + desc = _normalize_text(' '.join(desc.split()), indent=' ') if title != '%s': title = title.splitlines()[0] return ':%s: *%s*\n%s' % (msgid, title, desc) @@ -956,13 +956,13 @@ def deprecated_option(shortname=None, opt_type=None, help_msg=None): return option -def splitstrip(string, sep=','): +def _splitstrip(string, sep=','): """return a list of stripped string by splitting the string given as argument on `sep` (',' by default). Empty string are discarded. - >>> splitstrip('a, b, c , 4,,') + >>> _splitstrip('a, b, c , 4,,') ['a', 'b', 'c', '4'] - >>> splitstrip('a') + >>> _splitstrip('a') ['a'] >>> @@ -978,7 +978,7 @@ def splitstrip(string, sep=','): return [word.strip() for word in string.split(sep) if word.strip()] -def unquote(string): +def _unquote(string): """remove optional quotes (simple or double) from the string :type string: str or unicode @@ -996,20 +996,13 @@ def unquote(string): return string -def normalize_text(text, line_len=80, indent=''): +def _normalize_text(text, line_len=80, indent=''): """Wrap the text on the given line length.""" return '\n'.join(textwrap.wrap(text, width=line_len, initial_indent=indent, subsequent_indent=indent)) -def check_csv(option, opt, value): - """check a csv value by trying to split it - return the list of separated values - """ +def _check_csv(value): if isinstance(value, (list, tuple)): return value - try: - return splitstrip(value) - except ValueError: - raise OptionValueError( - "option %s: invalid csv value: %r" % (opt, value)) + return _splitstrip(value) |