Skip to content

Update grid_layout.py #53

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

Merged
merged 2 commits into from
Nov 26, 2021
Merged

Update grid_layout.py #53

merged 2 commits into from
Nov 26, 2021

Conversation

gingershaped
Copy link
Contributor

Added the ability to change the divider line color

Added the ability to change the divider line color
@FoamyGuy
Copy link
Contributor

@GingerIndustries thanks for adding this functionality. This is currently failing pylint due to too-many-instance-attributes. apparently we were previous right at the limit, and adding the new one pushed it over.

Some of the attributes could be collapsed into a dictionary or other object that can hold multiple things. But it seems to me that this would make the code more complex for the purpose of pleasing pylint.

Personally I think it would be okay to disable the too-many-instance-attributes check for this class. But I'm open to input from others. If that does turn out to be the route we want to go with, do you know how to do that @GingerIndustries?

@gingershaped
Copy link
Contributor Author

gingershaped commented Nov 25, 2021

It probably doesn't matter, as this will be compiled to an .mpy regardless. I could make the changes if you want.

@FoamyGuy
Copy link
Contributor

@GingerIndustries we will have to getting passing the CI checks one way or another before it can be merged. Even though the resulting library will get compiled to mpy we still run pylint and a few other checks on the .py version of the code using github actions.

Go ahead and add the pylint disable comment for that specific check. Let me know if you have any trouble, or need help with that.

@gingershaped
Copy link
Contributor Author

Okay, it's done.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

Changes look good to me. Tested successfully on a PyPortal with a modified the gridlayout_dividers script in the examples directory.

I tested hex colors i.e. 0xFF00FF as well as tuple colors i.e (255, 0, 255) and both work as expected. I think internally displayio.Palette allows both to work in this case without any specific code needed in this library.

Thanks for adding this new functionality @GingerIndustries

@FoamyGuy FoamyGuy merged commit eed7282 into adafruit:main Nov 26, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Nov 27, 2021
@gingershaped
Copy link
Contributor Author

Nice! Thanks,

@gingershaped gingershaped deleted the patch-1 branch November 27, 2021 16:12
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