summaryrefslogtreecommitdiff
path: root/lib/python/qmk/keymap.py
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2021-05-19 15:49:11 -0700
committerZach White <skullydazed@gmail.com>2021-05-19 15:49:11 -0700
commit6955c5a00295382d3b4151a840aa5c929cd98059 (patch)
tree26109c4ed2a266650fc5fad19ce5f784bc7c346b /lib/python/qmk/keymap.py
parent82aa9ad4a567695d1f7d0b1e36bf8563d2967813 (diff)
parentdb1eacdaacb9c8f6889f46bc1c6af155b81ad72a (diff)
downloadqmk_firmware-6955c5a00295382d3b4151a840aa5c929cd98059.tar.gz
qmk_firmware-6955c5a00295382d3b4151a840aa5c929cd98059.zip
Merge remote-tracking branch 'origin/master' into develop
Resolved Conflicts: lib/python/qmk/tests/test_cli_commands.py util/install/fedora.sh
Diffstat (limited to 'lib/python/qmk/keymap.py')
-rw-r--r--lib/python/qmk/keymap.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index 4ad9ffb591..ac7951082e 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -1,9 +1,9 @@
"""Functions that help you work with QMK keymaps.
"""
import json
-import subprocess
import sys
from pathlib import Path
+from subprocess import DEVNULL
import argcomplete
from milc import cli
@@ -12,7 +12,6 @@ from pygments.token import Token
from pygments import lex
import qmk.path
-import qmk.commands
from qmk.keyboard import find_keyboard_from_dir, rules_mk
# The `keymap.c` template to use when a keyboard doesn't have its own
@@ -361,7 +360,7 @@ def list_keymaps(keyboard, c=True, json=True, additional_files=None, fullpath=Fa
return sorted(names)
-def _c_preprocess(path, stdin=None):
+def _c_preprocess(path, stdin=DEVNULL):
""" Run a file through the C pre-processor
Args:
@@ -371,7 +370,9 @@ def _c_preprocess(path, stdin=None):
Returns:
the stdout of the pre-processor
"""
- pre_processed_keymap = qmk.commands.run(['cpp', path] if path else ['cpp'], stdin=stdin, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
+ cmd = ['cpp', str(path)] if path else ['cpp']
+ pre_processed_keymap = cli.run(cmd, stdin=stdin)
+
return pre_processed_keymap.stdout