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

Solving kwargs arguments verifications #148

Merged
merged 1 commit into from
Mar 30, 2021
Merged

Solving kwargs arguments verifications #148

merged 1 commit into from
Mar 30, 2021

Conversation

jposada202020
Copy link
Contributor

After some verification, I add the **kwargs arguments to the LabelBase.

This was tested using slightly modified simple test to include and additional argument. will close #146

Test Code

import board
import terminalio
from adafruit_display_text import label


text = "Hello world"
text_area = label.Label(terminalio.FONT, text=text, WeTheNorth=True)
text_area.x = 10
text_area.y = 10
board.DISPLAY.show(text_area)
while True:
    pass

Results Original

Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Seeeduino Wio Terminal with samd51p19
>>> import code

Results After PR

Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Seeeduino Wio Terminal with samd51p19
>>> import code
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "code.py", line 10, in <module>
  File "/lib/adafruit_display_text/label.py", line 78, in __init__
  File "/lib/adafruit_display_text/__init__.py", line 222, in __init__
TypeError: extra keyword arguments given
>>> 

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.

Looks good to me.

Tested successfully on PyPortal.

Thanks for this fix @jposada202020.

@FoamyGuy FoamyGuy merged commit d09bac7 into adafruit:master Mar 30, 2021
@jposada202020 jposada202020 deleted the solving_kwargs branch March 30, 2021 02:17
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 30, 2021
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.

Incorrect keyword parameters are ignored, and do not cause errors.
2 participants