Skip to content

Commit fe63de7

Browse files
author
Anna Belyakova
committed
chore: replace scenes function by variable
1 parent c5404d1 commit fe63de7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ def load_scenes(path: Path = Path("scenes.yaml")) -> list[Scene]:
1111
with open(path, encoding="utf-8") as f:
1212
data = yaml.safe_load(f)
1313
return [Scene.model_validate(scene) for scene in data.get("scenes", [])]
14+
15+
scenes: list[Scene] = load_scenes()

src/modules/scenes/repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from rapidfuzz import fuzz, utils
44

55
from src.api.logging_ import logger
6-
from src.config import load_scenes
6+
from src.config import scenes
77
from src.config_schema import Area, Scene
88
from src.modules.scenes.schemas import SearchResult
99

@@ -21,7 +21,7 @@ def prepare_for_search(area: Area) -> str | None:
2121
# noinspection PyMethodMayBeStatic
2222
class SceneRepository:
2323
def get_all(self) -> list[Scene]:
24-
return load_scenes()
24+
return scenes
2525

2626
def search(self, query: str):
2727
all_scenes = scene_repository.get_all()

0 commit comments

Comments
 (0)