adafruit / Adafruit_Learning_System_Guides

Programs and scripts to display "inline" in Adafruit Learning System guides

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove max_size and max_glyphs from CircuitPython examples

lesamouraipourpre opened this issue · comments

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 ?

  • AHT20_OLED - #1605 #1704
  • azure_gfx_helper.py - #1627
  • Baudot_TTY - #1607 #1705
  • Buckaroo_Plant_Care_Bot - #1608 #1717
  • Circuit_Playground_Sailor_Moon_Star_Locket - #1609
  • CircuitPython_Display_Text - #1612
  • CircuitPython_Flying_Toasters - #1614
  • CircuitPython_JEplayer_mp3 - #1632
  • CircuitPython_Pyloton - #1631
  • CircuitPython_PyPaint - #1622
  • CircuitPython_RGBMatrix - #1623
  • CircuitPython_RPN_Calculator - #1618
  • CircuitPython_Scrolling_Clouds - #1614
  • CircuitPython_SharpDisplay_Displayio - #1624
  • CircuitPython_Sip_and_Puff - #1628
  • CircuitPython_Slider - #1629
  • CircuitPython_Touch_Deck - #1630
  • CircuitStonks - #1706
  • CLUE_Altimeter - #1634
  • CLUE_BBQ - #1635
  • CLUE_Egg_Drop - #1636
  • CLUE_Hand_Wash_Timer - #1637
  • CLUE_I_Ching - #1638
  • CLUE_Light_Painter - #1646
  • CLUE_Metal_Detector - #1647
  • CLUE_Metronome - #1648
  • CLUE_Milk_Checker - #1649
  • CLUE_Rock_Paper_Scissors - #1650
  • CLUE_Sensor_Plotter - #1651
  • Clue_Step_Counter - #1652
  • CPB_AMS_Gizmo_BLE - #1653
  • CPB_ANCS - #1654
  • EInk_CircuitPython_Quickstart - #1655
  • FunHouse_IOT_Hub - #1656
  • IoT_Party_Parrot - #1657
  • I_Voted_Pin - #1658
  • LED_Matrix_Scoreboard - #1659
  • Macropad_Ableton - #1660
  • Macropad_Dragon_Drop - #1695
  • Macropad_Hotkeys - #1661
  • MagTag_Christmas_Countdown - #1663
  • MagTag_Dishwasher_Status - #1665
  • MagTag_Goole_Calendar - #1707
  • MagTag_NextBus - #1666
  • MagTag_Project_Selector - #1667
  • MagTag_Tides - #1668
  • MagTag_Weather - #1669
  • Matrix_On_Air - #1684
  • Matrix_Portal_Moon_Clock - #1685
  • Matrix_Portal_Tip_Jar - #1686
  • Matrix_Sprite_Animation_Player - #1687
  • Metro_Matrix_Clock - #1688
  • MIDI_CLUE_BLE_Glove - #1689
  • MIDI_Melody_Maker - #1690
  • Minecraft_Turbopad - #1708
  • Minesweep - #1692
  • Pico_MIDI_Fighter - #1693
  • PyBadge_Blinka_Jump_Game - #1694
  • PyBadge_Conference_Badge - #1696
  • PyGamer_Improved_Thermal_Camera - #1709
  • PyGamer_NeoPixel_Strip_Control - #1697
  • PyGamer_Thermal_Camera - #1703
  • PyPortal_AWS_IOT_Planter - #1710
  • PyPortal_Azure_Plant_Monitor - #1627
  • PyPortal_Calculator - #1715
  • PyPortal_CircuitPython_2020 - #1716
  • PyPortal_Electioncal_US - #1724
  • PyPortal_EventCountdown - #1725
  • PyPortal_EZ_Make_Oven - #1726
  • PyPortal_GCP_IOT_Planter - #1737
  • PyPortal_Google_Calendar - #1738
  • PyPortal_Halloween_Countdown - #1739
  • PyPortal_Hurricane_Tracker - #1740
  • PyPortal_IOT_Scale - #1741
  • PyPortal_ISS_Tracker - #1742
  • PyPortal_LIFX_Controller - #1736
  • PyPortal_Mogwai_Clock - #1735
  • PyPortal_MQTT_Control - #1734
  • PyPortal_OpenWeather - #1733
  • pyportal_pet_planter - #1732
  • PyPortal_Philips_Hue_Controller - #1731
  • PyPortal_Quarantine_Clock - #1730
  • PyPortal_Remote - #1729
  • PyPortal_Smart_Thermometer - #1728
  • PyPortal_Titano_Weather_Station - #1727
  • PyPortal_TOTP_Friend - #1714
  • PyPortal_Trivia_Time - #1713
  • PyPortal_User_Interface - #1712
  • PyPortal_UV_Index - #1702
  • PyPortal_Wakeup_Light - #1711
  • pyportal_weather_station - #1700
  • RGB_Matrix_Slot_Machine - #1699
  • Say_Their_Names_LEDMatrix - #1698
  • Smart_Alarm_Clock - #1683
  • TFT_Gizmo_Snowglobe - #1682
  • Tilemap_Game_With_CircuitPython - #1681
  • Vertical_Garden_Barometer - #1680
  • Voice2Json_Edge_Detection - #1679
  • Weather_Display_Matrix - #1678

@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?

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.

I am going to start working on this list from the bottom moving upwards to avoid accidentally duplicating any of @lesamouraipourpre 's work

Sounds Good. I'll continue downwards.

@FoamyGuy I've modified the grep search to look for max_glyphs as well - it's added a few more to the list.

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

wooohoo! thank you :)