--- 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