Esempio n. 1
0
def render_templates_tree(xsl):
    graph = create_graph()

    logging.debug('TRYING TO RENDER')

    gv.layout(graph, 'dot')

    tree = get_applies_tree(xsl)

    draw_tree(tree, graph, [])
    gv.layout(graph, 'dot')

    data = gv.renderdata(graph, 'svg')

    logging.debug('RENDERED!!!')

    return data
Esempio n. 2
0
def render_templates_tree(xsl):
    graph = create_graph()

    logging.debug('TRYING TO RENDER')

    gv.layout(graph, 'dot')

    tree = get_applies_tree(xsl)

    draw_tree(tree, graph, [])
    gv.layout(graph, 'dot')

    data = gv.renderdata(graph, 'svg')

    logging.debug('RENDERED!!!')

    return data
Esempio n. 3
0
#
#        if template.name is not None:
#            name_templates[template.name].append(template)
#
#
#    links = []
#
#    for name, templates in called_templates.iteritems():
#        if len(name_templates[name]) > 1:
#            sorted_templates = sorted(name_templates[name],
#                                      reverse=True,
#                                      cmp=lambda x,y: compare_import_priorities(x.i_priority, y.i_priority))
#            links.append((sorted_templates[0], templates))
#
#    print links

    from pyproc import analyze
    from lxml import etree

    stylesheet = Stylesheet(xsl)

    a = get_applies_tree(xsl)
    print a
    s


    with open('test.svg', 'w') as f:
        f.write(get_applies_tree(xsl))

#    print etree.tostring(analyze.get_full_xml(xsl), pretty_print=True)
Esempio n. 4
0
    #                called_templates[template_name].append(item)
    #
    #        if template.name is not None:
    #            name_templates[template.name].append(template)
    #
    #
    #    links = []
    #
    #    for name, templates in called_templates.iteritems():
    #        if len(name_templates[name]) > 1:
    #            sorted_templates = sorted(name_templates[name],
    #                                      reverse=True,
    #                                      cmp=lambda x,y: compare_import_priorities(x.i_priority, y.i_priority))
    #            links.append((sorted_templates[0], templates))
    #
    #    print links

    from pyproc import analyze
    from lxml import etree

    stylesheet = Stylesheet(xsl)

    a = get_applies_tree(xsl)
    print a
    s

    with open("test.svg", "w") as f:
        f.write(get_applies_tree(xsl))

#    print etree.tostring(analyze.get_full_xml(xsl), pretty_print=True)