feat: fix bug

This commit is contained in:
MarkusJoe
2022-02-05 16:45:35 +08:00
parent 74db8ed1ac
commit 9860df7375
9 files changed
+208 -81

No files matched your search

+71
View File
@@ -0,0 +1,71 @@
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/2/5
# @File Name: render_.py
from flask import render_template
def render_temp_(length: int, name: str, image_list: list) -> str:
"""
代码很烂写到隐蔽的地方就看不见了
:param length:
:param name:
:param image_list:
:return:
"""
# 自己写的都看不下去了
if length == 7:
return render_template('index.html',
title=name,
svg_img_0=f'{image_list[0]}',
svg_img_1=f'{image_list[1]}',
svg_img_2=f'{image_list[2]}',
svg_img_3=f'{image_list[3]}',
svg_img_4=f'{image_list[4]}',
svg_img_5=f'{image_list[5]}',
svg_img_6=f'{image_list[6]}'
)
elif length == 8:
return render_template('index.html',
title=name,
svg_img_0=f'{image_list[0]}',
svg_img_1=f'{image_list[1]}',
svg_img_2=f'{image_list[2]}',
svg_img_3=f'{image_list[3]}',
svg_img_4=f'{image_list[4]}',
svg_img_5=f'{image_list[5]}',
svg_img_6=f'{image_list[6]}',
svg_img_7=f'{image_list[7]}'
)
elif length == 9:
return render_template('index.html',
title=name,
svg_img_0=f'{image_list[0]}',
svg_img_1=f'{image_list[1]}',
svg_img_2=f'{image_list[2]}',
svg_img_3=f'{image_list[3]}',
svg_img_4=f'{image_list[4]}',
svg_img_5=f'{image_list[5]}',
svg_img_6=f'{image_list[6]}',
svg_img_7=f'{image_list[7]}',
svg_img_8=f'{image_list[8]}',
)
else:
return render_template('index.html',
title=name,
svg_img_0=f'{image_list[0]}',
svg_img_1=f'{image_list[1]}',
svg_img_2=f'{image_list[2]}',
svg_img_3=f'{image_list[3]}',
svg_img_4=f'{image_list[4]}',
svg_img_5=f'{image_list[5]}',
svg_img_6=f'{image_list[6]}',
svg_img_7=f'{image_list[7]}',
svg_img_8=f'{image_list[8]}',
svg_img_9=f'{image_list[9]}'
)