Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
0bc62435
Commit
0bc62435
authored
Sep 13, 2023
by
ave
Browse files
Options
Downloads
Patches
Plain Diff
drop urllib.urequest
parent
a53d8b54
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/micropython/frozen/manifest.py
+0
-1
0 additions, 1 deletion
components/micropython/frozen/manifest.py
python_payload/apps/gr33nhouse/download.py
+3
-3
3 additions, 3 deletions
python_payload/apps/gr33nhouse/download.py
with
3 additions
and
4 deletions
components/micropython/frozen/manifest.py
+
0
−
1
View file @
0bc62435
package
(
"
toml
"
)
package
(
"
toml
"
)
require
(
"
urllib.urequest
"
)
This diff is collapsed.
Click to expand it.
python_payload/apps/gr33nhouse/download.py
+
3
−
3
View file @
0bc62435
from
st3m.input
import
InputController
,
InputState
from
st3m.input
import
InputController
,
InputState
from
st3m.goose
import
Optional
,
List
from
st3m.goose
import
Optional
,
List
from
st3m.ui
import
colours
from
st3m.ui
import
colours
from
urllib.urequest
import
urlopen
import
urequests
import
gzip
import
gzip
from
utarfile
import
TarFile
,
DIRTYPE
from
utarfile
import
TarFile
,
DIRTYPE
import
io
import
io
...
@@ -84,12 +84,12 @@ class DownloadView(BaseView):
...
@@ -84,12 +84,12 @@ class DownloadView(BaseView):
def
download_file
(
self
,
url
:
str
,
block_size
=
40960
)
->
List
[
bytes
]:
def
download_file
(
self
,
url
:
str
,
block_size
=
40960
)
->
List
[
bytes
]:
gc
.
collect
()
gc
.
collect
()
req
=
ur
lopen
(
url
)
req
=
ur
equests
.
get
(
url
)
yield
yield
try
:
try
:
while
True
:
while
True
:
new_data
=
req
.
read
(
block_size
)
new_data
=
req
.
raw
.
read
(
block_size
)
yield
new_data
yield
new_data
if
len
(
new_data
)
<
block_size
:
if
len
(
new_data
)
<
block_size
:
break
break
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment