Module: check_mk
Branch: master
Commit: 11a5c8d52ceeae2e6bcf86013a385f5655d93203
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=11a5c8d52ceeaeā¦
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 4 17:01:31 2018 +0200
Minor cleanups of html.debug()
* Don't use _lowlevel_write(). It should use .write() just like others.
* Moved pprint import to module level
Change-Id: Ifed6f7ae696ddf67df0694ed6a785eaf6c343e7b
---
web/htdocs/htmllib.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 54ccf1f..3e516db 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -66,6 +66,7 @@ import __builtin__
import signal
import json
import abc
+import pprint
from collections import deque
from contextlib import contextmanager
@@ -1657,13 +1658,12 @@ class html(HTMLGenerator):
#
def debug(self, *x):
- import pprint
for element in x:
try:
formatted = pprint.pformat(element)
except UnicodeDecodeError:
formatted = repr(element)
- self._lowlevel_write("%s" % self.render_pre(formatted))
+ self.write(self.render_pre(formatted))
#