summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2020-10-17 21:01:11 -0700
committerGitHub <noreply@github.com>2020-10-17 21:01:11 -0700
commit445cd95d1779709673857c36b752afa6327afff1 (patch)
treef722089d82590e624d29776e41431bcaf69e0314 /lib/python/qmk
parent7d5ba88e6f88979c017bf27e2ad0f4c7d912f9ec (diff)
Improve ANSI support and --no-color (#10537)
* Improve ANSI support and --no-color * tweak when levelname gets stripped of ansi * sync with latest milc * make questions work with both milc versions * pyformat
Diffstat (limited to 'lib/python/qmk')
-rwxr-xr-xlib/python/qmk/cli/doctor.py22
-rw-r--r--lib/python/qmk/questions.py7
2 files changed, 13 insertions, 16 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py
index 7fafd57575..9983865b31 100755
--- a/lib/python/qmk/cli/doctor.py
+++ b/lib/python/qmk/cli/doctor.py
@@ -156,24 +156,16 @@ def check_udev_rules():
_udev_rule("03EB", "2FF3"), # ATmega16U4
_udev_rule("03EB", "2FF4"), # ATmega32U4
_udev_rule("03EB", "2FF9"), # AT90USB64
- _udev_rule("03EB", "2FFB") # AT90USB128
- },
- 'kiibohd': {
- _udev_rule("1C11", "B007")
+ _udev_rule("03EB", "2FFB") # AT90USB128
},
+ 'kiibohd': {_udev_rule("1C11", "B007")},
'stm32': {
_udev_rule("1EAF", "0003"), # STM32duino
- _udev_rule("0483", "DF11") # STM32 DFU
- },
- 'bootloadhid': {
- _udev_rule("16C0", "05DF")
- },
- 'usbasploader': {
- _udev_rule("16C0", "05DC")
- },
- 'massdrop': {
- _udev_rule("03EB", "6124")
+ _udev_rule("0483", "DF11") # STM32 DFU
},
+ 'bootloadhid': {_udev_rule("16C0", "05DF")},
+ 'usbasploader': {_udev_rule("16C0", "05DC")},
+ 'massdrop': {_udev_rule("03EB", "6124")},
'caterina': {
# Spark Fun Electronics
_udev_rule("1B4F", "9203", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Pro Micro 3V3/8MHz
@@ -190,7 +182,7 @@ def check_udev_rules():
_udev_rule("239A", "000E", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # ItsyBitsy 32U4 5V/16MHz
# dog hunter AG
_udev_rule("2A03", "0036", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Leonardo
- _udev_rule("2A03", "0037", 'ENV{ID_MM_DEVICE_IGNORE}="1"') # Micro
+ _udev_rule("2A03", "0037", 'ENV{ID_MM_DEVICE_IGNORE}="1"') # Micro
}
}
diff --git a/lib/python/qmk/questions.py b/lib/python/qmk/questions.py
index 27f43ac1e9..865c6bbdc5 100644
--- a/lib/python/qmk/questions.py
+++ b/lib/python/qmk/questions.py
@@ -1,7 +1,12 @@
"""Functions to collect user input.
"""
-from milc import cli, format_ansi
+from milc import cli
+
+try:
+ from milc import format_ansi
+except ImportError:
+ from milc.ansi import format_ansi
def yesno(prompt, *args, default=None, **kwargs):