From 27221f2bf5ed113e66c04153aa9088af86e5a7a8 Mon Sep 17 00:00:00 2001 From: Taeyeon Mori Date: Sat, 11 Nov 2017 23:42:54 +0900 Subject: [PATCH] xconv: Better task naming --- lib/python/xconv/__init__.py | 2 +- lib/python/xconv/app.py | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/python/xconv/__init__.py b/lib/python/xconv/__init__.py index 1f151d4..12871b6 100644 --- a/lib/python/xconv/__init__.py +++ b/lib/python/xconv/__init__.py @@ -23,4 +23,4 @@ xconv ffmpeg wrapper based on AdvancedAV along with this program. If not, see . """ -version_info = 0, 3, 0 +version_info = 0, 3, 1 diff --git a/lib/python/xconv/app.py b/lib/python/xconv/app.py index 8a2ec9d..90ba5d0 100644 --- a/lib/python/xconv/app.py +++ b/lib/python/xconv/app.py @@ -104,10 +104,17 @@ def create_task(aav, profile, inputs, args, filename_from=None): def task_name(task): if hasattr(task, "name"): return basename(task.name) - elif task.inputs: - return "<%s" % task.inputs[0].name - elif task.outputs: - return ">%s" % task.outputs[0].name + elif task.inputs or task.outputs: + name = "ffT" + if task.inputs: + name += " <`%s`" % task.inputs[0].name + if len(task.inputs) > 1: + name += "..." + if task.outputs: + name += " >`%s`" % task.outputs[0].name + if len(task.outputs) > 1: + name += "..." + return name else: return "(anon task %p)" % id(task) @@ -204,8 +211,9 @@ def main(argv): # Commit for task in tasks: - task.commit2().then(lambda x: print("\033[32m Finished '%s'\033[0m" % task_name(task)))\ - .catch(lambda e: print("\033[31m Failed '%s': %s\033[0m" % (task_name(task), e))) + name = task_name(task) + task.commit2().then(lambda x: print("\033[32m Finished '%s'\033[0m" % name))\ + .catch(lambda e: print("\033[31m Failed '%s': %s\033[0m" % (name, e))) aav.process_queue() aav.wait()