Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tomer's USB refactor #11

Merged
merged 15 commits into from
Apr 16, 2024
Merged

Tomer's USB refactor #11

merged 15 commits into from
Apr 16, 2024

Conversation

tomers
Copy link
Contributor

@tomers tomers commented Apr 15, 2024

Some initial work towards supporting labeler device selector widget.
@maresb, please take extra care reviewing this, as I had to duplicate my changes in the new repository. I hope I did not revert any of your recent changes related to rebranding the software.

Tomer Shalev added 13 commits April 15, 2024 12:53
First step in refactoring. Break this long function into multiple shorter functions.
Next stage in refactoring device management.
Move all related logic under a dedicated devices directory.
Another step in the major refactoring of the device management.
Added device manager class.
I tried to minimize this commit but it is still rather big. I kept the names of files such as detect.py, although the name and functionality has changed. There's still a lot or room to refactor the code. This is merely the first step.
This is preliminary merge, as part of a larger refactor.
No need to set interval, as it is being set by start()
Another step towards better organization of the device and USB classes.
This is not the final form of the class hierarchy.
We will add more environment variables in the future, so better have them all in a single place.
In development mode, we may want to print many times without wasting precious
label. Setting DEV_MODE_NO_MARGINS=1 as environment variable will now print a
short dot char (in GUI app), and without any margin.
Copy link
Contributor

@maresb maresb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few small things, thanks!!!

src/labelle/lib/env_config.py Outdated Show resolved Hide resolved
src/labelle/lib/env_config.py Outdated Show resolved Hide resolved
Tomer Shalev added 2 commits April 16, 2024 10:54
We will add more environment variables in the future, so better have them all in a single place.
In development mode, we may want to print many times without wasting precious
label. Setting DEV_MODE_NO_MARGINS=1 as environment variable will now print a
short dot char (in GUI app), and without any margin.
@tomers
Copy link
Contributor Author

tomers commented Apr 16, 2024

Fixed :-)

@maresb maresb merged commit f5fccb8 into main Apr 16, 2024
6 checks passed
@tomers tomers deleted the tshalev-usb-refactor branch April 16, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants