feat: re upload

This commit is contained in:
MarkusJoe
2022-02-05 18:06:16 +08:00
parent b40f6b40e5
commit 49541b7b8c
5 files changed
+39 -13

No files matched your search

+2 -1
View File
@@ -128,9 +128,10 @@ def index():
if __name__ == '__main__': if __name__ == '__main__':
# app.run(threaded=True) # app.run(threaded=True)
print('服务器已在http://127.0.0.1:5000 运行. \n除了请求次数和名称会被保存到本地数据库中其余任何数据都不会被保存') print('服务器已在http://127.0.0.1:5000 运行')
try: try:
server = pywsgi.WSGIServer(('0.0.0.0', 5000), app) server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
server.serve_forever() server.serve_forever()
except OSError: except OSError:
print('5000 端口被占用') print('5000 端口被占用')
+2 -2
View File
@@ -6,7 +6,7 @@
# @File Name: length.py # @File Name: length.py
def make_html(length: int, svg_width: int = 45, svg_height: int = 70) -> None: def make_html(length: int, svg_width: int = 45, svg_height: int = 50) -> None:
""" """
生成html 生成html
:param svg_height: :param svg_height:
@@ -17,7 +17,7 @@ def make_html(length: int, svg_width: int = 45, svg_height: int = 70) -> None:
html_head = """<?xml version="1.0" encoding="UTF-8"?> html_head = """<?xml version="1.0" encoding="UTF-8"?>
<svg width="%(w)s" height="%(h)s" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg width="%(w)s" height="%(h)s" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>{{ title }}</title> <title>Flask Counter - {{ title }}</title>
<g>\n""" <g>\n"""
svg_tag = """ <image x="%(x)s" y="0" width="%(w)s" height="%(h)s" xlink:href="{{ svg_img_%(i)s }}"></image>\n""" svg_tag = """ <image x="%(x)s" y="0" width="%(w)s" height="%(h)s" xlink:href="{{ svg_img_%(i)s }}"></image>\n"""
html_feet = """</g></svg>""" html_feet = """</g></svg>"""
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/2/5
# @File Name: init_db.py
import os
import sqlite3
import sys
if __name__ == '__main__':
while True:
yes_or_no = input('该操作会将数据库初始化输入y继续:')
if yes_or_no == 'y':
os.remove('../../db/data.db')
conn = sqlite3.connect('../../db/data.db')
cursor = conn.cursor()
cursor.execute('create table ReqCount (name text primary key, times integer )')
sys.exit(0)
elif yes_or_no == 'n':
print('已取消')
sys.exit(0)
else:
print('请输入y继续或n退出')
continue
BIN
View File
Binary file not shown.
+9 -10
View File
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="360" height="70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg width="315" height="50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>{{ title }}</title> <title>Flask Counter - {{ title }}</title>
<g> <g>
<image x="0" y="0" width="45" height="70" xlink:href="{{ svg_img_0 }}"></image> <image x="0" y="0" width="45" height="50" xlink:href="{{ svg_img_0 }}"></image>
<image x="45" y="0" width="45" height="70" xlink:href="{{ svg_img_1 }}"></image> <image x="45" y="0" width="45" height="50" xlink:href="{{ svg_img_1 }}"></image>
<image x="90" y="0" width="45" height="70" xlink:href="{{ svg_img_2 }}"></image> <image x="90" y="0" width="45" height="50" xlink:href="{{ svg_img_2 }}"></image>
<image x="135" y="0" width="45" height="70" xlink:href="{{ svg_img_3 }}"></image> <image x="135" y="0" width="45" height="50" xlink:href="{{ svg_img_3 }}"></image>
<image x="180" y="0" width="45" height="70" xlink:href="{{ svg_img_4 }}"></image> <image x="180" y="0" width="45" height="50" xlink:href="{{ svg_img_4 }}"></image>
<image x="225" y="0" width="45" height="70" xlink:href="{{ svg_img_5 }}"></image> <image x="225" y="0" width="45" height="50" xlink:href="{{ svg_img_5 }}"></image>
<image x="270" y="0" width="45" height="70" xlink:href="{{ svg_img_6 }}"></image> <image x="270" y="0" width="45" height="50" xlink:href="{{ svg_img_6 }}"></image>
<image x="315" y="0" width="45" height="70" xlink:href="{{ svg_img_7 }}"></image>
</g></svg> </g></svg>

Before

Width:  |  Height:  |  Size: 878 B

After

Width:  |  Height:  |  Size: 809 B