BlendMMM commited on
Commit
8102fd2
·
verified ·
1 Parent(s): 9d7d519

Upload Home.py

Browse files
Files changed (1) hide show
  1. Home.py +7 -2
Home.py CHANGED
@@ -516,7 +516,7 @@ def reset_project_text_box():
516
  def query_excecuter_sqlite(
517
  insert_projects_query,
518
  insert_meta_data_query,
519
- db_path=r"db\imp_db.db",
520
  params_projects=None,
521
  params_meta=None,
522
  ):
@@ -534,8 +534,13 @@ def query_excecuter_sqlite(
534
  bool: True if successful, False otherwise.
535
  """
536
  try:
 
 
 
 
 
537
  # Establish connection to the SQLite database
538
- conn = sqlite3.connect(r"db\imp_db.db")
539
  cursor = conn.cursor()
540
 
541
  # Execute the first insert query into the mmo_projects table
 
516
  def query_excecuter_sqlite(
517
  insert_projects_query,
518
  insert_meta_data_query,
519
+ db_path=None,
520
  params_projects=None,
521
  params_meta=None,
522
  ):
 
534
  bool: True if successful, False otherwise.
535
  """
536
  try:
537
+ # Construct a cross-platform path to the database
538
+ db_dir = os.path.join("db")
539
+ os.makedirs(db_dir, exist_ok=True) # Make sure the directory exists
540
+ db_path = os.path.join(db_dir, "imp_db.db")
541
+
542
  # Establish connection to the SQLite database
543
+ conn = sqlite3.connect(db_path)
544
  cursor = conn.cursor()
545
 
546
  # Execute the first insert query into the mmo_projects table