-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add annotations #48
Add annotations #48
Conversation
Added annotations for the various functions. Corrected some documentation errors as well, regarding what the selected_label actually does. Additionally added terminalio.FONT as the default font.
Added type annotations for button.py, as well as correcting/updating documentation.
Completed type annotations for the sprite_button.py file as well as further improvements to documentation.
Corrected some wrong annotations.
label_color now accepts a tuple as well as an int for color, bringing its behavior in line with selected_label
Second pass to finalize changes
The transparent index is now set to the index number given, rather than just using 0.
Added my name to the licensing portion.
Correct formatting errors for the button.py file to pass ruff checks.
Correct formatting to avoid ruff errors.
Resolving ruff errors for sprite_button.py, some minor formatting elsewhere.
PyCharm has a mind of its own for settings.
Ran against local installation of black after correcting my own config.
Corrects issues with converting tuples of RGB values to ints, which Label objects require.
Point it to the new builtin libraries used, terminalio and fontio.
# Conflicts: # adafruit_button/button.py # adafruit_button/button_base.py # adafruit_button/sprite_button.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ch4nsuk3 Thank you for working on this! Sorry that I did not see it before working on #50.
I appreciate you doing this and all of the improvements to docstrings and other general improvements and fixes.
I merged main into this and resolved the conflicts to get it back to green here.
The changes look good to me, thanks again!
Updating https://github.com/adafruit/Adafruit_CircuitPython_24LC32 to 1.2.0 from 1.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_24LC32#25 from FoamyGuy/dont_rewrite_same Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.6.13 from 3.6.12: > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#40 from jposada202020/adding_displayIO_example Updating https://github.com/adafruit/Adafruit_CircuitPython_VS1053 to 1.2.20 from 1.2.19: > Merge pull request adafruit/Adafruit_CircuitPython_VS1053#21 from FoamyGuy/use_ruff Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Button to 1.11.1 from 1.9.3: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#53 from FoamyGuy/debounced_example > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#52 from FoamyGuy/focal_touch_support > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#51 from FoamyGuy/use_ruff > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#49 from ch4nsuk3/expose-name-property > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#48 from ch4nsuk3/add-annotations > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#50 from FoamyGuy/type_annotations Updating https://github.com/adafruit/Adafruit_CircuitPython_turtle to 3.1.1 from 3.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_turtle#45 from adafruit/issue41 Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
Added type annotations and updated incorrect or ambiguous documentation, as well as some small bugs.
Personally I also consider this to resolve adafruit/Adafruit_CircuitPython_ImageLoad#86
After the updates to [Adafruit_CircuitPython_ImageLoad](https://github.com/adafruit/Adafruit_CircuitPython_ImageLoadl) which provided support for more PNG formats along with transparency support this library already worked without changing code, but the documentation was lacking so there was some uncertainty about whether or not SpriteButton would handle anything other than a BMP file, or indeed which parameters are needed.