Module: check_mk
Branch: master
Commit: 34ffec1e5ed766c818b5192cf4861858e6ce39a4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=34ffec1e5ed766…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Jul 17 13:29:55 2018 +0200
Simplified inheritance hierarchy. Improved comments.
Change-Id: Ia96cee0cffe864ae145f3ac61f1c893793aab87d
---
cmk/gui/gui_background_job.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/cmk/gui/gui_background_job.py b/cmk/gui/gui_background_job.py
index 0069151..0d5e435 100644
--- a/cmk/gui/gui_background_job.py
+++ b/cmk/gui/gui_background_job.py
@@ -169,10 +169,7 @@ class
GUIBackgroundJobSnapshottedFunctions(background_job.BackgroundJob):
return super(GUIBackgroundJobSnapshottedFunctions, self).get_title()
-# TODO: The superclasses are nonsense: GUIBackgroundJobSnapshottedFunctions
-# already derives from background_jobs.BackgroundJob. What is the right way to
-# fix this?
-class GUIBackgroundJob(GUIBackgroundJobSnapshottedFunctions,
background_job.BackgroundJob):
+class GUIBackgroundJob(GUIBackgroundJobSnapshottedFunctions):
_background_process_class = GUIBackgroundProcess
def __init__(self, job_id, **kwargs):
@@ -213,10 +210,13 @@ class GUIBackgroundJob(GUIBackgroundJobSnapshottedFunctions,
background_job.Back
-# Provides the frozen state of a background job
-# Quite helpful when generating GUI pages with several phases
-
-# TODO: What on earth is this class supposed to do?
+# GUI pages are built in several phases, and each face can take a non-trivial
+# amount of time. Nevertheless, it is crucial to render a consistent state of
+# the background job in question. The class below provides such a status
+# snapshot for the job given to the constructor.
+#
+# TODO: BackgroundJob should provide an explicit status object, which we can use
+# here without any metaprogramming Kung Fu and arcane inheritance hierarchies.
class GUIBackgroundStatusSnapshot(object):
def __init__(self, background_job):
super(GUIBackgroundStatusSnapshot, self).__init__()