From ff3fd79dae93f16215d4397c8c21a1af0cbdade5 Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Fri, 25 Feb 2022 18:29:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/utils/view.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/utils/view.py b/bin/utils/view.py index ba7e004..58b1b39 100644 --- a/bin/utils/view.py +++ b/bin/utils/view.py @@ -7,7 +7,7 @@ from flask import render_template -from bin.db.sqlite import Database +from bin.db.db import SQLite def view_template(style: str, length: int, name: str, count: str) -> str or tuple[bool, str]: @@ -19,9 +19,9 @@ def view_template(style: str, length: int, name: str, count: str) -> str or tupl :param style: :return: """ - if style not in Database().fetch_table(): + if style not in SQLite().fetch_table(): # 选择的主题不在数据库内 return [False, 'BadLength'] - origin_data = Database().fetch_style_data(style) # 获取数据库内的文件 + origin_data = SQLite().fetch_style_data(style) # 获取数据库内的数据 context = [] if count != '0000000000': for i in count: # 通过elif语句依次判断数字 @@ -67,10 +67,10 @@ def view_template(style: str, length: int, name: str, count: str) -> str or tupl 'height': origin_data[9]['height']}) for p, i in zip(context, range(0, length)): - p['position'] = i * p['width'] + p['position'] = i * p['width'] # 设置每张图片对应的位置 - general_width = origin_data[0]['width'] * length - general_height = origin_data[0]['height'] + general_width = origin_data[0]['width'] * length # 计算出图片总长度 + general_height = origin_data[0]['height'] # 总宽度 return True, render_template('view.html', context=context,