mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-04-20 17:50:17 +00:00
19 lines
528 B
Python
19 lines
528 B
Python
try:
|
|
import json
|
|
|
|
from arcaea_offline_ocr.device import Device
|
|
|
|
def load_devices_json(filepath: str) -> list[Device]:
|
|
with open(filepath, "r", encoding="utf-8") as f:
|
|
file_content = f.read()
|
|
if len(file_content) == 0:
|
|
return []
|
|
content = json.loads(file_content)
|
|
assert isinstance(content, list)
|
|
return [Device.from_json_object(item) for item in content]
|
|
|
|
except Exception:
|
|
|
|
def load_devices_json(*args, **kwargs):
|
|
pass
|