From 975c584adc154735ff7bb68272b612500cbf57de Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 26 Apr 2021 16:53:39 +0200 Subject: [PATCH] Flush debug output. Don't VACUUM database every time. --- MosDb.py | 3 ++- analyse.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/MosDb.py b/MosDb.py index 6c09498..1607742 100644 --- a/MosDb.py +++ b/MosDb.py @@ -17,7 +17,8 @@ class MosDb(): def finish(self): if self.changes_made: - self.c.execute("VACUUM") + pass + #self.c.execute("VACUUM") self.conn.commit() self.conn.close() diff --git a/analyse.py b/analyse.py index 59f9a7b..1a95fc8 100755 --- a/analyse.py +++ b/analyse.py @@ -45,7 +45,7 @@ for f in todo: objFile = objPath.replace(CLIP_PATH_TRANSFORM_FROM, CLIP_PATH_TRANSFORM_TO).replace("\\", "/") if not os.path.isfile(objFile): - print("ERROR: File not found: {}".format(objFile), file=sys.stderr) + print("ERROR: File not found: {}".format(objFile), file=sys.stderr, flush=True) continue cmd = [LOUDNESS_SCANNER, "scan", "-l", objFile] @@ -62,7 +62,7 @@ for f in todo: continue lufs = m.group(1) lra = m.group(2) - print("Found LUFS for {}: {} (LRA: {} LU)".format(objId, lufs, lra), end="") + print("Found LUFS for {}: {} (LRA: {} LU)".format(objId, lufs, lra), end="", flush=True) if lufs == "-inf": lufs = -99.0 lra = 0.0 @@ -72,13 +72,13 @@ for f in todo: lufs = float(lufs) + 3.0 lra = float(lra) ldiff = lufs - TARGET_LUFS - print(", diff to {}: {}".format(TARGET_LUFS, ldiff)) + print(", diff to {}: {}".format(TARGET_LUFS, ldiff), flush=True) db.set_lufs(objId, lufs, lra, ldiff) have_lufs = True break if not have_lufs: - print("ERROR analysing file for {}: {}".format(objId, objFile)) + print("ERROR analysing file for {}: {}".format(objId, objFile), flush=True) db.finish()