Fix multiple apps 5990457f-2adb-467b-a4af-5c857c92d762

This commit is contained in:
Timothyxxx
2024-03-09 20:54:52 +08:00
parent bec82726bc
commit 447c886b0a
3 changed files with 7 additions and 31 deletions

View File

@@ -95,19 +95,12 @@ def get_vm_file(env, config: Dict[str, Any]) -> Union[Optional[str], List[Option
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)
cache_paths: List[str] = []
gives: Set[int] = set(config.get("gives", [0]))
for i, (p, d) in enumerate(zip(paths, dests)):
print("env cache_dir: ")
print(env.cache_dir)
_path = os.path.join(env.cache_dir, d)
print("_path: ")
print(_path)
file = env.controller.get_file(p)
if file is None:
#return None
@@ -121,8 +114,6 @@ def get_vm_file(env, config: Dict[str, Any]) -> Union[Optional[str], List[Option
with open(_path, "wb") as f:
f.write(file)
# debug
print("cache_paths")
print(cache_paths)
return cache_paths[0] if len(cache_paths)==1 else cache_paths