def write_second_page(self, summarys, suggestions, sign): self.html_obj.write(html_second_page) self.html_obj.write( Template(html_second_page_xj).render(summarys=summarys)) self.html_obj.write( Template(html_second_page_jy).render(suggestions=suggestions)) self.html_obj.write(Template2(html_second_page_sign).render(sign=sign))
def __init__(self,filename,file_css,is_single=True): ''' :param filename: HTML文件名称 :param file_css: 样式表 :param is_single: 是否单独写入head HTML文件 ''' # 如果已存在,则删除 if os.path.exists(filename): try: os.remove(filename) except Exception as e: print(e) self.html_obj = open(filename, 'a', encoding="utf8") if is_single: self.html_obj.write(Template2(pdf_html_head).render(file_css=file_css))
def write_health_care(self, health): self.html_obj.write( Template2(pdf_html_health_page).render(health=health))
def write_equip(self, equips): self.html_obj.write( Template2(pdf_html_equip_page).render(equips=equips))
def write_items(self, items): from app_reportserver.report_items import write_item_test # write_item_test(items) self.html_obj.write(Template2(pdf_html_item_page).render(items=items))
def write_cachet(self, cachet): self.html_obj.write( Template2(pdf_html_cachet_page).render(cachet=cachet))
def write_yspb(self, pbxx: list): self.html_obj.write(Template2(pdf_html_yspb_page).render(pbxx=pbxx))
def write_home(self, user): self.html_obj.write(Template2(pdf_html_home_page2).render(user=user))
def write_home_html(filename, user: dict): # 如果已存在,则删除 if os.path.exists(filename): os.remove(filename) html_obj = open(filename, 'a', encoding="utf8") html_obj.write(Template2(pdf_html_home_page).render(user=user))
def write_cachet(self,cachet): if cachet['syys']: self.html_obj.write(Template2(pdf_html_cachet_page2).render(cachet=cachet)) else: self.html_obj.write(Template2(pdf_html_cachet_page).render(cachet=cachet))
def write_health_care(self, healths): self.html_obj.write( Template2(html_tj_health_care).render(healths=healths))
def write_equip_result(self, equips): self.html_obj.write(Template2(html_tj_equip).render(equips=equips))
def write_item_result(self, items): self.html_obj.write(Template2(html_tj_xmjg).render(items=items))