Add args for Dataset and improve

This commit is contained in:
litagin02
2024-01-02 14:11:01 +09:00
parent a1069c73d2
commit f9c9c765fc
8 changed files with 154 additions and 60 deletions

View File

@@ -7,7 +7,7 @@ from .stdout_wrapper import SAFE_STDOUT
python = sys.executable
def run_script_with_log(cmd: list[str]) -> tuple[bool, str]:
def run_script_with_log(cmd: list[str], ignore_warning=False) -> tuple[bool, str]:
logger.info(f"Running: {' '.join(cmd)}")
result = subprocess.run(
[python] + cmd,
@@ -19,7 +19,7 @@ def run_script_with_log(cmd: list[str]) -> tuple[bool, str]:
logger.error(f"Error: {' '.join(cmd)}")
print(result.stderr)
return False, result.stderr
elif result.stderr:
elif result.stderr and not ignore_warning:
logger.warning(f"Warning: {' '.join(cmd)}")
print(result.stderr)
return True, result.stderr