moved hid to kvmd

This commit is contained in:
Devaev Maxim 2018-09-26 02:20:58 +03:00
parent 940989b6e9
commit 089bac2bcd
10 changed files with 12 additions and 9 deletions

View File

@ -40,6 +40,10 @@ shell:
make run TESTENV_CMD=/bin/bash make run TESTENV_CMD=/bin/bash
regen:
python3 genmap.py
release: release:
make clean make clean
make tox make tox
@ -66,7 +70,9 @@ push:
clean: clean:
rm -rf build site dist pkg src *.egg-info kvmd-*.tar.gz rm -rf build site dist pkg src *.egg-info kvmd-*.tar.gz
find -name __pycache__ | xargs rm -rf find -name __pycache__ | xargs rm -rf
make -C hid clean
clean-all: clean clean-all: clean
rm -rf .tox .mypy_cache rm -rf .tox .mypy_cache
make -C hid clean-all

View File

@ -18,13 +18,13 @@ def main() -> None:
parts = row.split() parts = row.split()
keymap.append((int(parts[0]), parts[1], parts[2])) keymap.append((int(parts[0]), parts[1], parts[2]))
with open("../kvmd/kvmd/data/keymap.yaml", "w") as kvmd_yaml_file: with open("kvmd/data/keymap.yaml", "w") as kvmd_yaml_file:
yaml.dump({ yaml.dump({
js_key: code js_key: code
for (code, _, js_key) in sorted(keymap, key=operator.itemgetter(2)) for (code, _, js_key) in sorted(keymap, key=operator.itemgetter(2))
}, kvmd_yaml_file, indent=4, default_flow_style=False) }, kvmd_yaml_file, indent=4, default_flow_style=False)
with open("src/keymap.h", "w") as hid_header_file: with open("hid/src/keymap.h", "w") as hid_header_file:
hid_header_file.write("#pragma once\n\n#include <HID-Project.h>\n\n#include \"inline.h\"\n\n\n") hid_header_file.write("#pragma once\n\n#include <HID-Project.h>\n\n#include \"inline.h\"\n\n\n")
hid_header_file.write("INLINE KeyboardKeycode keymap(uint8_t code) {\n\tswitch(code) {\n") hid_header_file.write("INLINE KeyboardKeycode keymap(uint8_t code) {\n\tswitch(code) {\n")
for (code, hid_key, _) in sorted(keymap, key=operator.itemgetter(1)): for (code, hid_key, _) in sorted(keymap, key=operator.itemgetter(1)):

View File

@ -14,8 +14,5 @@ upload:
serial: serial:
platformio serialports monitor platformio serialports monitor
regen:
python3 genmap.py
clean: clean:
rm -rf .pioenvs .piolibdeps rm -rf .pioenvs .piolibdeps

View File

@ -6,26 +6,26 @@ skipsdist = True
basepython = python3.7 basepython = python3.7
[testenv:flake8] [testenv:flake8]
commands = flake8 kvmd commands = flake8 kvmd genmap.py
deps = deps =
flake8 flake8
flake8-double-quotes flake8-double-quotes
-rtestenv/requirements.txt -rtestenv/requirements.txt
[testenv:pylint] [testenv:pylint]
commands = pylint --output-format=colorized --reports=no kvmd commands = pylint --output-format=colorized --reports=no kvmd genmap.py
deps = deps =
pylint pylint
-rtestenv/requirements.txt -rtestenv/requirements.txt
[testenv:mypy] [testenv:mypy]
commands = mypy kvmd commands = mypy kvmd genmap.py
deps = deps =
mypy mypy
-rtestenv/requirements.txt -rtestenv/requirements.txt
[testenv:vulture] [testenv:vulture]
commands = vulture kvmd vulture-wl.py commands = vulture kvmd genmap.py vulture-wl.py
deps = deps =
vulture vulture
-rtestenv/requirements.txt -rtestenv/requirements.txt