Skip to content

Remove max_size and max_glyphs from CircuitPython examples #1603

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

Closed
99 tasks done
lesamouraipourpre opened this issue Jul 10, 2021 · 7 comments
Closed
99 tasks done

Remove max_size and max_glyphs from CircuitPython examples #1603

lesamouraipourpre opened this issue Jul 10, 2021 · 7 comments

Comments

@lesamouraipourpre
Copy link
Contributor

lesamouraipourpre commented Jul 10, 2021

The max_size parameter on displayio.Group is currently ignored and is (hopefully) going to be removed before 7.0.0 final.
The libraries are having this parameter removed from them - adafruit/circuitpython#4959

Edit: I've update the grep to look for max_glyphs related to DIsplay_Text Label as well.

This issue is intended as a tracking issue as the Learn Guide code is worked through
{ grep -r "Group.*max_size" * && grep -r "max_glyphs" * ; } | sed -e "s/\/.*//" | sort | uniq to give directories
{ grep -r "Group.*max_size" * && grep -r "max_glyphs" * ; } | grep -v "_JEplayer_" | sort gives (updated 2021/08/06 14:20 BST)

Matrix_On_Air/matrix_on_air.py:    deco_font, color=color[1], text="AIR", max_glyphs=6
Matrix_On_Air/matrix_on_air.py:    deco_font, color=color[3], text="OFF", max_glyphs=6
Matrix_On_Air/matrix_on_air.py:group = displayio.Group(max_size=22)
PyPortal_Calculator/code.py:calc_display = Label(font, text="0", color=BLACK, max_glyphs=MAX_DIGITS)
PyPortal_Calculator/code.py:calc_group = displayio.Group(max_size=25)
PyPortal_Calculator/titano_code.py:calc_display = Label(font, text="0", color=BLACK, max_glyphs=MAX_DIGITS)
PyPortal_Calculator/titano_code.py:calc_group = displayio.Group(max_size=25)
PyPortal_Titano_Weather_Station/openweather_graphics.py:        self.date_text = Label(self.medium_font, max_glyphs=60)
PyPortal_Titano_Weather_Station/openweather_graphics.py:        self.description_text = Label(self.small_font, max_glyphs=60)
PyPortal_Titano_Weather_Station/openweather_graphics.py:                    self.holiday_text = Label(self.medium_font, max_glyphs=60)
PyPortal_Titano_Weather_Station/openweather_graphics.py:        self._icon_group = displayio.Group(max_size=1)
PyPortal_Titano_Weather_Station/openweather_graphics.py:        self.main_text = Label(self.weather_font, max_glyphs=20)
PyPortal_Titano_Weather_Station/openweather_graphics.py:        self.temp_text = Label(self.large_font, max_glyphs=6)
PyPortal_Titano_Weather_Station/openweather_graphics.py:        self._text_group = displayio.Group(max_size=12)
PyPortal_Titano_Weather_Station/openweather_graphics.py:        self.time_text = Label(self.medium_font, max_glyphs=8)

If the associated Learn Guide text needs updated I will make a comment on any created PRs. Is there a better way to do this @kattni or @makermelissa ?

@kattni
Copy link
Contributor

kattni commented Jul 12, 2021

@lesamouraipourpre Unfortunately, this is pretty much the only way to do it. Thank you for making this list! This update needs to be made, and updating the code is a great first step. Not all guides will have associated walk-throughs or text requiring changes, but guarantee that some of them will.

Perhaps @FoamyGuy is up for assisting with this on the Learn guide side of things?

@lesamouraipourpre
Copy link
Contributor Author

Not a problem, I will try to start working through these. A potential issue noticed on @FoamyGuy 's stream on Saturday was that some Learn Guides were written for CircuitPython 3 (and possibly earlier) and may need other changes.

As I don't have the hardware for most of the guides, I will focus on the max_size change and try and report any other issues.

@lesamouraipourpre
Copy link
Contributor Author

All current Learn guides have had max_size and max_glyphs usage removed.

@ladyada
Copy link
Member

ladyada commented Aug 12, 2021

wooohoo! thank you :)

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

No branches or pull requests

4 participants