Archived
小修改
This commit is contained in:
4 files changed
+22
-14
No files matched your search
+12
-11
@@ -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'
|
||||
]
|
||||
Reference in New Issue
Block a user