Review, per your request#1
Open
piquan wants to merge 4 commits into
Open
Conversation
Update copyright. Set the interpreter to use $PATH. Add requirements.txt. Add comments about where to get the correct mapping values.
Use errno.ENODEV instead of hardcoded 19. Use a struct.Struct object instead of an inline format and a hardcoded size that are 50 lines apart. May as well use functools.cache instead of functools.lru_cache on somewhat more modern Python.
In joymapper, let the user specify a different controller device than /dev/input/js0. In midimapper, let the user specify the name of the MIDI controller they want to communicate with. Clarify the port-wrangling code. As before, we still default to the first device, which is what ALSA (at least, the alsa_midi library) considers the most usable. I don't happen to have the controller that Dirk uses, so I haven't tested all of that code yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's a few changes I'd suggest. You've got a few hardcoded values, like in the shebang line, that might not be appropriate for widespread use.
I also cleaned up the MIDI port connection code. Previously, it would connect to the first MIDI device. Now, it lets the user specify the controller name. But I didn't have a two-way MIDI device handy, so I couldn't entirely test that code. I suggest you test it before you merge.
I put this in a few separate commits if you prefer to cherry-pick stuff.