|
@ -9,6 +9,7 @@ import json |
|
|
import logging |
|
|
import logging |
|
|
import os |
|
|
import os |
|
|
from contextlib import closing |
|
|
from contextlib import closing |
|
|
|
|
|
from genshi.core import Markup |
|
|
|
|
|
|
|
|
import pkg_resources |
|
|
import pkg_resources |
|
|
import requests |
|
|
import requests |
|
@ -64,12 +65,22 @@ def py3o_report_extender(report_xml_id=None): |
|
|
return fct1 |
|
|
return fct1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def format_multiline_value(value): |
|
|
|
|
|
if value: |
|
|
|
|
|
return Markup(unicode(value).replace('<', '<').replace('>', '>'). |
|
|
|
|
|
replace('\n', '<text:line-break/>'). |
|
|
|
|
|
replace('\t', '<text:s/><text:s/><text:s/><text:s/>')) |
|
|
|
|
|
return "" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@py3o_report_extender() |
|
|
@py3o_report_extender() |
|
|
def defautl_extend(report_xml, localcontext): |
|
|
def defautl_extend(report_xml, localcontext): |
|
|
# add the base64decode function to be able do decode binary fields into |
|
|
# add the base64decode function to be able do decode binary fields into |
|
|
# the template |
|
|
# the template |
|
|
localcontext['b64decode'] = b64decode |
|
|
localcontext['b64decode'] = b64decode |
|
|
localcontext['report_xml'] = report_xml |
|
|
localcontext['report_xml'] = report_xml |
|
|
|
|
|
localcontext['format_multiline_value'] = format_multiline_value |
|
|
|
|
|
localcontext['html_sanitize'] = tools.html2plaintext |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Py3oReport(models.TransientModel): |
|
|
class Py3oReport(models.TransientModel): |
|
|