mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2026-10-02 01:37:17 +00:00
Renamed method call here for clarity
This commit is contained in:
@@ -131,7 +131,6 @@ class TagCompiler:
|
|||||||
return effective_tags
|
return effective_tags
|
||||||
|
|
||||||
def parse_data(self) -> Iterator[Intermediate]:
|
def parse_data(self) -> Iterator[Intermediate]:
|
||||||
|
|
||||||
for track, clip, start, finish, _ in self.session.track_clips_timed():
|
for track, clip, start, finish, _ in self.session.track_clips_timed():
|
||||||
if clip.state == "Muted":
|
if clip.state == "Muted":
|
||||||
continue
|
continue
|
||||||
@@ -153,7 +152,6 @@ class TagCompiler:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def apply_appends(parsed: Iterator[Intermediate]) -> Iterator[Intermediate]:
|
def apply_appends(parsed: Iterator[Intermediate]) -> Iterator[Intermediate]:
|
||||||
|
|
||||||
def should_append(a, b):
|
def should_append(a, b):
|
||||||
return b.clip_tag_mode == TagPreModes.APPEND and b.start >= a.finish
|
return b.clip_tag_mode == TagPreModes.APPEND and b.start >= a.finish
|
||||||
|
|
||||||
@@ -177,7 +175,6 @@ class TagCompiler:
|
|||||||
def collect_time_spans(
|
def collect_time_spans(
|
||||||
parsed: Iterator[Intermediate],
|
parsed: Iterator[Intermediate],
|
||||||
) -> Iterator[tuple[Intermediate, tuple[dict, Fraction, Fraction]]]:
|
) -> Iterator[tuple[Intermediate, tuple[dict, Fraction, Fraction]]]:
|
||||||
|
|
||||||
time_spans = []
|
time_spans = []
|
||||||
|
|
||||||
for item in parsed:
|
for item in parsed:
|
||||||
@@ -199,7 +196,6 @@ class TagCompiler:
|
|||||||
def apply_tags(
|
def apply_tags(
|
||||||
self, parsed_with_time_spans
|
self, parsed_with_time_spans
|
||||||
) -> Iterator[tuple[str, str, str, dict, Fraction, Fraction]]:
|
) -> Iterator[tuple[str, str, str, dict, Fraction, Fraction]]:
|
||||||
|
|
||||||
session_parsed = parse_tags(self.session.header.session_name)
|
session_parsed = parse_tags(self.session.header.session_name)
|
||||||
|
|
||||||
for event, time_spans in parsed_with_time_spans:
|
for event, time_spans in parsed_with_time_spans:
|
||||||
@@ -226,13 +222,13 @@ class TagCompiler:
|
|||||||
|
|
||||||
|
|
||||||
def apply_appends(
|
def apply_appends(
|
||||||
source: Iterator, should_append: Callable, do_append: Callable
|
source: Iterator, should_append: Callable, preform_append: Callable
|
||||||
) -> Generator:
|
) -> Generator:
|
||||||
"""
|
"""
|
||||||
:param source:
|
:param source:
|
||||||
:param should_append: Called with two variables a and b, your
|
:param should_append: Called with two variables a and b, your
|
||||||
function should return true if b should be
|
function should return true if b should be
|
||||||
appended to a
|
appended to a
|
||||||
:param do_append: Called with two variables a and b, your function
|
:param do_append: Called with two variables a and b, your function
|
||||||
should return
|
should return
|
||||||
:returns: A Generator
|
:returns: A Generator
|
||||||
@@ -240,7 +236,7 @@ def apply_appends(
|
|||||||
this_element = next(source)
|
this_element = next(source)
|
||||||
for element in source:
|
for element in source:
|
||||||
if should_append(this_element, element):
|
if should_append(this_element, element):
|
||||||
this_element = do_append(this_element, element)
|
this_element = preform_append(this_element, element)
|
||||||
else:
|
else:
|
||||||
yield this_element
|
yield this_element
|
||||||
this_element = element
|
this_element = element
|
||||||
|
|||||||
Reference in New Issue
Block a user