为代码添加了注释

This commit is contained in:
MarkusJoe
2022-02-11 17:58:55 +08:00
parent a0f681048c
commit 9182597559
7 files changed
+32 -15

No files matched your search

+2 -2
View File
@@ -36,7 +36,7 @@ def re_sort_number_image(origin_number: str, theme: str) -> tuple[bool, bool, bo
final_b64_img_code = []
if origin_number != '0000000000':
for i in origin_number:
for i in origin_number: # 通过elif语句依次判断数字
if i == '0':
final_b64_img_code.append(b_64_list[0])
elif i == '1':
@@ -61,7 +61,7 @@ def re_sort_number_image(origin_number: str, theme: str) -> tuple[bool, bool, bo
return [True, final_b64_img_code, width_list[0], height_list[0]]
else:
for i in range(10):
final_b64_img_code.append(b_64_list[0])
final_b64_img_code.append(b_64_list[0]) # 直接将0返回
return [True, final_b64_img_code, width_list[0], height_list[0]]
+1
View File
@@ -13,6 +13,7 @@ from db.db import (update_data, fetch_table)
class ErrorProcess:
"""处理错误的页面"""
def __init__(self):
self.msg_template = {'code': -2,
'msg': '',
+1 -1
View File
@@ -24,7 +24,7 @@ def render_temp_(length: int, name: str, image_list: list, width: int, height: i
position_list.append(i * width)
file_name = f'index{length}.html'
# 自己写的都看不下去了
# 下面的代码超级烂
if length == 7:
return render_template(file_name,
title=name,