refactor: Move maintenance scripts to a dedicated maintenance_scripts/ directory.

This commit is contained in:
kiyreload27
2026-01-05 22:58:22 +00:00
parent 9cbfb29477
commit 40047ee145
19 changed files with 8 additions and 8 deletions

View File

@@ -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):

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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: