From b0607c4f7909bb3e446dca94a7613ff708a3b502 Mon Sep 17 00:00:00 2001 From: Timothyxxx <384084775@qq.com> Date: Sat, 9 Mar 2024 19:32:05 +0800 Subject: [PATCH] Fix bugs imported by Xiaochuan xs --- desktop_env/evaluators/getters/file.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/desktop_env/evaluators/getters/file.py b/desktop_env/evaluators/getters/file.py index 39394d0..4b5428a 100644 --- a/desktop_env/evaluators/getters/file.py +++ b/desktop_env/evaluators/getters/file.py @@ -87,15 +87,14 @@ def get_vm_file(env, config: Dict[str, Any]) -> Union[Optional[str], List[Option paths: List[str] = [config["path"]] dests: List[str] = [config["dest"]] print(config) - if "time_suffix" in config.keys() and config["time_suffix"]: - if "time_format" in config.keys(): - time_format = config["time_format"] - # Insert time before . in file type suffix - paths = [p.split(".")[0] + datetime.now().strftime(time_format) + "." + p.split(".")[1] if "." in p else p for p in paths] - dests = [d.split(".")[0] + datetime.now().strftime(time_format) + "." + d.split(".")[1] if "." in d else d for d in dests] - else: - paths: List[str] = config["path"] - dests: List[str] = config["dest"] + + if "time_suffix" in config.keys() and config["time_suffix"]: + if "time_format" in config.keys(): + time_format = config["time_format"] + # Insert time before . in file type suffix + paths = [p.split(".")[0] + datetime.now().strftime(time_format) + "." + p.split(".")[1] if "." in p else p for p in paths] + dests = [d.split(".")[0] + datetime.now().strftime(time_format) + "." + d.split(".")[1] if "." in d else d for d in dests] + print(paths) print(dests)