Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#17: fix python 3 support
  • Loading branch information
kkroening committed Jul 6, 2017
commit 662c56eb5b228b7fbf301035c074749dc9eced29
2 changes: 2 additions & 0 deletions ffmpeg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import unicode_literals

from . import _filters, _ffmpeg, _run
from ._filters import *
from ._ffmpeg import *
from ._run import *

__all__ = _filters.__all__ + _ffmpeg.__all__ + _run.__all__
1 change: 1 addition & 0 deletions ffmpeg/_ffmpeg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import unicode_literals

from .nodes import (
filter_operator,
GlobalNode,
Expand Down
1 change: 1 addition & 0 deletions ffmpeg/_filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import unicode_literals

from .nodes import (
FilterNode,
filter_operator,
Expand Down
6 changes: 5 additions & 1 deletion ffmpeg/_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import hashlib
from __future__ import unicode_literals

from builtins import str
from past.builtins import basestring
import hashlib


def _recursive_repr(item):
Expand Down
8 changes: 5 additions & 3 deletions ffmpeg/dag.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import unicode_literals

from ._utils import get_hash, get_hash_int
from builtins import object
from collections import namedtuple
Expand Down Expand Up @@ -72,14 +74,14 @@ def incoming_edge_map(self):

def get_incoming_edges(downstream_node, incoming_edge_map):
edges = []
for downstream_label, (upstream_node, upstream_label) in incoming_edge_map.items():
for downstream_label, (upstream_node, upstream_label) in list(incoming_edge_map.items()):
edges += [DagEdge(downstream_node, downstream_label, upstream_node, upstream_label)]
return edges


def get_outgoing_edges(upstream_node, outgoing_edge_map):
edges = []
for upstream_label, downstream_infos in outgoing_edge_map.items():
for upstream_label, downstream_infos in list(outgoing_edge_map.items()):
for (downstream_node, downstream_label) in downstream_infos:
edges += [DagEdge(downstream_node, downstream_label, upstream_node, upstream_label)]
return edges
Expand All @@ -91,7 +93,7 @@ class KwargReprNode(DagNode):
@property
def __upstream_hashes(self):
hashes = []
for downstream_label, (upstream_node, upstream_label) in self.incoming_edge_map.items():
for downstream_label, (upstream_node, upstream_label) in list(self.incoming_edge_map.items()):
hashes += [hash(x) for x in [downstream_label, upstream_node, upstream_label]]
return hashes

Expand Down
5 changes: 3 additions & 2 deletions ffmpeg/nodes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import unicode_literals

from builtins import object
from .dag import KwargReprNode
from ._utils import get_hash_int

Expand Down Expand Up @@ -49,7 +50,7 @@ def __check_input_len(cls, stream_map, min_inputs, max_inputs):

@classmethod
def __check_input_types(cls, stream_map, incoming_stream_types):
for stream in stream_map.values():
for stream in list(stream_map.values()):
if not _is_of_types(stream, incoming_stream_types):
raise TypeError('Expected incoming stream(s) to be of one of the following types: {}; got {}'
.format(_get_types_str(incoming_stream_types), type(stream)))
Expand All @@ -69,7 +70,7 @@ def __get_stream_map(cls, stream_spec):
@classmethod
def __get_incoming_edge_map(cls, stream_map):
incoming_edge_map = {}
for downstream_label, upstream in stream_map.items():
for downstream_label, upstream in list(stream_map.items()):
incoming_edge_map[downstream_label] = (upstream.node, upstream.label)
return incoming_edge_map

Expand Down