Subversion Repositories Kolibri OS

Rev

Rev 9389 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9389 Rev 9390
Line 1... Line 1...
1
import os
1
import os
-
 
2
import shutil
Line 2... Line 3...
2
 
3
 
3
from .network import download
4
from .network import download
Line 4... Line 5...
4
from .constants import tools_cache
5
from .constants import tools_cache
5
 
6
 
6
def builds_get(path):
7
def builds_get(path, output_path = None):
7
    url = f"http://builds.kolibrios.org/{path}"
8
    url = f"http://builds.kolibrios.org/{path}"
8
    output_path = f"{tools_cache}/builds.kolibrios.org/{path}"
9
    cached_path = f"{tools_cache}/builds.kolibrios.org/{path}"
9
    output_dir = os.path.dirname(output_path)
10
    os.makedirs(os.path.dirname(cached_path), exist_ok = True)
-
 
11
    download(url, cached_path, skip_exist = True)
10
    os.makedirs(output_dir, exist_ok = True)
12
    if output_path != None:
-
 
13
        shutil.copyfile(cached_path, output_path)
Line 11... Line 14...
11
    download(url, output_path, skip_exist = True)
14
        return output_path
12
    return output_path
15
    return cached_path
13
 
16
 
14
def builds_get_contents(path):
17
def builds_get_contents(path):