From 566e6257f460a62f2838e6159a75979a2e642d78 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sun, 18 Aug 2019 10:57:16 -0700 Subject: [PATCH] Added 'audio' method to ChannelMap Added `audio` property to channelmap to test if it contains any audio channels. --- pycmx/__init__.py | 2 +- pycmx/channel_map.py | 5 +++++ setup.py | 2 +- tests/test_parse.py | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pycmx/__init__.py b/pycmx/__init__.py index 6e06917..4b6c157 100644 --- a/pycmx/__init__.py +++ b/pycmx/__init__.py @@ -8,7 +8,7 @@ copy and reuse this software, refer to the LICENSE file included with the distribution. """ -__version__ = '1.0' +__version__ = '1.1.0' __author__ = 'Jamie Hardt' from .parse_cmx_events import parse_cmx3600 diff --git a/pycmx/channel_map.py b/pycmx/channel_map.py index fea8d3c..6c42018 100644 --- a/pycmx/channel_map.py +++ b/pycmx/channel_map.py @@ -27,6 +27,11 @@ class ChannelMap: 'True if video is included' return self.v + @property + def audio(self): + 'True if an audio channel is included' + return len(self._audio_channel_set) > 0 + @property def channels(self): 'A generator for each audio channel' diff --git a/setup.py b/setup.py index 2c14697..65e5f24 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ with open("README.md", "r") as fh: long_description = fh.read() setup(name='pycmx', - version='1.0.1', + version='1.1.0', author='Jamie Hardt', author_email='jamiehardt@me.com', description='CMX 3600 Edit Decision List Parser', diff --git a/tests/test_parse.py b/tests/test_parse.py index b5ea2e8..4ae89b5 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -66,6 +66,7 @@ class TestParse(TestCase): self.assertFalse( events[0].edits[0].channels.a1) self.assertTrue( events[0].edits[0].channels.a2) self.assertTrue( events[2].edits[0].channels.get_audio_channel(7) ) + self.assertTrue( events[2].edits[0].channels.audio) def test_multi_edit_events(self):