How to use the diazo.runtrace function in diazo

To help you get started, we’ve selected a few diazo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plone / diazo / lib / diazo / run.py View on Github external
if options.path is not None:
        params['path'] = "'{path}'".format(path=options.path)

    if options.parameters:
        for key, value in split_params(options.parameters).items():
            params[key] = quote_param(value)

    output_html = transform(content_doc, **params)
    if isinstance(options.output, string_types):
        out = open(options.output, 'wt')
    else:
        out = options.output
    out.write(str(output_html))

    if runtrace:
        runtrace_doc = diazo.runtrace.generate_runtrace(
            rules=options.rules,
            error_log=transform.error_log,
        )
        if options.runtrace_xml:
            if options.runtrace_xml == '-':
                out = sys.stdout
            else:
                out = open(options.runtrace_xml, 'wt')
            runtrace_doc.write(
                out,
                encoding='utf-8',
                pretty_print=options.pretty_print,
            )
        if options.runtrace_html:
            if options.runtrace_html == '-':
                out = sys.stdout
github plone / diazo / lib / diazo / run.py View on Github external
if options.runtrace_xml:
            if options.runtrace_xml == '-':
                out = sys.stdout
            else:
                out = open(options.runtrace_xml, 'wt')
            runtrace_doc.write(
                out,
                encoding='utf-8',
                pretty_print=options.pretty_print,
            )
        if options.runtrace_html:
            if options.runtrace_html == '-':
                out = sys.stdout
            else:
                out = open(options.runtrace_html, 'wt')
            out.write(str(diazo.runtrace.runtrace_to_html(runtrace_doc)))

    for msg in transform.error_log:
        if not msg.message.startswith('