Skip to content

Commit 8a9ecb4

Browse files
author
Christophe Mehay
committed
Test escape coma
1 parent 36df8fe commit 8a9ecb4

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

ffmpeg/nodes.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def __getitem__(self, index):
6767
if self.selector is not None:
6868
raise ValueError('Stream already has a selector: {}'.format(self))
6969
elif not isinstance(index, basestring):
70-
raise TypeError("Expected string index (e.g. 'a'); got {!r}".format(index))
70+
raise TypeError(
71+
"Expected string index (e.g. 'a'); got {!r}".format(index))
7172
return self.node.stream(label=self.label, selector=index)
7273

7374
@property
@@ -235,7 +236,8 @@ def __getitem__(self, item):
235236
class FilterableStream(Stream):
236237
def __init__(self, upstream_node, upstream_label, upstream_selector=None):
237238
super(FilterableStream, self).__init__(
238-
upstream_node, upstream_label, {InputNode, FilterNode}, upstream_selector
239+
upstream_node, upstream_label, {
240+
InputNode, FilterNode}, upstream_selector
239241
)
240242

241243

@@ -284,28 +286,27 @@ def _get_filter(self, outgoing_edges):
284286

285287
out_args = [escape_chars(x, '\\\'=:') for x in args]
286288
out_kwargs = {}
287-
escape_coma = ','
288289
for k, v in list(kwargs.items()):
289290
k = escape_chars(k, '\\\'=:')
290291
if isinstance(v, dict):
291292
v = ','.join(['{}={}'.format(
292293
escape_chars(vk, '\\\'=:'),
293294
escape_chars(v[vk], '\\\'=:')
294295
) for vk in sorted(v)])
295-
escape_coma = ''
296296
else:
297297
v = escape_chars(v, '\\\'=:')
298298
out_kwargs[k] = v
299299

300300
arg_params = [escape_chars(v, '\\\'=:') for v in out_args]
301-
kwarg_params = ['{}={}'.format(k, out_kwargs[k]) for k in sorted(out_kwargs)]
301+
kwarg_params = ['{}={}'.format(k, out_kwargs[k])
302+
for k in sorted(out_kwargs)]
302303
params = arg_params + kwarg_params
303304

304305
params_text = escape_chars(self.name, '\\\'=:')
305306

306307
if params:
307308
params_text += '={}'.format(':'.join(params))
308-
return escape_chars(params_text, '\\\'[];{}'.format(escape_coma))
309+
return escape_chars(params_text, '\\\'[];,')
309310

310311

311312
# noinspection PyMethodOverriding
@@ -368,7 +369,8 @@ def __init__(self, stream, name, args=[], kwargs={}):
368369
def stream_operator(stream_classes={Stream}, name=None):
369370
def decorator(func):
370371
func_name = name or func.__name__
371-
[setattr(stream_class, func_name, func) for stream_class in stream_classes]
372+
[setattr(stream_class, func_name, func)
373+
for stream_class in stream_classes]
372374
return func
373375

374376
return decorator

0 commit comments

Comments
 (0)