From c98a9765ab501083c5b227f813a8c6ceb76c4652 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 5 Apr 2023 13:04:57 +0800 Subject: [PATCH] load language from main.tom --- Difficult_Rocket/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Difficult_Rocket/__init__.py b/Difficult_Rocket/__init__.py index 3f6efa9..b4d73a5 100644 --- a/Difficult_Rocket/__init__.py +++ b/Difficult_Rocket/__init__.py @@ -137,6 +137,10 @@ class _DR_runtime(Options): relationship = 'larger' if self.DR_Rust_version > self.DR_Rust_get_version else 'smaller' warnings.warn(f'DR_rust builtin version is {self.DR_Rust_version} but true version is {get_version_str()}.\n' f'Builtin version {relationship} than true version') + with contextlib.suppress(FileNotFoundError): + with open('./configs/main.toml', 'r', encoding='utf-8') as f: + import rtoml + self.language = rtoml.load(f)['runtime']['language'] DR_option = _DR_option()