Skip to content

Commit ec9a09d

Browse files
committed
Added feature to show/hide cmd when running scripts.
1 parent 63c8fab commit ec9a09d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

DatabaseHandlerAPI.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ def create_table(name: str):
1818
script_path text,
1919
venv text,
2020
venv_path text,
21+
cmd text,
2122
thumbnail_path text)""")
2223

2324
conn.commit()
2425
conn.close()
2526

26-
def add_script(table: str, script_name: str, script_path: str, thumbnail_path="icons/default_thumbnail.jpg", venv=str, venv_path=""):
27+
def add_script(table: str, script_name: str, script_path: str, thumbnail_path="icons/default_thumbnail.jpg", venv=str, venv_path="", cmd=""):
2728
conn = sqlite3.connect("_temp_.db")
2829
c = conn.cursor()
2930

30-
c.execute(f"""INSERT INTO \"{table}\" (script_name, script_path, venv, venv_path, thumbnail_path)
31-
VALUES (?, ?, ?, ?, ?)""", (script_name, script_path, venv, venv_path, thumbnail_path))
31+
c.execute(f"""INSERT INTO \"{table}\" (script_name, script_path, venv, venv_path, thumbnail_path, cmd)
32+
VALUES (?, ?, ?, ?, ?, ?)""", (script_name, script_path, venv, venv_path, thumbnail_path, cmd))
3233

3334
conn.commit()
3435
conn.close()
@@ -55,7 +56,7 @@ def read_to_run_script(table: str, script_name: str):
5556
conn = sqlite3.connect("_temp_.db")
5657
c = conn.cursor()
5758

58-
c.execute(f"SELECT script_path, venv, venv_path FROM \"{table}\" WHERE script_name=\"{script_name}\"")
59+
c.execute(f"SELECT script_path, venv, venv_path, cmd FROM \"{table}\" WHERE script_name=\"{script_name}\"")
5960
script_info = c.fetchone()
6061

6162
conn.commit()
@@ -67,7 +68,7 @@ def read_to_run_all_scripts(table: str):
6768
conn = sqlite3.connect("_temp_.db")
6869
c = conn.cursor()
6970

70-
c.execute(f"SELECT script_path, venv, venv_path FROM \"{table}\"")
71+
c.execute(f"SELECT script_path, venv, venv_path, cmd FROM \"{table}\"")
7172
script_info = c.fetchall()
7273

7374
conn.commit()

0 commit comments

Comments
 (0)