From c6e2f05e5b1509d0d262fcee56a348db520c02f4 Mon Sep 17 00:00:00 2001 From: Karl Kroening Date: Thu, 6 Jul 2017 03:42:03 -0600 Subject: [PATCH] #17: add `short_repr` for input and output nodes --- ffmpeg/nodes.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ffmpeg/nodes.py b/ffmpeg/nodes.py index 17b4bc9..c2b525e 100644 --- a/ffmpeg/nodes.py +++ b/ffmpeg/nodes.py @@ -1,8 +1,9 @@ from __future__ import unicode_literals -from builtins import object from .dag import KwargReprNode from ._utils import get_hash_int +from builtins import object +import os def _is_of_types(obj, types): @@ -115,6 +116,10 @@ class InputNode(Node): kwargs=kwargs ) + @property + def short_repr(self): + return os.path.basename(self.kwargs['filename']) + class FilterNode(Node): def __init__(self, stream_spec, name, max_inputs=1, args=[], kwargs={}): @@ -152,6 +157,10 @@ class OutputNode(Node): kwargs=kwargs ) + @property + def short_repr(self): + return os.path.basename(self.kwargs['filename']) + class OutputStream(Stream): def __init__(self, upstream_node, upstream_label):