dead-cells-wiki/data/render/31-0/render_all.py

22 lines
628 B
Python
Raw Normal View History

2022-09-28 22:28:58 -05:00
#!/usr/bin/env python3
# # -*- coding: utf-8 -*-
import sys
from playwright.sync_api import sync_playwright
2022-09-30 07:53:40 -05:00
sys.path.append("../../convert/31-0")
2022-09-28 22:28:58 -05:00
from db import *
2022-09-30 07:53:40 -05:00
db.bind(provider="sqlite", filename="../../clean/31-0/data.sqlite3")
2022-09-29 01:29:02 -05:00
db.generate_mapping()
2022-09-28 22:28:58 -05:00
with sync_playwright() as p:
browser = p.chromium.launch()
2022-09-30 06:30:12 -05:00
page = browser.new_page(device_scale_factor=3)
2022-09-28 22:28:58 -05:00
with db_session:
for m in Melee.select():
print(f"rendering {m.name}...")
page.goto(f"http://localhost:8080/{m.name}")
page.locator(".container").screenshot(path=f"./output/{m.name}.png")
browser.close()