From f47d393635ea05e43de1c202b88bbee20574d073 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 6 Jan 2025 17:49:07 +0100 Subject: [PATCH] Minor code refactoring, and fix default DB path back from debugging assumption. --- src/ytplom/db.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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()) -- 2.30.2