<%page args="module"/> <%namespace name="lib" file="//lib.html" import="*"/> <% from mako import exceptions from splunk.appserver.mrsparkle.lib.i18n import path_to_i18n_paths import logging logger = logging.getLogger("splunk.appserver.modules.static.ServerSideInclude") error_header = _("ServerSideInclude Module Error!") src = "/APP/%s/appserver/static/%s" % (APP["id"], module["src"]) output = None # allow for i18n specific static includes to override the default # eg. a request for index.html may check for index-en_GB.html and index-en.html before # falling back to index.html for i18nsrc in path_to_i18n_paths(src): try: output = capture(self.include_file, i18nsrc) break except exceptions.TemplateLookupException, e: continue except: traceback = exceptions.RichTraceback() logger.error("Fatal template error. %s" % traceback.error) output = lib.template.get_def('traceback').render(header=error_header) if output is None: logger.error("Invalid template path. %s" % e) output = '

## %s

%s
' % (error_header, e) %> ${output}