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) |
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) |