xconv: Better task naming

master
Taeyeon Mori 7 years ago
parent d076fe8410
commit 27221f2bf5
  1. 2
      lib/python/xconv/__init__.py
  2. 20
      lib/python/xconv/app.py

@ -23,4 +23,4 @@ xconv ffmpeg wrapper based on AdvancedAV
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
version_info = 0, 3, 0
version_info = 0, 3, 1

@ -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()

Loading…
Cancel
Save