From a86ef7ed2e3d2e3961deb312490fe51810e5ff8a Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 4 Jan 2025 13:20:21 -0800 Subject: [PATCH 1/2] Added support for Adobe Premiere EDLs > 999 events --- pycmx/parse_cmx_statements.py | 8 +++++++- tests/test_parse.py | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pycmx/parse_cmx_statements.py b/pycmx/parse_cmx_statements.py index 957c238..72e1a18 100644 --- a/pycmx/parse_cmx_statements.py +++ b/pycmx/parse_cmx_statements.py @@ -53,7 +53,8 @@ def _edl_m2_column_widths(): def _parse_cmx3600_line(line, line_number): long_event_num_p = re.compile("^[0-9]{6} ") short_event_num_p = re.compile("^[0-9]{3} ") - + x_event_form_p = re.compile("^([0-9]{4,5}) ") + if isinstance(line,str): if line.startswith("TITLE:"): return _parse_title(line,line_number) @@ -67,6 +68,11 @@ def _parse_cmx3600_line(line, line_number): return _parse_long_standard_form(line, 128, line_number) elif short_event_num_p.match(line) != None: 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"): return _parse_extended_audio_channels(line,line_number) elif line.startswith("*"): diff --git a/tests/test_parse.py b/tests/test_parse.py index 4ae89b5..1a6800c 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -108,6 +108,11 @@ def test_transition_name(self): events = list(edl.events) 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 From f88b82e8fb6cebc343ac4f5d0f52030af881e753 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sun, 5 Jan 2025 10:47:57 -0800 Subject: [PATCH 2/2] README updated --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c41dd81..6b7c3c1 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,13 @@ # pycmx -The `pycmx` package provides a basic interface for parsing a CMX 3600 EDL and its most most common variations. +The `pycmx` package provides a basic interface for parsing a CMX 3600 EDL and +its most most common variations. ## Features -* The major variations of the CMX 3600: the standard, "File32" and "File128" - formats are automatically detected and properly read. +* The major variations of the CMX 3600: the standard, "File32", "File128" and + long Adobe Premiere formats are automatically detected and properly read. * Preserves relationship between events and individual edits/clips. * Remark or comment fields with common recognized forms are read and available to the client, including clip name and source file data. @@ -83,5 +84,3 @@ Audio channel 7 is present >>> events[2].edits[0].channels.video False ``` - -