Archived
update: 修改了下载数据库的方式
This commit is contained in:
2 files changed
+5
-56
No files matched your search
+5
-2
@@ -7,16 +7,19 @@
|
||||
|
||||
|
||||
import os
|
||||
from urllib.request import urlretrieve
|
||||
from src.config import Config
|
||||
|
||||
database = Config.database
|
||||
|
||||
if database == 'sqlite':
|
||||
import sqlite3 as operator
|
||||
from src.utils.t_download import download
|
||||
|
||||
if not os.path.exists('./src/db/data.sqlite'):
|
||||
download('https://static.rtast.cn/data.sqlite')
|
||||
print('Downloading database file. Please wait...')
|
||||
file_url = 'https://static.rtast.cn/data.sqlite'
|
||||
urlretrieve(file_url, './src/db/data.sqlite')
|
||||
print('Download database file successfully.')
|
||||
from src.db.db import SQLite as Database
|
||||
elif 'redis' in database:
|
||||
import redis as operator
|
||||
|
||||
Reference in New Issue
Block a user