fix: re-enable add udev rule functionality#125
Merged
robberwick merged 2 commits intoarvydas:release/2.0-devfrom Feb 23, 2025
Merged
fix: re-enable add udev rule functionality#125robberwick merged 2 commits intoarvydas:release/2.0-devfrom
robberwick merged 2 commits intoarvydas:release/2.0-devfrom
Conversation
Re-enable to --add-udev-rule functionality in the blinkstick cli tool,
src/scripts/main.py
Outdated
| sticks = [find_by_serial(options.serial)] | ||
|
|
||
| if len(sticks) == 0: | ||
| print("BlinkStick with serial number " + options.backend + " not found...") |
There was a problem hiding this comment.
The error message incorrectly references 'options.backend' instead of 'options.serial'. Please update the variable to correctly reflect the intended serial number usage.
Suggested change
| print("BlinkStick with serial number " + options.backend + " not found...") | |
| print("BlinkStick with serial number " + options.serial + " not found...") |
There was a problem hiding this comment.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/scripts/main.py:307
- The error message now correctly uses options.serial instead of the previously incorrect options.backend. Please confirm that all references to the old variable have been updated.
print("BlinkStick with serial number " + options.serial + " not found...")
src/scripts/main.py:280
- When both --add-udev-rule and a serial filter are provided, the udev branch will be executed and the device search skipped. Please verify that this behavior is intended and clearly documented in the help messages.
if options.udev:
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.
This pull request includes changes to the
src/scripts/main.pyfile to re-enable the --add-udev-rule functionality in the blinkstick cli tool, and improve the clarity of help messages. The most important changes include updating the help text for the--add-udev-ruleoption and reordering the logic for finding BlinkStick devices based on serial numbers.Improvements to help messages:
--add-udev-ruleoption to include an example command for running it with root permissions.Code reorganization:
mainfunction, ensuring it is executed before any actions which require finding BlinkStick devices