| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cb9d400 commit 6189cd6
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ jobs: | |||
| 15 | 15 | - "3.7" | |
| 16 | 16 | - "3.8" | |
| 17 | 17 | - "3.9" | |
| 18 | - # - "3.10" # FIXME: broken due to `collections.Iterable` issue; see #330 / #624 / etc. | ||
| 18 | + - "3.10" | ||
| 19 | 19 | steps: | |
| 20 | 20 | - uses: actions/checkout@v1 | |
| 21 | 21 | - name: Set up Python ${{ matrix.python-version }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,10 +27,10 @@ | |||
| 27 | 27 | parser.add_argument('--end-time', type=float, help='End time (seconds)') | |
| 28 | 28 | parser.add_argument('-v', dest='verbose', action='store_true', help='Verbose mode') | |
| 29 | 29 | ||
| 30 | - silence_start_re = re.compile(' silence_start: (?P<start>[0-9]+(\.?[0-9]*))$') | ||
| 31 | - silence_end_re = re.compile(' silence_end: (?P<end>[0-9]+(\.?[0-9]*)) ') | ||
| 30 | + silence_start_re = re.compile(r' silence_start: (?P<start>[0-9]+(\.?[0-9]*))$') | ||
| 31 | + silence_end_re = re.compile(r' silence_end: (?P<end>[0-9]+(\.?[0-9]*)) ') | ||
| 32 | 32 | total_duration_re = re.compile( | |
| 33 | - 'size=[^ ]+ time=(?P<hours>[0-9]{2}):(?P<minutes>[0-9]{2}):(?P<seconds>[0-9\.]{5}) bitrate=') | ||
| 33 | + r'size=[^ ]+ time=(?P<hours>[0-9]{2}):(?P<minutes>[0-9]{2}):(?P<seconds>[0-9\.]{5}) bitrate=') | ||
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | 36 | def _logged_popen(cmd_line, *args, **kwargs): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | from ._utils import basestring, convert_kwargs_to_cmd_line_args | |
| 4 | 4 | from builtins import str | |
| 5 | 5 | from functools import reduce | |
| 6 | - import collections | ||
| 7 | 6 | import copy | |
| 8 | 7 | import operator | |
| 9 | 8 | import subprocess | |
@@ -18,6 +17,11 @@ | |||
| 18 | 17 | output_operator, | |
| 19 | 18 | ) | |
| 20 | 19 | ||
| 20 | + try: | ||
| 21 | + from collections.abc import Iterable | ||
| 22 | + except ImportError: | ||
| 23 | + from collections import Iterable | ||
| 24 | + | ||
| 21 | 25 | ||
| 22 | 26 | class Error(Exception): | |
| 23 | 27 | def __init__(self, cmd, stdout, stderr): | |
@@ -136,9 +140,7 @@ def _get_output_args(node, stream_name_map): | |||
| 136 | 140 | args += ['-b:a', str(kwargs.pop('audio_bitrate'))] | |
| 137 | 141 | if 'video_size' in kwargs: | |
| 138 | 142 | video_size = kwargs.pop('video_size') | |
| 139 | - if not isinstance(video_size, basestring) and isinstance( | ||
| 140 | - video_size, collections.Iterable | ||
| 141 | - ): | ||
| 143 | + if not isinstance(video_size, basestring) and isinstance(video_size, Iterable): | ||
| 142 | 144 | video_size = '{}x{}'.format(video_size[0], video_size[1]) | |
| 143 | 145 | args += ['-video_size', video_size] | |
| 144 | 146 | args += convert_kwargs_to_cmd_line_args(kwargs) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,13 +3,17 @@ | |||
| 3 | 3 | from past.builtins import basestring | |
| 4 | 4 | import hashlib | |
| 5 | 5 | import sys | |
| 6 | - import collections | ||
| 7 | 6 | ||
| 8 | 7 | ||
| 9 | 8 | if sys.version_info.major == 2: | |
| 10 | 9 | # noinspection PyUnresolvedReferences,PyShadowingBuiltins | |
| 11 | 10 | str = str | |
| 12 | 11 | ||
| 12 | + try: | ||
| 13 | + from collections.abc import Iterable | ||
| 14 | + except ImportError: | ||
| 15 | + from collections import Iterable | ||
| 16 | + | ||
| 13 | 17 | ||
| 14 | 18 | # `past.builtins.basestring` module can't be imported on Python3 in some environments (Ubuntu). | |
| 15 | 19 | # This code is copy-pasted from it to avoid crashes. | |
@@ -92,7 +96,7 @@ def convert_kwargs_to_cmd_line_args(kwargs): | |||
| 92 | 96 | args = [] | |
| 93 | 97 | for k in sorted(kwargs.keys()): | |
| 94 | 98 | v = kwargs[k] | |
| 95 | - if isinstance(v, collections.Iterable) and not isinstance(v, str): | ||
| 99 | + if isinstance(v, Iterable) and not isinstance(v, str): | ||
| 96 | 100 | for value in v: | |
| 97 | 101 | args.append('-{}'.format(k)) | |
| 98 | 102 | if value is not None: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | def test_escape_chars(): | |
| 33 | - assert ffmpeg._utils.escape_chars('a:b', ':') == 'a\:b' | ||
| 33 | + assert ffmpeg._utils.escape_chars('a:b', ':') == r'a\:b' | ||
| 34 | 34 | assert ffmpeg._utils.escape_chars('a\\:b', ':\\') == 'a\\\\\\:b' | |
| 35 | 35 | assert ( | |
| 36 | 36 | ffmpeg._utils.escape_chars('a:b,c[d]e%{}f\'g\'h\\i', '\\\':,[]%') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,5 +92,9 @@ | |||
| 92 | 92 | 'Programming Language :: Python :: 3.4', | |
| 93 | 93 | 'Programming Language :: Python :: 3.5', | |
| 94 | 94 | 'Programming Language :: Python :: 3.6', | |
| 95 | + 'Programming Language :: Python :: 3.7', | ||
| 96 | + 'Programming Language :: Python :: 3.8', | ||
| 97 | + 'Programming Language :: Python :: 3.9', | ||
| 98 | + 'Programming Language :: Python :: 3.10', | ||
| 95 | 99 | ], | |
| 96 | 100 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | # and then run "tox" from this directory. | |
| 5 | 5 | ||
| 6 | 6 | [tox] | |
| 7 | - envlist = py27, py35, py36, py37, py38, py39 | ||
| 7 | + envlist = py27, py35, py36, py37, py38, py39, py310 | ||
| 8 | 8 | ||
| 9 | 9 | [gh-actions] | |
| 10 | 10 | python = | |
@@ -14,6 +14,7 @@ python = | |||
| 14 | 14 | 3.7: py37 | |
| 15 | 15 | 3.8: py38 | |
| 16 | 16 | 3.9: py39 | |
| 17 | + 3.10: py310 | ||
| 17 | 18 | ||
| 18 | 19 | [testenv] | |
| 19 | 20 | commands = py.test -vv | |
| Back | FazBrowse Home | New Git URL |
0 commit comments