From 8c484f86a9210d9f8d3b2d305675161d895a53cf Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Thu, 23 Jul 2020 13:32:41 +0200 Subject: [PATCH] Make `bordered()` use `+` for corners if `ascii_border=True` (#4097) --- redbot/core/utils/chat_formatting.py | 8 ++++---- tests/core/test_utils.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/redbot/core/utils/chat_formatting.py b/redbot/core/utils/chat_formatting.py index f722e33c3..a4b0cebfe 100644 --- a/redbot/core/utils/chat_formatting.py +++ b/redbot/core/utils/chat_formatting.py @@ -165,10 +165,10 @@ def bordered(*columns: Sequence[str], ascii_border: bool = False) -> str: """ borders = { - "TL": "-" if ascii_border else "┌", # Top-left - "TR": "-" if ascii_border else "┐", # Top-right - "BL": "-" if ascii_border else "└", # Bottom-left - "BR": "-" if ascii_border else "┘", # Bottom-right + "TL": "+" if ascii_border else "┌", # Top-left + "TR": "+" if ascii_border else "┐", # Top-right + "BL": "+" if ascii_border else "└", # Bottom-left + "BR": "+" if ascii_border else "┘", # Bottom-right "HZ": "-" if ascii_border else "─", # Horizontal "VT": "|" if ascii_border else "│", # Vertical } diff --git a/tests/core/test_utils.py b/tests/core/test_utils.py index 9cab17755..2bfe05900 100644 --- a/tests/core/test_utils.py +++ b/tests/core/test_utils.py @@ -55,11 +55,11 @@ def test_bordered_asymmetrical_2(): def test_bordered_ascii(): expected = textwrap.dedent( """\ - ---------------- --------------- + +--------------+ +-------------+ |one | |four | |two | |five | |three | |six | - ---------------- ---------------""" + +--------------+ +-------------+""" ) col1, col2 = ["one", "two", "three"], ["four", "five", "six"] assert chat_formatting.bordered(col1, col2, ascii_border=True) == expected