forked from KolibriOS/kolibrios
[WS] Use lib/build.py to download kolibri.img
git-svn-id: svn://kolibrios.org@9390 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from .network import download
|
||||
from .constants import tools_cache
|
||||
|
||||
def builds_get(path):
|
||||
def builds_get(path, output_path = None):
|
||||
url = f"http://builds.kolibrios.org/{path}"
|
||||
output_path = f"{tools_cache}/builds.kolibrios.org/{path}"
|
||||
output_dir = os.path.dirname(output_path)
|
||||
os.makedirs(output_dir, exist_ok = True)
|
||||
download(url, output_path, skip_exist = True)
|
||||
return output_path
|
||||
cached_path = f"{tools_cache}/builds.kolibrios.org/{path}"
|
||||
os.makedirs(os.path.dirname(cached_path), exist_ok = True)
|
||||
download(url, cached_path, skip_exist = True)
|
||||
if output_path != None:
|
||||
shutil.copyfile(cached_path, output_path)
|
||||
return output_path
|
||||
return cached_path
|
||||
|
||||
def builds_get_contents(path):
|
||||
output_path = builds_get(path)
|
||||
|
Reference in New Issue
Block a user