mirror of
https://github.com/carlosedp/qmk_firmware.git
synced 2026-08-05 00:36:43 -04:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -152,8 +152,10 @@ def _check_avr_gcc_installation():
|
||||
|
||||
|
||||
def _check_avrdude_version():
|
||||
last_line = ESSENTIAL_BINARIES['avrdude']['output'].split('\n')[-2]
|
||||
version_number = last_line.split()[2][:-1]
|
||||
lines = ESSENTIAL_BINARIES['avrdude']['output'].split('\n')
|
||||
# avrdude version text is currently not translated, however we fall back to old behaviour of assuming a line
|
||||
version_line = next((line for line in lines if 'version' in line), lines[-2])
|
||||
version_number = version_line.split()[2][:-1]
|
||||
cli.log.info('Found avrdude version %s', version_number)
|
||||
|
||||
return CheckStatus.OK
|
||||
|
||||
@@ -87,7 +87,7 @@ def check_udev_rules():
|
||||
line = line.strip()
|
||||
if not line.startswith("#") and len(line):
|
||||
current_rules.add(line)
|
||||
except PermissionError:
|
||||
except (PermissionError, FileNotFoundError):
|
||||
cli.log.debug("Failed to read: %s", rule_file)
|
||||
|
||||
# Check if the desired rules are among the currently present rules
|
||||
|
||||
@@ -43,6 +43,13 @@ def generate_keymap_h(cli):
|
||||
|
||||
keymap_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '// clang-format off']
|
||||
|
||||
# Allow a potential keymap level keymap.h for items like user defined keycode aliases used within a keymap.json keymap
|
||||
keymap_h_lines += [
|
||||
'#if __has_include_next("keymap.h")',
|
||||
'# include_next "keymap.h"',
|
||||
'#endif',
|
||||
]
|
||||
|
||||
keymap_json = parse_configurator_json(cli.args.filename)
|
||||
|
||||
if 'keycodes' in keymap_json and keymap_json['keycodes'] is not None:
|
||||
|
||||
@@ -126,7 +126,7 @@ def new_keymap(cli):
|
||||
return False
|
||||
|
||||
if not validate_keymap_name(user_name):
|
||||
cli.log.error('Keymap names must contain only {fg_cyan}a-z{fg_reset}, {fg_cyan}0-9{fg_reset} and {fg_cyan}_{fg_reset}! Please choose a different name.')
|
||||
cli.log.error(f'Keymap name {{fg_cyan}}{user_name}{{fg_reset}} must contain only {{fg_cyan}}a-z{{fg_reset}}, {{fg_cyan}}0-9{{fg_reset}} and {{fg_cyan}}_{{fg_reset}}! Please choose a different name.')
|
||||
return False
|
||||
|
||||
if keymap_path_new.exists():
|
||||
|
||||
+13
-1
@@ -177,5 +177,17 @@ class FileType(argparse.FileType):
|
||||
"""normalize and check exists
|
||||
otherwise magic strings like '-' for stdin resolve to bad paths
|
||||
"""
|
||||
# TODO: This should not return both Path and TextIOWrapper as consumers
|
||||
# assume that they can call Path.as_posix without checking type
|
||||
|
||||
# Handle absolute paths and relative paths to CWD
|
||||
norm = normpath(string)
|
||||
return norm if norm.exists() else super().__call__(string)
|
||||
if norm.exists():
|
||||
return norm
|
||||
|
||||
# Handle relative paths to QMK_HOME
|
||||
relative = Path(string)
|
||||
if relative.exists():
|
||||
return relative
|
||||
|
||||
return super().__call__(string)
|
||||
|
||||
Reference in New Issue
Block a user