From a203828c1124519474c8ba6e9175770ade83d4a5 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 1 Jan 2021 13:10:41 -0500 Subject: [PATCH] formatting --- src/replit/termutils.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/replit/termutils.py b/src/replit/termutils.py index dc42f4f..9cf83e4 100644 --- a/src/replit/termutils.py +++ b/src/replit/termutils.py @@ -1,9 +1,12 @@ """Pure Python ANSI Color Escape Code generator.""" + + import colorsys def clear() -> None: """Clear the terminal.""" + print("\033[H\033[2J", end="", flush=True) @@ -41,7 +44,7 @@ class Color: Args: hexvalue (str): The color's hex value - + Raises: ValueError @@ -65,7 +68,7 @@ class Color: Args: hexvalue (str): The color's hex value - + Raises: ValueError @@ -87,7 +90,7 @@ class Color: Args: hexvalue (str): The color's hex value - + Raises: ValueError @@ -124,14 +127,16 @@ class Bit: self.bg = f"\033[48;5;{value}m" -attributes = { # use only repl.it supported ansi codes. Codes such as blink do not work. - "reset": 0, - "bold": 1, - "faint": 2, - "italic": 3, - "underline": 4, - "highlight": 7, -} +attributes = ( + { # use only repl.it supported ansi codes. Codes such as blink do not work. + "reset": 0, + "bold": 1, + "faint": 2, + "italic": 3, + "underline": 4, + "highlight": 7, + } +) class Attr: