/_tools/get_started.py |
---|
4,7 → 4,7 |
import os |
from lib.network import download_if_not_exist |
from lib.network import download |
from lib.logging import log |
from lib.constants import tools_cache, tools_cache_kolibri_img |
40,4 → 40,4 |
# Download IMG to _tools/cache |
os.makedirs(tools_cache, exist_ok = True) |
img_url = "http://builds.kolibrios.org/eng/data/data/kolibri.img" |
download_if_not_exist(img_url, tools_cache_kolibri_img) |
download(img_url, tools_cache_kolibri_img, skip_exist = True) |
/_tools/lib/network.py |
---|
2,12 → 2,10 |
import urllib.request |
from .logging import log |
def download(link, path): |
def download(link, path, skip_exist = False): |
if skip_exist and os.path.exists(path): |
return |
log(f"Downloading {path}... ", end = "") |
urllib.request.urlretrieve(link, path) |
log("Done.") |
def download_if_not_exist(link, path): |
if not os.path.exists(path): |
download(link, path) |
/_tools/workspace/run.py |
---|
14,7 → 14,6 |
from lib.makeflop import Floppy |
from lib.platform import is_win32, path |
from lib.logging import log |
from lib.network import download_if_not_exist |
from lib.constants import tools_cache_kolibri_img |
# TODO: Move into _tools/lib |