add test
This commit is contained in:
parent
daefcad215
commit
ebc98aa850
1 changed files with 18 additions and 14 deletions
24
test.py
24
test.py
|
@ -1,4 +1,6 @@
|
|||
import json
|
||||
|
||||
import alive_progress
|
||||
import requests
|
||||
|
||||
from variants import Variant
|
||||
|
@ -7,7 +9,7 @@ from site_api import *
|
|||
from download_data import download_games, detailed_export_game
|
||||
from check_game import check_game
|
||||
from compress import link
|
||||
from database.database import conn
|
||||
from database.database import conn, cur
|
||||
|
||||
from database.init_database import init_database_tables, populate_static_tables
|
||||
|
||||
|
@ -40,16 +42,18 @@ def check_missing_ids():
|
|||
conn.commit()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
var_id = 964490
|
||||
check_missing_ids()
|
||||
exit(0)
|
||||
def export_all_seeds():
|
||||
cur.execute(
|
||||
"SELECT id FROM variants ORDER BY ID"
|
||||
)
|
||||
var_ids = cur.fetchall()
|
||||
for var in var_ids:
|
||||
download_games(*var)
|
||||
|
||||
# detailed_export_game(var_id)
|
||||
# turn, state = check_game(var_id)
|
||||
# if turn != 0:
|
||||
# print("https://hanab.live/replay/{}".format(var_id))
|
||||
# print(turn, link(state))
|
||||
|
||||
if __name__ == "__main__":
|
||||
var_id = 964532
|
||||
# export_all_seeds()
|
||||
|
||||
# init_database_tables()
|
||||
# populate_static_tables()
|
||||
|
|
Loading…
Reference in a new issue