This commit is contained in:
yumoqing 2021-02-18 18:46:05 +08:00
parent e99823714a
commit 03dc50d01b

View File

@ -4,7 +4,7 @@ try:
import ujson as json
except:
import json
from jinja2 import Environment,FileSystemLoader
from jinja2 import Environment,FileSystemLoader, BaseLoader
import codecs
from appPublic.argsConvert import ArgsConvert
from appPublic.dictObject import DictObject
@ -12,6 +12,10 @@ def isNone(obj):
return obj is None
def string_template_render(tmp_string, data):
rtemplate = Environment(loader=BaseLoader()).from_string(myString)
return rtemplate.render(**data)
class MyTemplateEngine:
def __init__(self,pathList,file_coding='utf-8',out_coding='utf-8'):
self.file_coding = file_coding