##// END OF EJS Templates
Expand user home path in template search path....
Matthias BUSSONNIER -
Show More
@@ -142,13 +142,17 b' class NotebookWebApplication(web.Application):'
142 # make the patterns unicode, and ultimately result in unicode
142 # make the patterns unicode, and ultimately result in unicode
143 # keys in kwargs to handler._execute(**kwargs) in tornado.
143 # keys in kwargs to handler._execute(**kwargs) in tornado.
144 # This enforces that base_url be ascii in that situation.
144 # This enforces that base_url be ascii in that situation.
145 #
145 #
146 # Note that the URLs these patterns check against are escaped,
146 # Note that the URLs these patterns check against are escaped,
147 # and thus guaranteed to be ASCII: 'héllo' is really 'h%C3%A9llo'.
147 # and thus guaranteed to be ASCII: 'héllo' is really 'h%C3%A9llo'.
148 base_url = py3compat.unicode_to_str(base_url, 'ascii')
148 base_url = py3compat.unicode_to_str(base_url, 'ascii')
149 template_path = settings_overrides.get("template_path", os.path.join(os.path.dirname(__file__), "templates"))
149 _template_path = settings_overrides.get("template_path", os.path.join(os.path.dirname(__file__), "templates"))
150 if isinstance(_template_path, str):
151 _template_path = (_template_path,)
152 template_path = [os.path.expanduser(path) for path in _template_path]
153
150 jenv_opt = jinja_env_options if jinja_env_options else {}
154 jenv_opt = jinja_env_options if jinja_env_options else {}
151 env = Environment(loader=FileSystemLoader(template_path),**jenv_opt )
155 env = Environment(loader=FileSystemLoader(template_path), **jenv_opt)
152 settings = dict(
156 settings = dict(
153 # basics
157 # basics
154 log_function=log_request,
158 log_function=log_request,
General Comments 0
You need to be logged in to leave comments. Login now