Skip to content

Commit

Permalink
Merge pull request #195 from pistachiostudio/files
Browse files Browse the repository at this point in the history
Files
  • Loading branch information
quojama authored Jul 23, 2023
2 parents 76fbc1e + 960a12c commit 45b88e9
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 129 deletions.
22 changes: 0 additions & 22 deletions db_insert_data.py

This file was deleted.

107 changes: 0 additions & 107 deletions flow.md

This file was deleted.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ dev-dependencies = [
[tool.rye.scripts]
check = "pre-commit run --all-files"
tox = "tox"
add = "python scripts/db_insert_data.py"
delete = "python scripts/db_delete_data.py"

[tool.hatch.metadata]
allow-direct-references = true
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions scripts/db_delete_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import sqlite3

puuid_input = input("削除するPUUIDを入力してください。")

conn = sqlite3.connect("data/takohachi.db")

cur = conn.cursor()

cur.execute(
"""
DELETE FROM val_puuids
WHERE puuid = ?
""",
(puuid_input,),
)

conn.commit()
conn.close()

print("done!")
26 changes: 26 additions & 0 deletions scripts/db_insert_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sqlite3

puuid_input = input("タスクに追加するPUUIDを入力してください。")

try:
elo_input = int(input("現在のELOを入力してください。"))
except ValueError:
print("ELOは整数でなければなりません。")
exit(1)

conn = sqlite3.connect("data/takohachi.db")

cur = conn.cursor()

cur.execute(
"""
INSERT INTO val_puuids (puuid, region, name, tag, yesterday_elo)
VALUES (?, ?, ?, ?, ?)
""",
(puuid_input, "ap", "xxxxx", "xxxxx", elo_input),
)

conn.commit()
conn.close()

print("done!")

0 comments on commit 45b88e9

Please sign in to comment.