-
Notifications
You must be signed in to change notification settings - Fork 21
Support chunked transfers in wget #118
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
base: main
Are you sure you want to change the base?
Conversation
| from adafruit_bitmap_font import bitmap_font | ||
| from adafruit_display_text import wrap_text_to_lines | ||
| from adafruit_display_text.bitmap_label import Label | ||
| from adafruit_display_text.outlined_label import OutlinedLabel |
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.
I think we should wait a bit on changing this. Some of the device specific libraries that are use PortalBase are for devices with Display Text frozen in.
Unless users of those devices put the latest Display Text library in the root of CIRCUITPY, they won't have access to the newest version.
I think this should only change here after there is a new core release that includes the updated Display Text frozen in
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.
It does unfortunately mean that when this library is in use on devices without frozen Display Text it will be printing that deprecation message.
Maybe we should disable the warning print for now and only turn it back on after that release is out so that updating is possible / easy for all devices.
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.
I think I should be able to catch an ImportError so that it will work in both scenarios. Normally, I wouldn't want to touch this in the PR, but it was throwing an error in addition to the deprecation warning:
ImportError: cannot import name 'OutlinedLabel' from 'adafruit_display_text.outlined_label' (/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/adafruit_display_text/outlined_label.py). Did you mean: 'outlined_label'?
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.
Let me know if the most recent commit, cdbce86, works for you.
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.
Portal_Base is also a frozen library. Maybe some code that checks if the Bitmap Label has outline_color or outline_size properties might work well enough.
Chunked transfers are already supported within
adafruit_requestsbut thecontent-lengthcheck withinadafruit_portalbase.network.NetworkBase.wget(see below) prevents them from working because they leave that header omitted. (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Transfer-Encoding#chunked for reference)Adafruit_CircuitPython_PortalBase/adafruit_portalbase/network.py
Lines 336 to 339 in 25fc43d
This update extends
wgetto allow chunked transfers.I've provided a simple demonstration using the Adafruit Fruit Jam to download the source files zipball from a GitHub repository which uses chunked transfer encoding.
I've provided more information in my investigation here: relic-se/Fruit_Jam_Library#12.
This update also includes compatibility fixes for
adafruit_display_textversion 3.4.0 related to outlined labels. (https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/releases/tag/3.4.0)