Updated base class form base HTML renderer
authorThierry Florac <thierry.florac@onf.fr>
Wed, 04 Jul 2018 09:05:30 +0200
changeset 214 e01d3a0db652
parent 213 7d552669f29f
child 215 0910e92af5e7
child 276 69cd0ee4546a
Updated base class form base HTML renderer
src/pyams_utils/text.py
--- a/src/pyams_utils/text.py	Tue Jul 03 14:19:55 2018 +0200
+++ b/src/pyams_utils/text.py	Wed Jul 04 09:05:30 2018 +0200
@@ -23,7 +23,7 @@
 from pyramid.interfaces import IRequest
 
 # import packages
-from pyams_utils.adapter import ContextRequestViewAdapter, adapter_config
+from pyams_utils.adapter import ContextRequestAdapter, ContextRequestViewAdapter, adapter_config
 from pyams_utils.request import check_request
 from pyams_utils.vocabulary import vocabulary_config
 from zope.interface import Interface
@@ -60,16 +60,12 @@
 
 
 @adapter_config(name='raw', context=(str, IRequest), provides=IHTMLRenderer)
-class BaseHTMLRenderer(object):
+class BaseHTMLRenderer(ContextRequestAdapter):
     """Raw text HTML renderer
 
     This renderer renders input text 'as is', mainly for use in a <pre> tag.
     """
 
-    def __init__(self, context, request):
-        self.context = context
-        self.request = request
-
     def render(self, **kwargs):
         return self.context