def readHtmlTemplate(self,templateFilename="t-time.html"):
"""read entire HTML template and optionally insert CSS
arguments:
templateFilename -- optional, if template is different than t-time.html
"""
template=""
try:
with open(templateFilename,"r",encoding="utf-8") as templatefile:
for line in templatefile:
template+=line
except (FileNotFoundError,BaseException) as ex:
handleException(ex,
"File "+ex.filename+" does not exist. This is the HTML template to export the data.",
"There was a problem opening "+ex.filename+". This is the HTML template to export the data.")
if self.css is not None:
template=template.replace('<link rel="stylesheet" href="t-time.css" />',self.css,1)
self.template=Template(template)
评论列表
文章目录