diff --git a/ffmpeg/__init__.py b/ffmpeg/__init__.py index 1953609..154d8b6 100644 --- a/ffmpeg/__init__.py +++ b/ffmpeg/__init__.py @@ -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__ diff --git a/ffmpeg/_ffmpeg.py b/ffmpeg/_ffmpeg.py index 8dc6c87..968e793 100644 --- a/ffmpeg/_ffmpeg.py +++ b/ffmpeg/_ffmpeg.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from .nodes import ( filter_operator, GlobalNode, diff --git a/ffmpeg/_filters.py b/ffmpeg/_filters.py index 79949ab..a422f00 100644 --- a/ffmpeg/_filters.py +++ b/ffmpeg/_filters.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from .nodes import ( FilterNode, filter_operator, diff --git a/ffmpeg/_utils.py b/ffmpeg/_utils.py index 04f2add..06c5765 100644 --- a/ffmpeg/_utils.py +++ b/ffmpeg/_utils.py @@ -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): diff --git a/ffmpeg/dag.py b/ffmpeg/dag.py index c8a634e..3ce3891 100644 --- a/ffmpeg/dag.py +++ b/ffmpeg/dag.py @@ -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 @@ -72,14 +74,14 @@ DagEdge = namedtuple('DagEdge', ['downstream_node', 'downstream_label', 'upstrea 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 @@ -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 diff --git a/ffmpeg/nodes.py b/ffmpeg/nodes.py index b458fae..bc1d55d 100644 --- a/ffmpeg/nodes.py +++ b/ffmpeg/nodes.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +from builtins import object from .dag import KwargReprNode from ._utils import get_hash_int @@ -49,7 +50,7 @@ class Node(KwargReprNode): @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))) @@ -69,7 +70,7 @@ class Node(KwargReprNode): @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