summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-01-06 00:22:19 +0100
committeremkael <emkael@tlen.pl>2017-01-06 00:22:19 +0100
commit08b831eed0d2da87dee6ea7c539ad3cdef49fe99 (patch)
tree8be5fc20ee3b52d7f1d3e43e068151fa01b97d00
parent38e82f3942646cc93ad0a2ac3fe588ee0c2bb9af (diff)
Setting up template system, with translations
-rw-r--r--ausbutler/interface.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ausbutler/interface.py b/ausbutler/interface.py
index bbbaeda..4605f73 100644
--- a/ausbutler/interface.py
+++ b/ausbutler/interface.py
@@ -1,8 +1,10 @@
import re
+from jinja2 import Environment, FileSystemLoader
from .butler import cutoff, get_opponents, get_room, normalize
from .db import get_session
from .model import AusButler, Butler
+from .tour_config import Translations
class Interface(object):
@@ -10,6 +12,10 @@ class Interface(object):
def __init__(self, config):
self.session = get_session()
self.config = config
+ self.translation = Translations()
+ self.template = Environment(loader=FileSystemLoader('template'))
+ self.template.filters['translate'] = self.translation.get_translation
+
def calculate_all(self):
self.init_db()