Ticket #11106: nb_style_environ_variable.patch

File nb_style_environ_variable.patch, 946 bytes (added by flint, 10 years ago)

sets up new environment variable for location of notebook style files

  • sagenb/notebook/template.py

    # HG changeset patch
    # User Achim Fassbender <fassbend@mathematik.uni-kl.de>
    # Date 1300637397 -3600
    # Node ID 170053c5ac28375f33dbc3152e036d813138a0d1
    # Parent  eaa34d73e6ff6d1fd06449e223c1f7cc0bde3cdc
    Make the location, the html templates and style sheets are loaded from,
    dependent of the value of an environment variable called SAGENB_TEMPLATE_PATH.
    
    diff -r eaa34d73e6ff -r 170053c5ac28 sagenb/notebook/template.py
    a b  
    2424from sagenb.notebook.jsmath import math_parse
    2525
    2626
    27 TEMPLATE_PATH = os.path.join(DATA, 'sage')
     27if os.environ.has_key('SAGENB_TEMPLATE_PATH'):
     28    TEMPLATE_PATH = os.environ['SAGENB_TEMPLATE_PATH']
     29else:
     30    TEMPLATE_PATH = os.path.join(DATA, 'sage')
    2831env = jinja2.Environment(loader=jinja2.FileSystemLoader(TEMPLATE_PATH))
    2932
    3033css_illegal_re = re.compile(r'[^-A-Za-z_0-9]')