forked from mamba-org/powerloader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
32 lines (20 loc) · 744 Bytes
/
Copy pathtest.py
File metadata and controls
32 lines (20 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import sys
sys.path.append("./build/src/python/")
import pypowerloader
pypowerloader.hello_world()
path = "linux-64/python-3.9.7-hb7a2778_1_cpython.tar.bz2"
baseurl = "https://conda.anaconda.org/conda-forge"
filename = "python3.9_test"
downTarg = pypowerloader.DownloadTarget(path, baseurl, filename)
def progress(total, done):
print(f"Total {total}, done {done}")
return 0
downTarg.progress_callback = progress
con = pypowerloader.Context()
dl = pypowerloader.Downloader(con)
dl.add(downTarg)
# dl.download()
mirror = pypowerloader.Mirror(con, baseurl)
print("mirror_map1: " + str(con.mirror_map.as_dict()))
con.mirror_map.reset({"conda-forge": [mirror], "test": []})
print("mirror_map2: " + str(con.mirror_map.as_dict()))