mirror of
https://github.com/iluvcapra/pycmx.git
synced 2025-12-31 17:00:53 +00:00
Merge branch 'master' of https://github.com/iluvcapra/pycmx into feat-adobe
This commit is contained in:
@@ -56,44 +56,43 @@ def _parse_cmx3600_line(line: str, line_number: int) -> object:
|
||||
Parses a single CMX EDL line.
|
||||
|
||||
:param line: A single EDL line.
|
||||
:param line_number: The index of this line in the file.
|
||||
:param line_number: The index of this line in the file.
|
||||
"""
|
||||
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)
|
||||
elif line.startswith("FCM:"):
|
||||
return _parse_fcm(line, line_number)
|
||||
elif long_event_num_p.match(line) != None:
|
||||
length_file_128 = sum(_edl_column_widths(6, 128))
|
||||
if len(line) < length_file_128:
|
||||
return _parse_long_standard_form(line, 32, line_number)
|
||||
else:
|
||||
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("*"):
|
||||
return _parse_remark(line[1:].strip(), line_number)
|
||||
elif line.startswith(">>> SOURCE"):
|
||||
return _parse_source_umid_statement(line, line_number)
|
||||
elif line.startswith("EFFECTS NAME IS"):
|
||||
return _parse_effects_name(line, line_number)
|
||||
elif line.startswith("SPLIT:"):
|
||||
return _parse_split(line, line_number)
|
||||
elif line.startswith("M2"):
|
||||
return _parse_motion_memory(line, line_number)
|
||||
if line.startswith("TITLE:"):
|
||||
return _parse_title(line, line_number)
|
||||
elif line.startswith("FCM:"):
|
||||
return _parse_fcm(line, line_number)
|
||||
elif long_event_num_p.match(line) is not None:
|
||||
length_file_128 = sum(_edl_column_widths(6, 128))
|
||||
if len(line) < length_file_128:
|
||||
return _parse_long_standard_form(line, 32, line_number)
|
||||
else:
|
||||
return _parse_unrecognized(line, line_number)
|
||||
return _parse_long_standard_form(line, 128, line_number)
|
||||
elif (m := x_event_form_p.match(line)) is not 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 short_event_num_p.match(line) is not None:
|
||||
return _parse_standard_form(line, line_number)
|
||||
elif line.startswith("AUD"):
|
||||
return _parse_extended_audio_channels(line, line_number)
|
||||
elif line.startswith("*"):
|
||||
return _parse_remark(line[1:].strip(), line_number)
|
||||
elif line.startswith(">>> SOURCE"):
|
||||
return _parse_source_umid_statement(line, line_number)
|
||||
elif line.startswith("EFFECTS NAME IS"):
|
||||
return _parse_effects_name(line, line_number)
|
||||
elif line.startswith("SPLIT:"):
|
||||
return _parse_split(line, line_number)
|
||||
elif line.startswith("M2"):
|
||||
return _parse_motion_memory(line, line_number)
|
||||
else:
|
||||
return _parse_unrecognized(line, line_number)
|
||||
|
||||
|
||||
def _parse_title(line, line_num) -> StmtTitle:
|
||||
@@ -190,5 +189,5 @@ def _parse_columns_for_standard_form(line, event_field_length,
|
||||
|
||||
|
||||
def _parse_source_umid_statement(line, line_number):
|
||||
trimmed = line[3:].strip()
|
||||
# trimmed = line[3:].strip()
|
||||
return StmtSourceUMID(name=None, umid=None, line_number=line_number)
|
||||
|
||||
Reference in New Issue
Block a user