Ticket #11261: plot.py.patch

File plot.py.patch, 733 bytes (added by AlexanderDreyer, 8 years ago)

Backport from 0.8: polybori.plot uses jinja2, where available

  • pyroot/polybori/plot.py

    # HG changeset patch
    # User Alexander Dreyer <adreyer@gmx.de>
    # Date 1308310931 -7200
    # Node ID c7ef133412d45b4a4675cffcd4e628e066f74b68
    # Parent  6ecb8b6558ca6c9d06f19303f89d5fd18ce1703d
    FIX: use jinja2 if available
    
    diff -r 6ecb8b6558ca -r c7ef133412d4 pyroot/polybori/plot.py
    a b  
    6868    return str(stream)
    6969
    7070def render_jinja(data_dict):
    71     from jinja import Environment
     71    try:
     72        from jinja2 import Environment
     73    except:
     74        from jinja import Environment       
    7275    env = Environment()
    7376    tmpl = env.from_string(graph_template_jinja)
    7477    return tmpl.render(**data_dict)