Qmk_firmware: Convert new_keyboard.sh to a python command

Created on 2 Oct 2019  路  14Comments  路  Source: qmk/qmk_firmware


Feature Request Type

  • [x] Core functionality
  • [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
  • [ ] Alteration (enhancement/optimization) of existing feature(s)
  • [ ] New behavior

Description

Similar to #6066, we should convert new_keyboard.sh to a qmk command.

Some thoughts on implementation:

  • The cleanest way to handle the templates is probably by using .format() string formatting.
  • Like new_keymap the user should be able to supply answers on the command line. Any information not provided should be prompted for.
  • This is an instance where most (all?) CLI flags should be arg_only=True.
cli good first issue hacktoberfest-accepted help wanted in progress python

Most helpful comment

@ThiagoWhispher I'm going to go for maintainability, consistency in output/behaviour, reliability, and moving all the shell stuff to the qmk utility.

All 14 comments

Is the intention that this be, essentially, a drop-in replacement for the current .sh version with the addition of CLI flags that supersede the interactive prompts?

As a start, yes. I think there will be room to iterate and improve on it once that is done, and I'd welcome most of those improvements as part of the initial PR. For example, support for arm keyboards.

I'm making a branch on my fork to get the ball rolling on this, and I'll open a PR when it's at least feature-complete with the .sh version. LOL @stjohnjohnson beat me to it.

@HBBisenieks sorry!

Hey no worries! Your implementation looks way better than mine was looking in the planning stages.

Hi @skullydazed, what is the advantage of replacing .sh with a python command? Better debugging?

@ThiagoWhispher I'm going to go for maintainability, consistency in output/behaviour, reliability, and moving all the shell stuff to the qmk utility.

I like the idea of centralizing all these commands into a single CLI. Combine that with the Docker container and you have a single command with no dependencies (besides Docker) for all operations.

@lf- now I understand how advantageous this is.
@stjohnjohnson I working with Docker, and strongly recommend, very practical to work.

Are these docker images hosted on Docker Hub too? Just wanted to start my journey in containers as it would be my first experience with dockers contribution.

Looking at the other comments, at first I was confused about the purpose of it now, but I rethought about it and it's usage is quite widespread.

Just wondering, is there a pr that has handles/is handing this request?

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs.
For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

Was this page helpful?
0 / 5 - 0 ratings