Module: check_mk
Branch: master
Commit: 318fcfedda0ed18a430b8fc0c7e8369e79495842
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=318fcfedda0ed1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 23 14:57:12 2018 +0200
6357 FIX Facelift theme: Icon buttons were not using themed buttons
The facelift theme was using the classic icons for icon buttons instead of
the icons it should use.
Change-Id: Ie090f53269243d355c34d04bd5ede17aa80198fe
---
.werks/6357 | 12 ++++++++++++
cmk/gui/htmllib.py | 21 ++++++++++++++++++++-
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/.werks/6357 b/.werks/6357
new file mode 100644
index 0000000..de27a48
--- /dev/null
+++ b/.werks/6357
@@ -0,0 +1,12 @@
+Title: Facelift theme: Icon buttons were not using themed buttons
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1532169118
+
+The facelift theme was using the classic icons for icon buttons instead of
+the icons it should use.
diff --git a/cmk/gui/htmllib.py b/cmk/gui/htmllib.py
index 3d787f9..6365ae0 100644
--- a/cmk/gui/htmllib.py
+++ b/cmk/gui/htmllib.py
@@ -2812,6 +2812,25 @@ hy
return "images/icons/%s.png" % icon_name
+ def _detect_themed_image_path(self, img_path):
+ """Detect whether or not the original file or a themed image should be loaded by the client
+
+ Priority:
+ 1. In case a theme is active: themes/[img_path] in site local hierarchy
+ 2. In case a theme is active: themes/[img_path] in standard hierarchy
+ 3. [img_path] in site local hierarchy
+ 4. [img_path] in standard hierarchy
+ """
+
+ if self._theme and self._theme != "classic":
+ rel_path = "share/check_mk/web/htdocs/themes/%s/%s" % (self._theme, img_path)
+ if os.path.exists(cmk.paths.omd_root+"/"+rel_path) or os.path.exists(cmk.paths.omd_root+"/local/"+rel_path):
+ return "themes/%s/%s" % (self._theme, img_path)
+
+ return img_path
+
+
+
def render_icon_button(self, url, help, icon, id=None, onclick=None,
style=None, target=None, cssclass=None, ty="button"):
@@ -2821,7 +2840,7 @@ hy
# TODO: Can we clean this up and move all button_*.png to internal_icons/*.png?
if ty == "button":
- icon = "images/button_" + icon + ".png"
+ icon = self._detect_themed_image_path("images/button_" + icon + ".png")
icon = HTML(self.render_icon(icon, cssclass="iconbutton"))
Module: check_mk
Branch: master
Commit: 8c7a726b22f2805943c077be7797901fdc35cec8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8c7a726b22f280…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Jul 23 08:56:12 2018 +0200
Enabled too-many-ancestors and classified the remaining too-FOO-BAR warnings.
Change-Id: Ie1c67f5d3640cf936afdfb1dc7044476235e5229
---
tests/pylint/pylintrc | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index eb7fea6..0f6834d 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -39,18 +39,6 @@ disable=
reimported,
relative-import,
singleton-comparison,
- too-few-public-methods,
- too-many-ancestors,
- too-many-arguments,
- too-many-boolean-expressions,
- too-many-branches,
- too-many-instance-attributes,
- too-many-lines,
- too-many-locals,
- too-many-nested-blocks,
- too-many-public-methods,
- too-many-return-statements,
- too-many-statements,
ungrouped-imports,
unidiomatic-typecheck,
unsubscriptable-object,
@@ -82,6 +70,10 @@ disable=
# duplication (introduce new classes, combine methods, etc.)
attribute-defined-outside-init,
#---------------------------------------------------------------------------
+ # We should enable this, at the moment it just means splitting up two
+ # gigantic functions.
+ too-many-branches,
+ #---------------------------------------------------------------------------
# Enabling these warnings would be nice, they are mostly a sign of sloppy
# programming practice. In some cases, they can even hide bugs.
bare-except,
@@ -92,6 +84,20 @@ disable=
# probably want to use "include-naming-hint=yes" in the BASIC section.
invalid-name,
#---------------------------------------------------------------------------
+ # Enabling these would be nice, but given the current state of affairs
+ # (gigantic modules with deeply nested humungous functions/methods), this
+ # will be a non-trivial amount of work.
+ too-few-public-methods,
+ too-many-arguments,
+ too-many-boolean-expressions,
+ too-many-instance-attributes,
+ too-many-lines,
+ too-many-locals,
+ too-many-nested-blocks,
+ too-many-public-methods,
+ too-many-return-statements,
+ too-many-statements,
+ #---------------------------------------------------------------------------
# The warnigns below will probably fixed by YAPF.
bad-continuation,
bad-indentation,