diff --git a/betty/app/__init__.py b/betty/app/__init__.py index 69836580e..fc8d55224 100644 --- a/betty/app/__init__.py +++ b/betty/app/__init__.py @@ -12,8 +12,6 @@ from babel.core import parse_locale from babel.localedata import locale_identifiers -from betty.resource import Releaser, Acquirer - try: from typing import Self # type: ignore except ImportError: @@ -116,7 +114,7 @@ def dump(self) -> DumpedConfiguration: @reactive -class App(Acquirer, Releaser, Configurable[AppConfiguration], ReactiveInstance): +class App(Configurable[AppConfiguration], ReactiveInstance): def __init__(self, *args, **kwargs): from betty.url import AppUrlGenerator, StaticPathUrlGenerator @@ -167,12 +165,6 @@ def acquire(self) -> None: self._acquire_contexts.enter_context(Translations(NullTranslations())) # Then acquire the actual locale. self._acquire_contexts.enter_context(self.acquire_locale()) - - for extension in self.extensions.flatten(): - if isinstance(extension, Acquirer): - extension.acquire() - if isinstance(extension, Releaser): - self._acquire_contexts.callback(extension.release) except BaseException: self.release() raise diff --git a/betty/gui/error.py b/betty/gui/error.py index ffe0410f5..2a8a862c1 100644 --- a/betty/gui/error.py +++ b/betty/gui/error.py @@ -2,7 +2,7 @@ import functools import traceback -from typing import Optional, Callable, Any, List, TYPE_CHECKING +from typing import Optional, Callable, Any, TYPE_CHECKING if TYPE_CHECKING: from betty.builtins import _ @@ -69,8 +69,6 @@ def __exit__(self, exc_type, exc_val, exc_tb): class Error(QMessageBox): - _errors: List[Error] = [] - def __init__( self, message: str, @@ -83,7 +81,6 @@ def __init__( with App(): self.setWindowTitle('{error} - Betty'.format(error=_("Error"))) self.setText(message) - Error._errors.append(self) standard_button = QMessageBox.StandardButton.Close self.setStandardButtons(standard_button) @@ -93,7 +90,6 @@ def __init__( self.button(QMessageBox.StandardButton.Close).clicked.connect(self.close) # type: ignore def closeEvent(self, event: QCloseEvent) -> None: - Error._errors.remove(self) if self._close_parent: parent = self.parent() if isinstance(parent, QWidget): diff --git a/betty/resource.py b/betty/resource.py deleted file mode 100644 index 19b5b900f..000000000 --- a/betty/resource.py +++ /dev/null @@ -1,8 +0,0 @@ -class Acquirer: - def acquire(self) -> None: - raise NotImplementedError - - -class Releaser: - def release(self) -> None: - raise NotImplementedError