feat: poc database script

This commit is contained in:
Laureηt 2022-03-20 16:54:58 +01:00
parent c39e5cb741
commit c39f1fd0c0
No known key found for this signature in database
GPG key ID: D88C6B294FD40994
2 changed files with 17 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
.venv .venv
.mypy_cache .mypy_cache
data

View file

@ -1,5 +1,21 @@
import sqlite3 import sqlite3
import uuid
from fileinput import filename
DATA_FOLDER = "data/" DATA_FOLDER = "data/"
con = sqlite3.connect("dataset.db") con = sqlite3.connect("dataset.db")
from ppadb.client import Client as AdbClient
client = AdbClient(host="127.0.0.1", port=5037)
device = client.device("13231FDD4003UE")
filename = uuid.uuid1()
result = device.screencap()
with open(f"{DATA_FOLDER}/{filename}.png", "wb") as fp:
fp.write(result)
con.execute(f"INSERT INTO data VALUES ('{filename}',{0},{0},{0.5},{0.5},{0},{0},{0},{0},{0})")
con.commit()
con.close()