You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
stacosys/app/core/templater.py

17 lines
425 B
Python

6 years ago
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from jinja2 import Environment
from jinja2 import FileSystemLoader
from conf import config
current_path = os.path.dirname(__file__)
template_path = os.path.abspath(os.path.join(current_path, "../templates"))
env = Environment(loader=FileSystemLoader(template_path))
def get_template(name):
return env.get_template(config.general["lang"] + "/" + name + ".tpl")