Fix issue
This commit is contained in:
parent
fe4dc2d81c
commit
9ade71b075
@ -18,6 +18,7 @@ from lib_not_dr.nuitka.reader.arg_parser import (
|
||||
toml_path_cli,
|
||||
gen_subprocess_args,
|
||||
subprocess_to_bash,
|
||||
parse_raw_config_by_script,
|
||||
)
|
||||
|
||||
# it will
|
||||
@ -140,8 +141,10 @@ def cli_main() -> None:
|
||||
toml = toml_loads(f.read())
|
||||
|
||||
nuitka_config = pyproject_toml(toml)
|
||||
print(f"config is: {nuitka_config}")
|
||||
cli_config = parse_raw_config_by_script(nuitka_config)
|
||||
|
||||
subprocess_command = gen_subprocess_args(nuitka_config)
|
||||
subprocess_command = gen_subprocess_args(cli_config)
|
||||
display_config(subprocess_command)
|
||||
|
||||
exit_arg = ("-no-run", "-n")
|
||||
|
@ -5,12 +5,13 @@
|
||||
# -------------------------------
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from pathlib import Path
|
||||
from warnings import warn
|
||||
from typing import Iterable, List
|
||||
|
||||
from lib_not_dr.nuitka import nuitka_config_type, raw_config_type
|
||||
from lib_not_dr.nuitka import nuitka_config_type, raw_config_type, parse_config_function
|
||||
|
||||
|
||||
def pyproject_toml(toml_data: dict) -> raw_config_type:
|
||||
@ -193,8 +194,9 @@ def parse_raw_config_by_script(raw_config: raw_config_type) -> nuitka_config_typ
|
||||
:param raw_config:
|
||||
:return: parsed config
|
||||
"""
|
||||
if script_name := raw_config.get("script") is None:
|
||||
if (script_name := raw_config.get("script")) is None:
|
||||
return raw_config["cli"]
|
||||
print(f'reading script {script_name}')
|
||||
script_path = Path(script_name)
|
||||
|
||||
sys.path.append(str(script_path.parent))
|
||||
@ -213,15 +215,16 @@ def parse_raw_config_by_script(raw_config: raw_config_type) -> nuitka_config_typ
|
||||
return raw_config["cli"]
|
||||
|
||||
try:
|
||||
parsed_config = script_module.main(raw_config["cli"])
|
||||
parsed_config = script_module.main(raw_config)
|
||||
except Exception as e:
|
||||
print(f"script {script_path} parse failed ignore it")
|
||||
print(e)
|
||||
traceback.print_exc()
|
||||
return raw_config["cli"]
|
||||
|
||||
if not isinstance(parsed_config, dict):
|
||||
print(f"script {script_path} parse failed ignore it")
|
||||
return raw_config["cli"]
|
||||
# if not isinstance(parsed_config, dict):
|
||||
# print(f"script {script_path} parse failed ignore it")
|
||||
# return raw_config["cli"]
|
||||
|
||||
return parsed_config
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user