Add first version of new-strategy generation from template

This commit is contained in:
Matthias
2019-11-01 16:04:44 +01:00
parent 8cf8ab089e
commit e3cf6188a1
4 changed files with 351 additions and 2 deletions

View File

@@ -127,3 +127,16 @@ def round_dict(d, n):
def plural(num, singular: str, plural: str = None) -> str:
return singular if (num == 1 or num == -1) else plural or singular + 's'
def render_template(template: str, arguments: dict):
from jinja2 import Environment, PackageLoader, select_autoescape
env = Environment(
loader=PackageLoader('freqtrade', 'templates'),
autoescape=select_autoescape(['html', 'xml'])
)
template = env.get_template(template)
return template.render(**arguments)