8000 Merge remote-tracking branch 'origin/master' into feature/17 · Powercoder64/ffmpeg-python@677967b · GitHub
[go: up one dir, main page]

Skip to content

Commit 677967b

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/17
Conflicts: ffmpeg/_run.py ffmpeg/nodes.py
2 parents 6a9a12e + a986cbe commit 677967b

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

ffmpeg/_ffmpeg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def input(filename, **kwargs):
1616
kwargs['filename'] = filename
1717
fmt = kwargs.pop('f', None)
1818
if fmt:
19-
assert 'format' not in kwargs, "Can't specify both `format` and `f` kwargs"
19+
if 'format' in kwargs:
20+
raise ValueError("Can't specify both `format` and `f` kwargs")
2021
kwargs['format'] = fmt
2122
return InputNode(input.__name__, **kwargs)
2223

@@ -46,7 +47,8 @@ def output(parent_node, filename, **kwargs):
4647
kwargs['filename'] = filename
4748
fmt = kwargs.pop('f', None)
4849
if fmt:
49-
assert 'format' not in kwargs, "Can't specify both `format` and `f` kwargs"
50+
if 'format' in kwargs:
51+
raise ValueError("Can't specify both `format` and `f` kwargs")
5052
kwargs['format'] = fmt
5153
return OutputNode([parent_node], output.__name__, **kwargs)
5254

ffmpeg/_run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _get_input_args(input_node):
4848
args += _convert_kwargs_to_cmd_line_args(kwargs)
4949
args += ['-i', filename]
5050
else:
51-
assert False, 'Unsupported input node: {}'.format(input_node)
51+
raise ValueError('Unsupported input node: {}'.format(input_node))
5252
return args
5353

5454

@@ -69,7 +69,7 @@ def _get_global_args(node):
6969
if node.name == overwrite_output.__name__:
7070
return ['-y']
7171
else:
72-
assert False, 'Unsupported global node: {}'.format(node)
72+
raise ValueError('Unsupported global node: {}'.format(node))
7373

7474

7575
def _get_output_args(node, stream_name_map):
@@ -87,7 +87,7 @@ def _get_output_args(node, stream_name_map):
8787
args += _convert_kwargs_to_cmd_line_args(kwargs)
8888
args += [filename]
8989
else:
90-
assert False, 'Unsupported output node: {}'.format(node)
90+
raise ValueError('Unsupported output node: {}'.format(node))
9191
return args
9292

9393

ffmpeg/dag.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def topo_sort(start_nodes):
162162
sorted_nodes = []
163163
child_map = {}
164164
def visit(node, child):
165-
assert node not in marked_nodes, 'Graph is not a DAG'
165+
if node in marked_nodes:
166+
raise RuntimeError('Graph is not a DAG')
166167
if child is not None:
167168
if node not in child_map:
168169
child_map[node] = []

ffmpeg/nodes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class OutputNode(Node):
4444

4545
class GlobalNode(Node):
4646
def __init__(self, parent, name, *args, **kwargs):
47-
assert isinstance(parent, OutputNode), 'Global nodes can only be attached after output nodes'
47+
if not isinstance(parent, OutputNode):
48+
raise RuntimeError('Global nodes can only be attached after output nodes')
4849
super(GlobalNode, self).__init__([parent], name, *args, **kwargs)
4950

5051

0 commit comments

Comments
 (0)
0