2024-02-21 16:24:48 +01:00
|
|
|
import json
|
2024-02-23 11:14:00 +01:00
|
|
|
from dataclasses import dataclass, asdict
|
2024-02-21 16:24:48 +01:00
|
|
|
|
2024-03-05 14:27:25 +01:00
|
|
|
|
2024-02-23 11:14:00 +01:00
|
|
|
@dataclass
|
2024-03-05 14:27:25 +01:00
|
|
|
class Galaxy:
|
2024-02-23 11:14:00 +01:00
|
|
|
description: str
|
2024-03-01 10:31:05 +01:00
|
|
|
icon: str
|
2024-02-23 11:14:00 +01:00
|
|
|
name: str
|
|
|
|
namespace: str
|
|
|
|
type: str
|
|
|
|
uuid: str
|
|
|
|
version: str
|
2024-02-21 16:24:48 +01:00
|
|
|
|
2024-02-23 11:14:00 +01:00
|
|
|
def save_to_file(self, path: str):
|
2024-02-21 16:24:48 +01:00
|
|
|
with open(path, "w") as file:
|
2024-06-18 16:58:38 +02:00
|
|
|
file.write(json.dumps(asdict(self), indent=2))
|
|
|
|
file.write('\n')
|