kopia lustrzana https://github.com/micropython/micropython
mpremote: Allow download package files from local fs.
When taken with PR #12476, allow relative URLs in package.json files to resolve to files on local fs. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>pull/12477/head
rodzic
e81a976d04
commit
87700bc7ee
|
@ -69,6 +69,11 @@ def _rewrite_url(url, branch=None):
|
|||
|
||||
|
||||
def _download_file(transport, url, dest):
|
||||
if url.split(":", 1)[0] not in ("http", "https"):
|
||||
print("Installing:", dest, "from", url)
|
||||
_ensure_path_exists(transport, dest)
|
||||
transport.fs_put(url, dest, progress_callback=show_progress_bar)
|
||||
return
|
||||
try:
|
||||
with urllib.request.urlopen(url) as src:
|
||||
fd, path = tempfile.mkstemp()
|
||||
|
|
Ładowanie…
Reference in New Issue