Subversion Repositories Kolibri OS

Rev

Rev 9368 | Rev 9373 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9368 Rev 9370
Line 5... Line 5...
5
import urllib.request
5
import urllib.request
6
import subprocess
6
import subprocess
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
import build
8
import build
9
 
9
 
Line 10... Line 10...
10
path_to_lib = '../lib'
10
path_to_tools = '..'
-
 
11
sys.path.append(path_to_tools)
-
 
12
 
-
 
13
from lib.makeflop import Floppy
Line 11... Line 14...
11
sys.path.append(path_to_lib)
14
from lib.platform import is_win32, path
12
 
15
from lib.logging import log
13
from makeflop import Floppy
16
from lib.network import download
14
 
17
 
Line 22... Line 25...
22
        return folder
25
        return folder
23
    else:
26
    else:
24
        return "." # Just a filename, let's return current folder
27
        return "." # Just a filename, let's return current folder
Line 25... Line 28...
25
 
28
 
26
# TODO: Move into _tools/lib
-
 
27
def is_win32():
-
 
28
    return True if sys.platform == "win32" else False
-
 
29
 
-
 
30
# TODO: Move into _tools/lib
-
 
31
def is_linux():
-
 
32
    return True if sys.platform == "linux" or sys.platform == "linux2" else False
-
 
33
 
-
 
34
# TODO: Move into _tools/lib
-
 
35
def  is_osx():
-
 
36
    return True if sys.platform == "darwin" else False
-
 
37
 
-
 
38
# TODO: Move into _tools/lib
-
 
39
def log(s, end = "\n"):
-
 
40
    print(s, end = end, flush = True)
-
 
41
 
-
 
42
# TODO: Move into _tools/lib
-
 
43
def download(link, path):
-
 
44
    log(f"Downloading {path}... ", end = "")
-
 
45
    urllib.request.urlretrieve(link, path)
-
 
46
    log("Done.")
-
 
47
 
-
 
48
# TODO: Move into _tools/lib
-
 
49
def path(*args):
-
 
50
    return os.sep.join(args)
-
 
51
 
-
 
52
# TODO: Move into _tools/lib
29
# TODO: Move into _tools/lib
53
def run_qemu(start_dir = "workspace"):
30
def run_qemu(start_dir = "workspace"):
54
    qemu_command = f"qemu-system-i386"
31
    qemu_command = f"qemu-system-i386"
55
    flags = ""
32
    flags = ""
56
    flags += "-L . " # IDK why it does not work without this
33
    flags += "-L . " # IDK why it does not work without this