小修改

This commit is contained in:
MarkusJoe
2022-04-07 21:53:56 +08:00
parent 12560f58d0
commit c298974f5c
4 files changed
+22 -14

No files matched your search

+12 -11
View File
@@ -14,19 +14,20 @@ from ..decorators import time_it
@time_it
def download():
res = requests.get('https://markusjoe.github.io/static_file_hosting/data.sqlite')
res = requests.get('https://filebase.vercel.app/download/data.db')
with open('./app/db/data.sqlite', 'wb') as fp:
fp.write(res.content)
if __name__ != '__main__':
if not os.path.exists('./app/db/data.sqlite'):
print('数据库文件未找到, 正在下载中')
try:
download()
except Exception as error:
print('下载失败, 错误原因:', error)
print('请手动下载数据库文件到 ./app/db/data.sqlite')
sys.exit(1)
if not os.path.exists('./app/db/data.sqlite'):
print('C: 数据库文件未找到, 正在下载中')
try:
download()
except Exception as error:
print('C: 下载失败, 错误原因:', error)
print('I: 请手动下载数据库文件到 ./app/db/data.sqlite')
sys.exit(1)
__all__ = ['db']
__all__ = [
'db'
]
+4
View File
@@ -7,3 +7,7 @@
print('Tests models were loaded.')
__all__ = [
]
+3
View File
@@ -5,3 +5,6 @@
# @Create Time: 2022/3/25
# @File Name: __init__.py.py
__all__ = [
'view'
]