🐛 Fixed GTK race condition in pipelines

This commit is contained in:
GeoffreyCoulaud
2023-05-29 01:38:36 +02:00
parent 8ddb110cbb
commit 0645808ac4
5 changed files with 28 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
from abc import abstractmethod
from typing import Callable
from typing import Callable, Any
from src.game import Game
@@ -16,6 +16,10 @@ class Manager:
errors: list[Exception]
blocking: bool = True
@property
def name(self):
return type(self).__name__
def __init__(self) -> None:
super().__init__()
self.errors = []
@@ -38,7 +42,7 @@ class Manager:
* May not raise exceptions, as they will be silently ignored
"""
def run(self, game: Game, callback: Callable[["Manager"]]) -> None:
def run(self, game: Game, callback: Callable[["Manager"], Any]) -> None:
"""Pass the game through the manager.
In charge of calling the final_run method."""
self.final_run(game)