From f505262a89a1f706133aa1ffab636ed4650e0182 Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Sat, 4 Dec 2021 09:53:10 +0000 Subject: [PATCH] [WS][run.py] Use os.path.dirname instead of hand-written function git-svn-id: svn://kolibrios.org@9381 a494cfbc-eb01-0410-851d-a64ba20cac60 --- _tools/workspace/run.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/_tools/workspace/run.py b/_tools/workspace/run.py index c5e1b195fd..58df8058b5 100644 --- a/_tools/workspace/run.py +++ b/_tools/workspace/run.py @@ -16,17 +16,6 @@ from lib.platform import is_win32, path from lib.logging import log from lib.network import download -# TODO: Move into _tools/lib -def get_file_directory(path): - path = path.replace("\\", "/") - if "/" in path: - folder = "/".join(path.split("/")[:-1]) - if folder == "": - return "/" # It was a file in the root folder - return folder - else: - return "." # Just a filename, let's return current folder - # TODO: Move into _tools/lib def run_qemu(start_dir = "workspace"): qemu_command = f"qemu-system-i386" @@ -39,7 +28,7 @@ def run_qemu(start_dir = "workspace"): flags += "-soundhw ac97 " if is_win32(): qemu_full_path = shutil.which(qemu_command) - qemu_directory = get_file_directory(qemu_full_path) + qemu_directory = os.path.dirname(qemu_full_path) flags += f"-L {qemu_directory} " s = f"{qemu_command} {flags}" qemu_stdout = open(f"{start_dir}/qemu_stdout.log", "w")