File 0004-Updated-clustered-mode-to-match-new-summary-logic.patch of Package flac2all

From 7c3354292b00ea753581676b2dcec44e0fa54e14 Mon Sep 17 00:00:00 2001
From: zv <info@ziva-vatra.com>
Date: Thu, 27 Feb 2020 16:07:00 +0000
Subject: [PATCH 4/5] Updated clustered mode to match new summary logic

---
 flac2all_pkg/__init__.py | 31 ++++++++++++++-----------------
 flac2all_pkg/core.py     |  3 +--
 2 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/flac2all_pkg/__init__.py b/flac2all_pkg/__init__.py
index 5ff8bfc..9b44622 100755
--- a/flac2all_pkg/__init__.py
+++ b/flac2all_pkg/__init__.py
@@ -36,23 +36,20 @@ import multiprocessing as mp
 
 if __name__ == '__main__' and __package__ is None:
     from os import path
-    sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) 
+    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
 
 try:
-	from shell import shell
-	from config import opts
-	from core import modetable, generate_summary, write_logfile
-	from multiprocess_encode import encode as threaded_encode
-	from logging import console, cconsole
+    from shell import shell
+    from config import opts
+    from core import modetable, write_logfile
+    from multiprocess_encode import encode as threaded_encode
+    from logging import console, cconsole
 except ImportError:
-	from .shell import shell
-	from .config import opts
-	from .core import modetable, generate_summary, write_logfile
-	from .multiprocess_encode import encode as threaded_encode
-	from .logging import console, cconsole
-
-
-
+    from .shell import shell
+    from .config import opts
+    from .core import modetable, write_logfile
+    from .multiprocess_encode import encode as threaded_encode
+    from .logging import console, cconsole
 
 terminate = False
 
@@ -154,7 +151,7 @@ def clustered_encode():
 
     incount = len(inlist)
     log.info("We have %d tasks" % incount)
-    start_time = time.time()
+    # start_time = time.time()
     workers = {}
     log.info("Waiting for at least one worker to join")
     results = []
@@ -269,7 +266,7 @@ def clustered_encode():
             log.crit("UNKNOWN RESULT!")
             log.crit(results)
 
-    end_time = time.time()
+    # end_time = time.time()
     rsock.close()
     csock.close()
     rsock.close()
@@ -280,7 +277,7 @@ def clustered_encode():
         log.crit("Error. Not all tasks were completed.")
         sys.exit(1)
     # log.print(list(set([x[0] for x in inlist]) - set([x[0] for x in results])))
-    results = generate_summary(start_time, end_time, incount, results)
+    # generate_summary(start_time, end_time, incount, results)
     write_logfile(opts['outdir'], results)
 
 
diff --git a/flac2all_pkg/core.py b/flac2all_pkg/core.py
index 5ea205b..881cda1 100755
--- a/flac2all_pkg/core.py
+++ b/flac2all_pkg/core.py
@@ -81,9 +81,8 @@ def print_summary(count, total, successes, failures, modes, percentage_fail, tot
     percentage_execution_rate = float(percentage_execution_rate)
 
     out = "\n\n"
-    out += ("=" * 80)
     out += "| Summary "
-    out += ("-" * 80)
+    out += ("=" * (80 - len(out)))
     out += """
 Total files on input: %d
 Total files actually processed: %d
-- 
2.25.1

openSUSE Build Service is sponsored by