Module: check_mk
Branch: master
Commit: 0fa8423bd861857b015680350b3d64aad7c29546
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0fa8423bd86185…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 12 20:37:23 2018 +0200
Add TODO
Change-Id: I3cc57eef64aeef55f905da0e2c2bfe412c9c21d9
---
cmk/gui/plugin_registry.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmk/gui/plugin_registry.py b/cmk/gui/plugin_registry.py
index 2080608..ddd68bc 100644
--- a/cmk/gui/plugin_registry.py
+++ b/cmk/gui/plugin_registry.py
@@ -26,6 +26,10 @@
import abc
+# TODO: We decided to change this plugin registry from automatically finding
+# it's childs to explicit registration.
+# TODO: In the moment we have this, we can drop the auto_register stuff.
+
class Registry(object):
"""The management object for all available plugins of a component.
Module: check_mk
Branch: master
Commit: 08d666b9762c27c9e0e021f7f1a3a0fc760b745c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=08d666b9762c27…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 12 09:02:19 2018 +0200
Refactored page handler registration to decorator mechanism
* Needed to clean this up because of several cyclic imports
* Each function that should be called when a specific URL is requested
needs to be registered to the GUI. This was previously done creating
a plugin in the web/plugin/pages hierarchy
* Now this is done right where the handler function is defined using
a decorator. Import "cmk.gui.pages" and prefix the function definition
with a line like this: @cmk.gui.pages.register("name_of_page"). For
example:
import cmk.gui.pages
@cmk.gui.pages.register("my_test_page")
def page_my_test_page():
...
This page will then be available to the user under the URL
(check_mk/my_test_page.py).
* When you create a new main module for the GUI the pages plugin was
previously used to make the GUI know your module.
This is now done using the "main_module" plugin hierarchy. To register
a main module drop a .py file into cmk/gui/plugins/main_modules and
add the import of your "cmk.gui.[name]" top level module there. The
GUI will then automatically import this module and register the things
you like add to the GUI with it (for example page handlers).
Change-Id: I7fa75df6d439821188887c43da718350d67dd893
---
cmk/gui/bi.py | 6 ++
cmk/gui/crash_reporting.py | 12 +++
cmk/gui/cron.py | 2 +
cmk/gui/dashboard.py | 13 ++-
cmk/gui/help.py | 5 +-
cmk/gui/inventory.py | 2 +
cmk/gui/login.py | 5 +
cmk/gui/logwatch.py | 2 +
cmk/gui/main.py | 2 +
cmk/gui/metrics.py | 4 +
cmk/gui/mobile.py | 3 +
cmk/gui/modules.py | 77 +++++--------
cmk/gui/notifications.py | 2 +
cmk/gui/notify.py | 2 +
cmk/gui/{plugins/pages/utils.py => pages.py} | 32 +++++-
cmk/gui/pagetypes.py | 14 +--
.../plugins/{pages => main_modules}/__init__.py | 15 ---
.../plugins/{pages/cron.py => main_modules/cre.py} | 31 +++++-
cmk/gui/plugins/pages/bi.py | 36 -------
cmk/gui/plugins/pages/metrics.py | 32 ------
cmk/gui/plugins/pages/mobile.py | 33 ------
cmk/gui/plugins/pages/shipped.py | 119 ---------------------
cmk/gui/plugins/pages/wato.py | 48 ---------
cmk/gui/plugins/views/inventory.py | 2 +
cmk/gui/prediction.py | 2 +
cmk/gui/sidebar.py | 26 ++++-
cmk/gui/userdb.py | 2 +
cmk/gui/valuespec.py | 5 +
cmk/gui/views.py | 14 +++
cmk/gui/visuals.py | 3 +
cmk/gui/wato/__init__.py | 31 +++++-
cmk/gui/webapi.py | 2 +
cmk/gui/weblib.py | 4 +
cmk/gui/werks.py | 3 +
web/app/index.wsgi | 11 +-
35 files changed, 236 insertions(+), 366 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=08d666b976…