mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-07-01 20:36:26 +00:00
init
This commit is contained in:
18
ui/extends/ocr.py
Normal file
18
ui/extends/ocr.py
Normal file
@ -0,0 +1,18 @@
|
||||
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
|
Reference in New Issue
Block a user