merge default doc-dc
authorDamien Correia
Wed, 04 Jul 2018 14:24:03 +0200
branchdoc-dc
changeset 276 69cd0ee4546a
parent 275 59452a6f51a8 (current diff)
parent 214 e01d3a0db652 (diff)
child 277 7e4fd92a7880
merge default
--- a/src/pyams_utils/text.py	Tue Jul 03 16:36:53 2018 +0200
+++ b/src/pyams_utils/text.py	Wed Jul 04 14:24:03 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