From: Christian Heller <c.heller@plomlompom.de>
Date: Mon, 6 Jan 2025 16:49:07 +0000 (+0100)
Subject: Minor code refactoring, and fix default DB path back from debugging assumption.
X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/conditions?a=commitdiff_plain;h=f47d393635ea05e43de1c202b88bbee20574d073;p=ytplom

Minor code refactoring, and fix default DB path back from debugging assumption.
---

diff --git a/src/ytplom/db.py b/src/ytplom/db.py
index d96a7ab..b330d7e 100644
--- a/src/ytplom/db.py
+++ b/src/ytplom/db.py
@@ -14,7 +14,7 @@ from ytplom.primitives import (
 
 
 EXPECTED_DB_VERSION = 6
-PATH_DB = PATH_APP_DATA.joinpath('TESTdb.sql')
+PATH_DB = PATH_APP_DATA.joinpath('db.sql')
 
 SqlText = NewType('SqlText', str)
 
@@ -110,8 +110,7 @@ class DbFile:
                 row_normed[-2:] = [indent + row_normed[-1][:-1]] + [')']
             schema_rows_normed += ['\n'.join(row_normed)]
         retrieved_schema = ';\n'.join(schema_rows_normed) + ';'
-        with open(_PATH_DB_SCHEMA, 'r', encoding='utf-8') as f:
-            stored_schema = f.read().rstrip()
+        stored_schema = _PATH_DB_SCHEMA.read_text(encoding='utf-8').rstrip()
         if stored_schema != retrieved_schema:
             diff_msg = Differ().compare(retrieved_schema.splitlines(),
                                         stored_schema.splitlines())