Commit caaf4861 authored by Mayoro Diagne's avatar Mayoro Diagne

disable transformation on CatalogMethodDocumentationHelper for ODT

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23310 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fb2d57cf
......@@ -71,11 +71,16 @@ class CatalogMethodDocumentationHelper(DocumentationHelper):
from zLOG import LOG, INFO
source_code = getattr(self.getDocumentedObject(), 'src', '')
portal_transforms = getattr(self, 'portal_transforms', None)
if portal_transforms is None:
if portal_transforms is not None:
REQUEST = getattr(self, 'REQUEST', None)
if REQUEST is not None:
if REQUEST.get('portal_skin', 'View' ) != 'View':
return source_code
else:
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of text to html')
'Transformation Tool is not installed. No convertion of python script to html')
return source_code
src_mimetype='text/plain'
src_mimetype='text/x-python'
mime_type = 'text/html'
source_html = portal_transforms.convertTo(mime_type, source_code, mimetype = src_mimetype)
return source_html.getData()
......
......@@ -71,11 +71,16 @@ class ZSQLMethodDocumentationHelper(DocumentationHelper):
from zLOG import LOG, INFO
source_code = getattr(self.getDocumentedObject(), "src", '')
portal_transforms = getattr(self, 'portal_transforms', None)
if portal_transforms is None:
if portal_transforms is not None:
REQUEST = getattr(self, 'REQUEST', None)
if REQUEST is not None:
if REQUEST.get('portal_skin', 'View' ) != 'View':
return source_code
else:
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of text to html')
'Transformation Tool is not installed. No convertion of python script to html')
return source_code
src_mimetype='text/plain'
src_mimetype='text/x-python'
mime_type = 'text/html'
source_html = portal_transforms.convertTo(mime_type, source_code, mimetype = src_mimetype)
return source_html.getData()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment