ver Jan10thv2

a new example config for Thunderbird
fixed several bugs
This commit is contained in:
David Chang
2024-01-10 21:58:29 +08:00
parent cf5d480f44
commit 1515b05666
8 changed files with 117 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
from typing import Dict
from typing import Optional
import os
import requests
@@ -27,7 +28,7 @@ def get_cloud_file(env, config: Dict[str, str]) -> str:
return _path
def get_vm_file(env, config: Dict[str, str]) -> str:
def get_vm_file(env, config: Dict[str, str]) -> Optional[str]:
"""
Config:
path (str): absolute path on the VM to fetch
@@ -37,6 +38,8 @@ def get_vm_file(env, config: Dict[str, str]) -> str:
_path = os.path.join(env.cache_dir, config["dest"])
file = env.controller.get_file(config["path"])
if file is None:
return None
with open(_path, "wb") as f:
f.write(file)