Archived
更新.gitignore
This commit is contained in:
3 files changed
+17
-15
No files matched your search
+1
-1
@@ -9,7 +9,7 @@ dist/
|
|||||||
*.zip
|
*.zip
|
||||||
*.tar
|
*.tar
|
||||||
*.gz
|
*.gz
|
||||||
*.db
|
*.sqlite
|
||||||
*.log
|
*.log
|
||||||
*.log.*
|
*.log.*
|
||||||
*.sql
|
*.sql
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
# @File Name: __init__.py
|
# @File Name: __init__.py
|
||||||
|
|
||||||
|
|
||||||
import os
|
|
||||||
import requests
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from .main import main
|
from .main import main
|
||||||
|
|
||||||
@@ -48,18 +46,6 @@ def create_app(config_name):
|
|||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
def download():
|
|
||||||
res = requests.get('https://syncdatabase.herokuapp.com/sync/')
|
|
||||||
with open('./app/db/data.db', 'wb') as fp:
|
|
||||||
fp.write(res.content)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
if not os.path.exists('./app/db/data.db'):
|
|
||||||
print('数据库文件未找到, 正在下载中')
|
|
||||||
download()
|
|
||||||
print('下载完成')
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'db',
|
'db',
|
||||||
'main',
|
'main',
|
||||||
|
|||||||
@@ -6,4 +6,20 @@
|
|||||||
# @File Name: __init__.py.py
|
# @File Name: __init__.py.py
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
def download():
|
||||||
|
res = requests.get('https://syncdatabase.herokuapp.com/sync/')
|
||||||
|
with open('./app/db/data.db', 'wb') as fp:
|
||||||
|
fp.write(res.content)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ != '__main__':
|
||||||
|
if not os.path.exists('./app/db/data.db'):
|
||||||
|
print('数据库文件未找到, 正在下载中')
|
||||||
|
download()
|
||||||
|
print('下载完成')
|
||||||
|
|
||||||
__all__ = ['db']
|
__all__ = ['db']
|
||||||
Reference in New Issue
Block a user