mirror of
https://github.com/iluvcapra/pycmx.git
synced 2025-12-31 00:40:57 +00:00
autopep
This commit is contained in:
@@ -104,7 +104,7 @@ class Event:
|
||||
|
||||
def _statements_with_audio_ext(self) -> Generator[
|
||||
Tuple[StmtEvent, Optional[StmtAudioExt]], None, None]:
|
||||
|
||||
|
||||
if len(self.statements) == 1 and type(self.statements[0]) is StmtEvent:
|
||||
yield (self.statements[0], None)
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ def _parse_cmx3600_line(line: str, line_number: int, tolerant: bool = False) ->
|
||||
|
||||
try:
|
||||
return _parse_columns_for_standard_form(line, event_field_len,
|
||||
source_field_len,
|
||||
source_field_len,
|
||||
line_number)
|
||||
|
||||
except EventFormError:
|
||||
@@ -201,6 +201,7 @@ def _parse_split(line: str, line_number):
|
||||
class EventFormError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
||||
def _parse_unrecognized(line, line_number):
|
||||
return StmtUnrecognized(content=line, line_number=line_number)
|
||||
|
||||
@@ -218,7 +219,7 @@ def _parse_columns_for_standard_form(line: str, event_field_length: int,
|
||||
|
||||
channels = column_strings[4].strip()
|
||||
trans = column_strings[6].strip()
|
||||
|
||||
|
||||
if len(channels) == 0 or len(trans) == 0:
|
||||
raise EventFormError()
|
||||
|
||||
@@ -246,7 +247,7 @@ def _parse_columns_tolerant(line: str, line_number: int):
|
||||
|
||||
match = pattern.match(line)
|
||||
if match:
|
||||
return StmtEvent(event=int(match.group(1)), source=match.group(2),
|
||||
return StmtEvent(event=int(match.group(1)), source=match.group(2),
|
||||
channels=match.group(3), trans=match.group(4),
|
||||
trans_op=match.group(5), source_in=match.group(6),
|
||||
source_out=match.group(7), record_in=match.group(8),
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
from unittest import TestCase
|
||||
from unittest import TestCase
|
||||
|
||||
from pycmx import parse_cmx3600
|
||||
|
||||
|
||||
class Issue19Test(TestCase):
|
||||
def setUp(self):
|
||||
self.f = open("tests/edls/ISSUE_19_unusual01.edl")
|
||||
|
||||
|
||||
def test_parse(self):
|
||||
edl = parse_cmx3600(self.f, tolerant=True)
|
||||
for event in edl.events:
|
||||
@@ -20,7 +20,6 @@ class Issue19Test(TestCase):
|
||||
self.assertEqual(event.edits[0].source_in, "15:51:58:10")
|
||||
self.assertEqual(event.edits[0].record_out, "00:00:04:06")
|
||||
break
|
||||
|
||||
|
||||
def tearDown(self):
|
||||
self.f.close()
|
||||
|
||||
Reference in New Issue
Block a user