From d6e3070f61c573241a6e24631218cd4accf3d803 Mon Sep 17 00:00:00 2001 From: Arinffy <49331996+Arinffy@users.noreply.github.com> Date: Sun, 8 Dec 2024 00:28:55 +0800 Subject: [PATCH] Update table.py fix bug with "TypeError: fore|back|style() takes no arguments" I debugged the fore|back|style errors: If it's for known and definite rendering effects like text, you can set it in the form of fore.GREEN. However, for unknown and dynamic content, it needs to be set as fg(set). If this is not modified, there will be an error when printing (robot). No other anomalies have been observed. --- ansitable/table.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansitable/table.py b/ansitable/table.py index ad7ecb2..794241d 100644 --- a/ansitable/table.py +++ b/ansitable/table.py @@ -1376,19 +1376,19 @@ def Pandas(df, **kwargs): def _FG(self, c): if _unicode and self.color and c is not None: - return fore(c) + return fg(c) else: return "" def _BG(self, c): if _unicode and self.color and c is not None: - return back(c) + return bg(c) else: return "" def _ATTR(self, c): if _unicode and self.color and c is not None: - return style(c) + return attr(c) else: return ""