From 26cbaecc789f877de958ad0c00ba9e7189d72761 Mon Sep 17 00:00:00 2001 From: Stefano Borini <sborini@enthought.com> Date: Tue, 22 Aug 2017 10:56:49 +0100 Subject: [PATCH] UI Hook manager --- .../base_notification_listener_factory.py | 7 +++++++ .../notification_listeners/base_ui_hook_manager.py | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 force_bdss/notification_listeners/base_ui_hook_manager.py diff --git a/force_bdss/notification_listeners/base_notification_listener_factory.py b/force_bdss/notification_listeners/base_notification_listener_factory.py index 08e2b59..0dfff5b 100644 --- a/force_bdss/notification_listeners/base_notification_listener_factory.py +++ b/force_bdss/notification_listeners/base_notification_listener_factory.py @@ -48,3 +48,10 @@ class BaseNotificationListenerFactory(ABCHasStrictTraits): model_data: dict Data to use to fill the model. """ + + @abc.abstractmethod + def create_ui_hook_manager(self): + """Creates an instance of the hook manager + The hook manager contains a set of methods that are applicable in + various moments of the UI application lifetime. + """ diff --git a/force_bdss/notification_listeners/base_ui_hook_manager.py b/force_bdss/notification_listeners/base_ui_hook_manager.py new file mode 100644 index 0000000..d9e66d5 --- /dev/null +++ b/force_bdss/notification_listeners/base_ui_hook_manager.py @@ -0,0 +1,11 @@ +import abc +from traits.api import ABCHasStrictTraits + + +class BaseUIHookManager(ABCHasStrictTraits): + @abc.abstractmethod + def before_execution(self, application, model): + """Hook that is called before execution of a given model. + Gives a chance to alter the model before the temporary file is created + with its contents and the calculation invoked. + """ -- GitLab