mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
@@ -2,7 +2,8 @@ import argparse
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Dict, Optional, Tuple
|
from pathlib import Path
|
||||||
|
from typing import Dict, Optional, Tuple, Union
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@@ -97,7 +98,7 @@ def _put_upload(file_path: str, upload_url: str) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def oss_upload(
|
def oss_upload(
|
||||||
file_path: str,
|
file_path: Union[str, Path],
|
||||||
filename: Optional[str] = None,
|
filename: Optional[str] = None,
|
||||||
driver_name: str = "default",
|
driver_name: str = "default",
|
||||||
exp_type: str = "default",
|
exp_type: str = "default",
|
||||||
@@ -122,6 +123,7 @@ def oss_upload(
|
|||||||
"oss_path": str # OSS路径(成功时)或空字符串(失败时)
|
"oss_path": str # OSS路径(成功时)或空字符串(失败时)
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
file_path = Path(file_path)
|
||||||
if filename is None:
|
if filename is None:
|
||||||
filename = os.path.basename(file_path)
|
filename = os.path.basename(file_path)
|
||||||
|
|
||||||
|
|||||||
@@ -752,6 +752,12 @@ class HostNode(BaseROS2DeviceNode):
|
|||||||
if return_info_str is not None:
|
if return_info_str is not None:
|
||||||
try:
|
try:
|
||||||
return_info = json.loads(return_info_str)
|
return_info = json.loads(return_info_str)
|
||||||
|
# 适配后端的一些额外处理
|
||||||
|
return_value = return_info.get("return_value")
|
||||||
|
if isinstance(return_value, dict):
|
||||||
|
unilabos_samples = return_info.get("unilabos_samples")
|
||||||
|
if isinstance(unilabos_samples, list):
|
||||||
|
return_info["unilabos_samples"] = unilabos_samples
|
||||||
suc = return_info.get("suc", False)
|
suc = return_info.get("suc", False)
|
||||||
if not suc:
|
if not suc:
|
||||||
status = "failed"
|
status = "failed"
|
||||||
|
|||||||
Reference in New Issue
Block a user