Open zakrywilson opened 3 years ago
Have you ever got it to work?
I've tried it both with python
(2.7.16) and python3
(3.9.2) and getting the same errors as you.
By adding # -*- coding: utf-8 -*-
to the top of the file and running python QMK_KeymapToAsciiTable.py
File "QMK_KeymapToAsciiTable.py", line 562
print("Layer '{0}' have been added".format(keymapStarts),file=file)
^
SyntaxError: invalid syntax
It does generate a comment.txt
file, but it has two empty lines in it. I've tried two of my own keymap.c
files and some random board in the qmk_firmware
, but all give the same error
I got it working with the following patch on MacOS.
diff --git a/QMK_KeymapToAsciiTable.py b/QMK_KeymapToAsciiTable.py
old mode 100644
new mode 100755
index 982ac22..fcd0faa
--- a/QMK_KeymapToAsciiTable.py
+++ b/QMK_KeymapToAsciiTable.py
@@ -1,3 +1,5 @@
+#!/usr/bin/python3
+# coding=utf8
QMKCodeDic = {
#BASICKEYCODES
I'm not planning on PR'ing this because the project doesn't appear active.
I've added
+#!/usr/bin/python3
+# coding=utf8
to the first two lines. The script runs now but it can't open keymap.c
, even though the file is in the same directory.
You should execute this script the same directory where you keymap.c file is.
Any ideas what could cause this?
Running the script on my config produces error messages and no resulting files.
Attempt 1
Then I realized that the script wasn't set up to be executed in that manner.
Attempt 2
Which I fixed by adding encoding information to the file:
Attempt 3
Which I see is what is printed out in the except block.
Here is my config: https://gist.github.com/zakrywilson/59fcbb7a214abce3d37a54f3c574ab26
Happy to help improve this, by the way, and thanks for creating it!