Skip to content

Commit

Permalink
fix: correct English grammar
Browse files Browse the repository at this point in the history
Co-Authored-By: dgw <[email protected]>
  • Loading branch information
Exirel and dgw committed Aug 31, 2019
1 parent 95b3bd1 commit 58b2ea7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions sopel/config/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,22 +230,22 @@ class SpamSection(StaticSection):
.. versionchanged:: 7.0
The option's value will be split by breakline by default. In this
The option's value will be split on newlines by default. In this
case, the ``strip`` parameter has no effect.
See the :meth:`parse` method for more information.
.. note::
**About**: backward compatibility with comma separated values.
**About:** backward compatibility with comma-separated values.
A :class:`ListAttribute` option allows to write, on a single line,
the values separated by commas. As of Sopel 7.x this behavior is
discouraged. It will be deprecated in Sopel 8.x, then removed in
Sopel 9.x.
Bot's owners are encouraged to update their configuration to use
breaklines instead of commas.
Bot owners are encouraged to update their configurations to use
newlines instead of commas.
The comma delimiter fallback does not support commas within items in
the list.
Expand All @@ -266,10 +266,10 @@ def parse(self, value):
.. versionchanged:: 7.0
The value is now split by breaklines, and fallback on comma
when there is no breakline delimiter in ``value``.
The value is now split on newlines, with fallback to comma
when there is no newline in ``value``.
When modified and save to a file, items will be stored as a
When modified and saved to a file, items will be stored as a
multi-line string.
"""
if "\n" in value:
Expand All @@ -296,9 +296,9 @@ def serialize(self, value):
if not isinstance(value, (list, set)):
raise ValueError('ListAttribute value must be a list.')

# we ensure to read a breakline, even with one value list
# we ensure to read a newline, even with only one value in the list
# this way, comma will be ignored when the configuration file
# will be read again later
# is read again later
return '\n' + '\n'.join(value)

def configure(self, prompt, default, parent, section_name):
Expand Down
6 changes: 3 additions & 3 deletions test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def test_configparser_multi_lines(multi_fakeconfig):
'two',
'three',
'four',
'and a half', # no-breakline + comma
'and a half', # no-newline + comma
], 'Comma separated line: "four" and "and a half" must be separated'
assert multi_fakeconfig.spam.bacons == [
'grilled',
Expand Down Expand Up @@ -245,7 +245,7 @@ def test_save_unmodified_config(multi_fakeconfig):
'two',
'three',
'four',
'and a half', # no-breakline + comma
'and a half', # no-newline + comma
], 'Comma separated line: "four" and "and a half" must be separated'
assert saved_config.spam.bacons == [
'grilled',
Expand Down Expand Up @@ -285,5 +285,5 @@ def test_save_modified_config(multi_fakeconfig):
'camembert, reblochon, and cheddar',
], (
'ListAttribute with one line only, with commas, must *not* be split '
'differently from what was expected, ie. into one (and only one) value'
'differently from what was expected, i.e. into one (and only one) value'
)

0 comments on commit 58b2ea7

Please sign in to comment.