2026-05-07 17:15:56 +03:00
|
|
|
from dataclasses import dataclass
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
|
class AstroObject:
|
|
|
|
|
"""Модель астрономического объекта"""
|
|
|
|
|
name: str
|
|
|
|
|
folder: Path
|
|
|
|
|
photo_count: int = 0
|
|
|
|
|
|
|
|
|
|
def increment_photo_count(self):
|
|
|
|
|
self.photo_count += 1
|
|
|
|
|
|
|
|
|
|
def get_object_log_path(self) -> Path:
|
|
|
|
|
return self.folder / "ObjectLog.txt"
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
return f"AstroObject(name='{self.name}', photos={self.photo_count})"
|