mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 14:26:10 -04:00
Display (None) instead of a bullet for empty lists (#5999)
Include a line break before "(None)" to maintain consistency with output
for lists that are not empty.
Previous result as expected for non-empty lists:
>>> _format_list('+', ['one', 'two', 'three'])
'\n+ one\n+ two\n+ three'
Previous unexpected result for empty lists:
>>> _format_list('+', [])
'\n+ '
New result as expected (unchanged) for non-empty lists:
>>> _format_list('+', ['one', 'two', 'three'])
'\n+ one\n+ two\n+ three'
New behavior more explicit for empty lists:
>>> _format_list('+', [])
'\n(None)'
Resolves #5886
This commit is contained in:
parent
42ef252043
commit
2d68c9b81e
1 changed files with 4 additions and 1 deletions
|
|
@ -340,7 +340,10 @@ def _get_added_removed(after, before):
|
|||
def _format_list(character, strings):
|
||||
"""Format list with given character
|
||||
"""
|
||||
formatted = "{br}{ch} " + "{br}{ch} ".join(strings)
|
||||
if len(strings) == 0:
|
||||
formatted = "{br}(None)"
|
||||
else:
|
||||
formatted = "{br}{ch} " + "{br}{ch} ".join(strings)
|
||||
return formatted.format(
|
||||
ch=character,
|
||||
br=os.linesep
|
||||
|
|
|
|||
Loading…
Reference in a new issue