refactor: Move maintenance scripts to a dedicated maintenance_scripts/ directory.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sqlite3
|
||||
import os
|
||||
|
||||
DB_PATH = os.path.join("database", "umamusume.db")
|
||||
DB_PATH = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "database", "umamusume.db")
|
||||
|
||||
def check_schema():
|
||||
if not os.path.exists(DB_PATH):
|
||||
@@ -2,7 +2,7 @@ import sqlite3
|
||||
import os
|
||||
|
||||
def debug_db():
|
||||
db_path = "database/umamusume.db"
|
||||
db_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "database", "umamusume.db")
|
||||
if not os.path.exists(db_path):
|
||||
print(f"Database not found at {db_path}")
|
||||
return
|
||||
@@ -3,7 +3,7 @@ import sys
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
# Add parent dir to path
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
def debug_kitasan_scrape():
|
||||
url = "https://gametora.com/umamusume/supports/30028-kitasan-black"
|
||||
@@ -3,7 +3,7 @@ import os
|
||||
import sys
|
||||
|
||||
# Ensure we can import from the project
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from scraper.gametora_scraper import scrape_support_card, sync_playwright
|
||||
from db.db_queries import DB_PATH, repair_orphaned_data, cleanup_orphaned_data
|
||||
@@ -3,7 +3,7 @@ import os
|
||||
import sys
|
||||
|
||||
# Add parent dir to path
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from scraper.gametora_scraper import scrape_support_card, sync_playwright
|
||||
|
||||
@@ -3,7 +3,7 @@ import os
|
||||
import sys
|
||||
|
||||
# Add parent dir to path
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from scraper.gametora_scraper import scrape_support_card, sync_playwright
|
||||
|
||||
@@ -3,7 +3,7 @@ import os
|
||||
import sys
|
||||
|
||||
# Add parent dir to path
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from scraper.gametora_scraper import scrape_support_card, sync_playwright
|
||||
from db.db_queries import get_conn
|
||||
@@ -5,7 +5,7 @@ from playwright.sync_api import sync_playwright
|
||||
import sys
|
||||
|
||||
# Add project root to path
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
def test_scrape_events(url):
|
||||
with sync_playwright() as p:
|
||||
Reference in New Issue
Block a user