clan-cli: clan_cli.jsonrpc -> clan_lib.jsonrpc

This commit is contained in:
lassulus
2025-05-20 14:51:22 +02:00
parent 18ee17c838
commit 9809990350
2 changed files with 1 additions and 2 deletions

View File

@@ -1,15 +0,0 @@
import dataclasses
import json
from typing import Any
class ClanJSONEncoder(json.JSONEncoder):
def default(self, o: Any) -> Any:
# Check if the object has a to_json method
if hasattr(o, "to_json") and callable(o.to_json):
return o.to_json()
# Check if the object is a dataclass
if dataclasses.is_dataclass(o):
return dataclasses.asdict(o) # type: ignore
# Otherwise, use the default serialization
return super().default(o)