From b8d2df4650e5407ca2aa345a4dd9680d03da121c Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 18 Nov 2016 21:42:27 +0100 Subject: [PATCH] Load templates from templates-subdirectory instead of package-root --- tsstats/template.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tsstats/template.py b/tsstats/template.py index da45d95..093e212 100644 --- a/tsstats/template.py +++ b/tsstats/template.py @@ -3,7 +3,7 @@ import logging from codecs import open from datetime import datetime -from os.path import dirname +from os.path import dirname, join from jinja2 import ChoiceLoader, Environment, FileSystemLoader, PackageLoader @@ -57,8 +57,8 @@ def render_template(clients, output, title='TeamspeakStats', # render template_loader = ChoiceLoader([ - PackageLoader(__package__, ''), - FileSystemLoader(dirname(__file__)) + PackageLoader(__package__, 'templates'), + FileSystemLoader(join(dirname(__file__), 'templates')) ]) template_env = Environment(loader=template_loader)