From 25ea8234516fc07a8dc96378805d9d65889c22fa Mon Sep 17 00:00:00 2001 From: Mayank Patibandla <34776435+mayankpatibandla@users.noreply.github.com> Date: Sun, 14 Jan 2024 11:44:38 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Add=20rich=20click=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add rich click * Add rich-click to requirements * Update click version * Remove pyinstaller requirement * Add back pyinstaller --------- Co-authored-by: ayushuk --- pros/cli/click_classes.py | 3 ++- pros/cli/main.py | 5 +++++ requirements.txt | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pros/cli/click_classes.py b/pros/cli/click_classes.py index cb5a82c0..b071c938 100644 --- a/pros/cli/click_classes.py +++ b/pros/cli/click_classes.py @@ -1,13 +1,14 @@ from collections import defaultdict from typing import * +from rich_click import RichCommand import click.decorators from click import ClickException from pros.conductor.project import Project as p from pros.common.utils import get_version -class PROSFormatted(click.BaseCommand): +class PROSFormatted(RichCommand): """ Common format functions used in the PROS derived classes. Derived classes mix and match which functions are needed """ diff --git a/pros/cli/main.py b/pros/cli/main.py index 7a7e252a..2906aa74 100644 --- a/pros/cli/main.py +++ b/pros/cli/main.py @@ -7,6 +7,7 @@ import pros.common.sentry import click +import ctypes import sys import pros.common.ui as ui @@ -27,6 +28,10 @@ import pros.cli.interactive import pros.cli.user_script +if sys.platform == 'win32': + kernel32 = ctypes.windll.kernel32 + kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7) + root_sources = [ 'build', 'conductor', diff --git a/requirements.txt b/requirements.txt index 0cbde8f3..c84eddb0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -click>=6,<7 +click>=8 +rich-click pyserial cachetools requests @@ -13,4 +14,4 @@ scan-build==2.0.13 sentry-sdk observable pypng==0.0.20 -pyinstaller \ No newline at end of file +pyinstaller