Module: check_mk
Branch: master
Commit: 16c7a9eb945457999ad1d0870cff6bb0ee2cae11
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=16c7a9eb945457…
Author: Roland Halbig <rh(a)mathias-kettner.de>
Date: Tue Apr 18 16:44:55 2017 +0200
htmllib: cleaned up inheritence.
Change-Id: Iaf1fc267da683f6967b5a518e139af19697501fa
---
web/htdocs/htmllib.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 1071697..90e1364 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -91,6 +91,7 @@ class InvalidUserInput(Exception):
self.text = text
super(InvalidUserInput, self).__init__(varname, text)
+
class RequestTimeout(MKException):
pass
@@ -100,9 +101,10 @@ class RequestTimeout(MKException):
#
class Escaper(object):
-
- _unescaper_text = re.compile(r'<(/?)(h2|b|tt|i|br(?:
/)?|pre|a|sup|p|li|ul|ol)>')
- _unescaper_href = re.compile(r'<a
href="(.*?)">')
+ def __init__(self):
+ super(Escaper, self).__init__()
+ self._unescaper_text = re.compile(r'<(/?)(h2|b|tt|i|br(?:
/)?|pre|a|sup|p|li|ul|ol)>')
+ self._unescaper_href = re.compile(r'<a
href="(.*?)">')
# Encode HTML attributes. Replace HTML syntax with HTML text.
@@ -171,6 +173,7 @@ class Escaper(object):
class Encoder(object):
+
# This function returns a str object, never unicode!
# Beware: this code is crucial for the performance of Multisite!
# Changing from the self coded urlencode to urllib.quote
@@ -410,6 +413,7 @@ class OutputFunnel(object):
def __init__(self):
+ super(OutputFunnel, self).__init__()
self.plug_level = -1
self.plug_text = []
@@ -1355,9 +1359,10 @@ class RequestHandler(object):
class html(HTMLGenerator, Encoder, RequestHandler):
def __init__(self):
- HTMLGenerator.__init__(self)
- Encoder.__init__(self)
- RequestHandler.__init__(self)
+ super(html, self).__init__()
+# HTMLGenerator.__init__(self)
+# Encoder.__init__(self)
+# RequestHandler.__init__(self)
# rendering state
self.html_is_open = False