Added 'audio' method to ChannelMap

Added `audio` property to channelmap to test if it contains any audio channels.
This commit is contained in:
Jamie Hardt
2019-08-18 10:57:16 -07:00
parent c56d2066ad
commit 566e6257f4
4 changed files with 8 additions and 2 deletions

View File

@@ -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

View File

@@ -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'

View File

@@ -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',

View File

@@ -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):