Added support for Adobe Premiere EDLs > 999 events

This commit is contained in:
Jamie Hardt
2025-01-04 13:20:21 -08:00
parent 1e1331eadb
commit a86ef7ed2e
2 changed files with 12 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ def _edl_m2_column_widths():
def _parse_cmx3600_line(line, line_number): def _parse_cmx3600_line(line, line_number):
long_event_num_p = re.compile("^[0-9]{6} ") long_event_num_p = re.compile("^[0-9]{6} ")
short_event_num_p = re.compile("^[0-9]{3} ") short_event_num_p = re.compile("^[0-9]{3} ")
x_event_form_p = re.compile("^([0-9]{4,5}) ")
if isinstance(line,str): if isinstance(line,str):
if line.startswith("TITLE:"): if line.startswith("TITLE:"):
@@ -67,6 +68,11 @@ def _parse_cmx3600_line(line, line_number):
return _parse_long_standard_form(line, 128, line_number) return _parse_long_standard_form(line, 128, line_number)
elif short_event_num_p.match(line) != None: elif short_event_num_p.match(line) != None:
return _parse_standard_form(line, line_number) return _parse_standard_form(line, line_number)
elif (m := x_event_form_p.match(line)) != None:
assert m is not None
event_field_length = len(m[1])
return _parse_columns_for_standard_form(line, event_field_length,
8, line_number)
elif line.startswith("AUD"): elif line.startswith("AUD"):
return _parse_extended_audio_channels(line,line_number) return _parse_extended_audio_channels(line,line_number)
elif line.startswith("*"): elif line.startswith("*"):

View File

@@ -108,6 +108,11 @@ class TestParse(TestCase):
events = list(edl.events) events = list(edl.events)
self.assertEqual( events[4].edits[1].transition.name , "CROSS DISSOLVE" ) self.assertEqual( events[4].edits[1].transition.name , "CROSS DISSOLVE" )
def test_adobe_wide(self):
with open("tests/edls/adobe_dai109_test.txt", 'r', encoding='ISO-8859-1') as f:
edl = pycmx.parse_cmx3600(f)
events = list(edl.events)
self.assertEqual(len(events), 2839)
# add test for edit_list.channels # add test for edit_list.channels