mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Fixed an error in the tag compiler test
This commit is contained in:
@@ -29,6 +29,10 @@ def smpte_to_frame_count(smpte_rep_string: str, frames_per_logical_second: int,
|
|||||||
assert frames_per_logical_second in [24, 25, 30, 48, 50, 60]
|
assert frames_per_logical_second in [24, 25, 30, 48, 50, 60]
|
||||||
|
|
||||||
m = re.search("(\d?\d)[:;](\d\d)[:;](\d\d)([:;])(\d\d)(\.\d+)?", smpte_rep_string)
|
m = re.search("(\d?\d)[:;](\d\d)[:;](\d\d)([:;])(\d\d)(\.\d+)?", smpte_rep_string)
|
||||||
|
|
||||||
|
if m is None:
|
||||||
|
return None
|
||||||
|
|
||||||
hh, mm, ss, sep, ff, frac = m.groups()
|
hh, mm, ss, sep, ff, frac = m.groups()
|
||||||
hh, mm, ss, ff, frac = int(hh), int(mm), int(ss), int(ff), float(frac or 0.0)
|
hh, mm, ss, ff, frac = int(hh), int(mm), int(ss), int(ff), float(frac or 0.0)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ class SessionDescriptor:
|
|||||||
|
|
||||||
def markers_timed(self) -> Iterator[Tuple['MarkerDescriptor', Fraction]]:
|
def markers_timed(self) -> Iterator[Tuple['MarkerDescriptor', Fraction]]:
|
||||||
for marker in self.markers:
|
for marker in self.markers:
|
||||||
marker_time = self.header.convert_timecode(marker.location)
|
marker_time = Fraction(marker.time_reference, int(self.header.sample_rate))
|
||||||
|
#marker_time = self.header.convert_timecode(marker.location)
|
||||||
yield marker, marker_time
|
yield marker, marker_time
|
||||||
|
|
||||||
def tracks_clips(self) -> Iterator[Tuple['TrackDescriptor', 'TrackClipDescriptor']]:
|
def tracks_clips(self) -> Iterator[Tuple['TrackDescriptor', 'TrackClipDescriptor']]:
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import glob
|
|||||||
|
|
||||||
from ptulsconv import commands
|
from ptulsconv import commands
|
||||||
|
|
||||||
# class TestBroadcastTimecode(unittest.TestCase):
|
class TestBroadcastTimecode(unittest.TestCase):
|
||||||
# def test_report_generation(self):
|
def test_report_generation(self):
|
||||||
# """
|
"""
|
||||||
# Setp through every text file in export_cases and make sure it can
|
Setp through every text file in export_cases and make sure it can
|
||||||
# be converted into PDF docs without throwing an error
|
be converted into PDF docs without throwing an error
|
||||||
# """
|
"""
|
||||||
# for path in glob.glob(os.path.dirname(__file__) + "/../export_cases/*.txt"):
|
# for path in glob.glob(os.path.dirname(__file__) + "/../export_cases/*.txt"):
|
||||||
# tempdir = tempfile.TemporaryDirectory()
|
# tempdir = tempfile.TemporaryDirectory()
|
||||||
# os.chdir(tempdir.name)
|
# os.chdir(tempdir.name)
|
||||||
|
|||||||
@@ -97,14 +97,14 @@ class TestTagCompiler(unittest.TestCase):
|
|||||||
|
|
||||||
markers = [doc_entity.MarkerDescriptor(number=1,
|
markers = [doc_entity.MarkerDescriptor(number=1,
|
||||||
location="01:00:00:00",
|
location="01:00:00:00",
|
||||||
time_reference=48000 * 60,
|
time_reference=48000 * 3600,
|
||||||
units="Samples",
|
units="Samples",
|
||||||
name="Marker 1 {Part=1}",
|
name="Marker 1 {Part=1}",
|
||||||
comments=""
|
comments=""
|
||||||
),
|
),
|
||||||
doc_entity.MarkerDescriptor(number=2,
|
doc_entity.MarkerDescriptor(number=2,
|
||||||
location="01:00:01:00",
|
location="01:00:01:00",
|
||||||
time_reference=48000 * 61,
|
time_reference=48000 * 3601,
|
||||||
units="Samples",
|
units="Samples",
|
||||||
name="Marker 2 {Part=2}",
|
name="Marker 2 {Part=2}",
|
||||||
comments="[M1]"
|
comments="[M1]"
|
||||||
|
|||||||
Reference in New Issue
Block a user