diff options
| author | Pablo MartÃnez <58857054+elpekenin@users.noreply.github.com> | 2024-11-21 07:16:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-21 17:16:46 +1100 |
| commit | 88afd53b1fb4183195ac5ee9d1d1c9506de3814e (patch) | |
| tree | af3c29726f93ddf6ef69bbd0125c1e2984ead405 /lib/python/qmk/cli | |
| parent | 9c865839819bf9ec3ed573354a53bcbe905080f7 (diff) | |
[CLI] Refactor painter arguments to table instead of commandline (#24456)
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'lib/python/qmk/cli')
| -rw-r--r-- | lib/python/qmk/cli/painter/convert_graphics.py | 4 | ||||
| -rw-r--r-- | lib/python/qmk/cli/painter/make_font.py | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/python/qmk/cli/painter/convert_graphics.py b/lib/python/qmk/cli/painter/convert_graphics.py index 553c26aa5d..f74d655fd5 100644 --- a/lib/python/qmk/cli/painter/convert_graphics.py +++ b/lib/python/qmk/cli/painter/convert_graphics.py | |||
| @@ -60,9 +60,7 @@ def painter_convert_graphics(cli): | |||
| 60 | return | 60 | return |
| 61 | 61 | ||
| 62 | # Work out the text substitutions for rendering the output data | 62 | # Work out the text substitutions for rendering the output data |
| 63 | args_str = " ".join((f"--{arg} {getattr(cli.args, arg.replace('-', '_'))}" for arg in ["input", "output", "format", "no-rle", "no-deltas"])) | 63 | subs = generate_subs(cli, out_bytes, image_metadata=metadata, command_name="painter_convert_graphics") |
| 64 | command = f"qmk painter-convert-graphics {args_str}" | ||
| 65 | subs = generate_subs(cli, out_bytes, image_metadata=metadata, command=command) | ||
| 66 | 64 | ||
| 67 | # Render and write the header file | 65 | # Render and write the header file |
| 68 | header_text = render_header(subs) | 66 | header_text = render_header(subs) |
diff --git a/lib/python/qmk/cli/painter/make_font.py b/lib/python/qmk/cli/painter/make_font.py index 19db844931..3e18fd74a5 100644 --- a/lib/python/qmk/cli/painter/make_font.py +++ b/lib/python/qmk/cli/painter/make_font.py | |||
| @@ -61,10 +61,8 @@ def painter_convert_font_image(cli): | |||
| 61 | return | 61 | return |
| 62 | 62 | ||
| 63 | # Work out the text substitutions for rendering the output data | 63 | # Work out the text substitutions for rendering the output data |
| 64 | args_str = " ".join((f"--{arg} {getattr(cli.args, arg.replace('-', '_'))}" for arg in ["input", "output", "no-ascii", "unicode-glyphs", "format", "no-rle"])) | ||
| 65 | command = f"qmk painter-convert-font-image {args_str}" | ||
| 66 | metadata = {"glyphs": _generate_font_glyphs_list(not cli.args.no_ascii, cli.args.unicode_glyphs)} | 64 | metadata = {"glyphs": _generate_font_glyphs_list(not cli.args.no_ascii, cli.args.unicode_glyphs)} |
| 67 | subs = generate_subs(cli, out_bytes, font_metadata=metadata, command=command) | 65 | subs = generate_subs(cli, out_bytes, font_metadata=metadata, command_name="painter_convert_font_image") |
| 68 | 66 | ||
| 69 | # Render and write the header file | 67 | # Render and write the header file |
| 70 | header_text = render_header(subs) | 68 | header_text = render_header(subs) |
