File tree Expand file tree Collapse file tree 7 files changed +19
-6
lines changed Expand file tree Collapse file tree 7 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1
1
.cache
2
2
dist /
3
3
ffmpeg /tests /sample_data /dummy2.mp4
4
- venv
4
+ venv *
Original file line number Diff line number Diff line change
1
+ from __future__ import unicode_literals
1
2
from . import _filters , _ffmpeg , _run
2
3
from ._filters import *
3
4
from ._ffmpeg import *
Original file line number Diff line number Diff line change
1
+ from __future__ import unicode_literals
1
2
from .nodes import (
2
3
FilterNode ,
3
4
GlobalNode ,
Original file line number Diff line number Diff line change
1
+ from __future__ import unicode_literals
1
2
from .nodes import (
2
3
FilterNode ,
3
4
operator ,
Original file line number Diff line number Diff line change
1
+ from __future__ import unicode_literals
2
+
3
+ from past .builtins import basestring
1
4
import operator as _operator
2
5
import subprocess as _subprocess
3
<
8000
/td>6
13
16
operator ,
14
17
OutputNode ,
15
18
)
19
+ from functools import reduce
16
20
17
21
def _get_stream_name (name ):
18
22
return '[{}]' .format (name )
Original file line number Diff line number Diff line change
1
+ from __future__ import unicode_literals
2
+
3
+ from builtins import object
1
4
import hashlib
2
5
import json
3
6
@@ -18,15 +21,18 @@ def __repr__(self):
18
21
formatted_props += ['{}={!r}' .format (key , self ._kwargs [key ]) for key in sorted (self ._kwargs )]
19
22
return '{}({})' .format (se
8000
lf ._name , ',' .join (formatted_props ))
20
23
24
+ def __hash__ (self ):
25
+ return int (self ._hash , base = 16 )
26
+
21
27
def __eq__ (self , other ):
22
28
return self ._hash == other ._hash
23
29
24
30
def _update_hash (self ):
25
31
props = {'args' : self ._args , 'kwargs' : self ._kwargs }
26
- my_hash = hashlib .md5 (json .dumps (props , sort_keys = True )).hexdigest ()
32
+ my_hash = hashlib .md5 (json .dumps (props , sort_keys = True ). encode ( 'utf-8' ) ).hexdigest ()
27
33
parent_hashes = [parent ._hash for parent in self ._parents ]
28
34
hashes = parent_hashes + [my_hash ]
29
- self ._hash = hashlib .md5 (',' .join (hashes )).hexdigest ()
35
+ self ._hash = hashlib .md5 (',' .join (hashes ). encode ( 'utf-8' ) ).hexdigest ()
30
36
31
37
32
38
class InputNode (Node ):
Original file line number Diff line number Diff line change 1
- from ffmpeg . nodes import operator , FilterNode
1
+ from __future__ import unicode_literals
2
2
import ffmpeg
3
3
import os
4
4
import pytest
@@ -72,12 +72,12 @@ def test_repr():
72
72
trim3 = ffmpeg .trim (in_file , start_frame = 50 , end_frame = 60 )
73
73
concatted = ffmpeg .concat (trim1 , trim2 , trim3 )
74
74
output = ffmpeg .output (concatted , 'dummy2.mp4' )
75
- assert repr (in_file ) == "input(filename='dummy.mp4')"
75
+ assert repr (in_file ) == "input(filename={!r})" . format ( 'dummy.mp4' )
76
76
assert repr (trim1 ) == "trim(end_frame=20,start_frame=10)"
77
77
assert repr (trim2 ) == "trim(end_frame=40,start_frame=30)"
78
78
assert repr (trim3 ) == "trim(end_frame=60,start_frame=50)"
79
79
assert repr (concatted ) == "concat(n=3)"
80
- assert repr (output ) == "output(filename='dummy2.mp4')"
80
+ assert repr (output ) == "output(filename={!r})" . format ( 'dummy2.mp4' )
81
81
82
82
83
83
def test_get_args_simple ():
You can’t perform that action at this time.
0 commit comments