doc and style: formatted the whole codebase to pep8 plus added documentation where necessary

This commit is contained in:
Benedict Xavier Wanyonyi
2024-05-30 15:43:45 +03:00
parent e526e31083
commit b94987dfd7
54 changed files with 555 additions and 346 deletions

View File

@@ -9,6 +9,8 @@ Cache.register("data.anime", limit=20, timeout=600)
class AnimeScreenController:
"""The controller for the anime screen
"""
def __init__(self, model: AnimeScreenModel):
self.model = model
self.view = AnimeScreenView(controller=self, model=self.model)
@@ -17,6 +19,12 @@ class AnimeScreenController:
return self.view
def update_anime_view(self, id: int, caller_screen_name: str):
"""method called to update the anime screen when a new
Args:
id (int): the anilst id of the anime
caller_screen_name (str): the screen thats calling this method; used internally to switch back to this screen
"""
if self.model.anime_id != id:
if cached_anime_data := Cache.get("data.anime", f"{id}"):
data = cached_anime_data