Module: check_mk
Branch: master
Commit: ad0fa50023c4bc50042d27afe09ba4a88e121942
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ad0fa50023c4bc…
Author: Óscar Nájera <on(a)mathias-kettner.de>
Date: Thu Sep 27 13:40:50 2018 +0200
enable pylint redefined-builtin
Fix missing cases
CMK-845
Change-Id: Ia6893a740ec3fc420aaf3908ddd23942296d0d01
---
.pylintrc | 2 +-
cmk/gui/crash_reporting.py | 2 +-
cmk/gui/forms.py | 2 +-
cmk/gui/htmllib.py | 8 ++++----
cmk/gui/table.py | 2 +-
cmk/gui/wato/__init__.py | 6 +++---
tests/unit/cmk/gui/test_table.py | 6 +++---
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/.pylintrc b/.pylintrc
index 7c007bb..06bf549 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -63,7 +63,7 @@ disable=
# Enabling this would be nice, but not crucial. At the moment, we have quite
# a few violations (about 200 in roughly 50 modules), so we postpone fixing
# this.
- redefined-builtin,
+ # redefined-builtin,
#---------------------------------------------------------------------------
# Enabling this would be nice, but not crucial. Nevertheless, this would
# improve readability and involve some cleanups in our class hierarchy, so
diff --git a/cmk/gui/crash_reporting.py b/cmk/gui/crash_reporting.py
index 76f4274..9ec13a4 100644
--- a/cmk/gui/crash_reporting.py
+++ b/cmk/gui/crash_reporting.py
@@ -416,7 +416,7 @@ def show_gui_crash_details(info):
html.open_tr(class_="data even0")
html.td(_("HTTP Parameters"), class_="left")
html.open_td()
- html.debug_vars(vars=details["vars"], hide_with_mouse=False)
+ html.debug_vars(vars_=details["vars"], hide_with_mouse=False)
html.close_td()
html.close_tr()
_crash_row(_("Referer"), details.get("referer",
_("Unknown")))
diff --git a/cmk/gui/forms.py b/cmk/gui/forms.py
index 02144c5..e3fee81 100644
--- a/cmk/gui/forms.py
+++ b/cmk/gui/forms.py
@@ -30,7 +30,7 @@ from cmk.gui.globals import html
from cmk.gui.exceptions import MKUserError
# A input function with the same call syntax as htmllib.textinput()
-def input(valuespec, varprefix, defvalue):
+def textinput(valuespec, varprefix, defvalue):
if html.form_filled_in():
value = valuespec.from_html_vars(varprefix)
else:
diff --git a/cmk/gui/htmllib.py b/cmk/gui/htmllib.py
index 01cfbd1..0997566 100644
--- a/cmk/gui/htmllib.py
+++ b/cmk/gui/htmllib.py
@@ -2906,13 +2906,13 @@ hy
self.end_foldable_container()
- def debug_vars(self, prefix=None, hide_with_mouse=True, vars=None):
- if not vars:
- vars = self.request.vars
+ def debug_vars(self, prefix=None, hide_with_mouse=True, vars_=None):
+ if not vars_:
+ vars_ = self.request.vars
hover = "this.style.display=\'none\';"
self.open_table(class_=["debug_vars"], onmouseover=hover if
hide_with_mouse else None)
self.tr(self.render_th(_("POST / GET Variables"),
colspan="2"))
- for name, value in sorted(vars.items()):
+ for name, value in sorted(vars_.items()):
if name in [ "_password", "password" ]:
value = "***"
if not prefix or name.startswith(prefix):
diff --git a/cmk/gui/table.py b/cmk/gui/table.py
index 084a8ec..d86f7e5 100644
--- a/cmk/gui/table.py
+++ b/cmk/gui/table.py
@@ -38,7 +38,7 @@ tables = []
@contextmanager
-def open(table_id=None, title=None, **kwargs):
+def open_table(table_id=None, title=None, **kwargs):
begin(table_id, title, **kwargs)
yield
end()
diff --git a/cmk/gui/wato/__init__.py b/cmk/gui/wato/__init__.py
index 45ee473..9273668 100644
--- a/cmk/gui/wato/__init__.py
+++ b/cmk/gui/wato/__init__.py
@@ -10124,7 +10124,7 @@ class ModeEditAuxtag(ModeEditHosttagConfiguration):
forms.section(_("Topic") + "<sup>*</sup>")
html.help(_("Different taggroups can be grouped in topics to make the
visualization and "
"selections in the GUI more comfortable."))
- forms.input(self._get_topic_valuespec(), "topic",
changed_aux_tag.topic)
+ forms.textinput(self._get_topic_valuespec(), "topic",
changed_aux_tag.topic)
# Button and end
forms.end()
@@ -10269,7 +10269,7 @@ class ModeEditHosttagGroup(ModeEditHosttagConfiguration):
forms.section(_("Topic") + "<sup>*</sup>")
html.help(_("Different taggroups can be grouped in topics to make the
visualization and "
"selections in the GUI more comfortable."))
- forms.input(self._get_topic_valuespec(), "topic",
self._untainted_tag_group.topic)
+ forms.textinput(self._get_topic_valuespec(), "topic",
self._untainted_tag_group.topic)
# Choices
forms.section(_("Choices"))
@@ -10284,7 +10284,7 @@ class ModeEditHosttagGroup(ModeEditHosttagConfiguration):
"change its title at the same time! Otherwise WATO will not
"
"be able to detect the renaming and cannot exchange the tags
"
"in all folders, hosts and rules accordingly."))
- forms.input(self._get_taggroups_valuespec(), "choices",
self._untainted_tag_group.get_tags_legacy_format())
+ forms.textinput(self._get_taggroups_valuespec(), "choices",
self._untainted_tag_group.get_tags_legacy_format())
# Button and end
forms.end()
diff --git a/tests/unit/cmk/gui/test_table.py b/tests/unit/cmk/gui/test_table.py
index ec78c0a..87c80cc 100644
--- a/tests/unit/cmk/gui/test_table.py
+++ b/tests/unit/cmk/gui/test_table.py
@@ -85,7 +85,7 @@ def test_context(register_builtin_html):
rows = [ (i, i**3) for i in range(10) ]
header = ["Number", "Cubical"]
- with table.open(table_id=table_id, searchable=False, sortable=False):
+ with table.open_table(table_id=table_id, searchable=False, sortable=False):
for row in rows:
table.row()
for i in range(len(header)):
@@ -134,11 +134,11 @@ def test_nesting_context(register_builtin_html):
id = 0
title = " TEST "
- with table.open(table_id=id, title=title, searchable=False, sortable=False):
+ with table.open_table(table_id=id, title=title, searchable=False, sortable=False):
table.row()
table.cell("A", "1")
table.cell("B", "")
- with table.open(id+1, title+"2", searchable=False, sortable=False):
+ with table.open_table(id+1, title+"2", searchable=False,
sortable=False):
table.row()
table.cell("_", "+")
table.cell("|", "-")