def _output_edited(self): """Return ``True`` if output of either point has been edited.""" in_1 = aeidon.as_time(self._input_entry_1.get_text()) in_2 = aeidon.as_time(self._input_entry_2.get_text()) out_1 = aeidon.as_time(self._output_entry_1.get_text()) out_2 = aeidon.as_time(self._output_entry_2.get_text()) return (out_1 != in_1 or out_2 != in_2)
def test_get_middle__time(self): for x, y, z in (( "00:00:01.000", "00:00:02.000", "00:00:01.500"), ( "00:00:01.000", "00:00:02.001", "00:00:01.500"), ("-00:00:01.000", "-00:00:02.000", "-00:00:01.500"), ( "00:00:01.000", "-00:00:02.002", "-00:00:00.501")): x = aeidon.as_time(x) y = aeidon.as_time(y) assert self.calc.get_middle(x, y) == z
def _get_first_point(self): """Return row, output time of the first sync point.""" return (self._subtitle_spin_1.get_value_as_int() - 1, aeidon.as_time(self._output_entry_1.get_text()))
def test_to_time(self): self.calc = aeidon.Calculator(aeidon.framerates.FPS_25_000) time = "00:00:01.000" assert self.calc.to_time(aeidon.as_time(time)) == time assert self.calc.to_time(aeidon.as_frame(25)) == time assert self.calc.to_time(aeidon.as_seconds(1.0)) == time
def test_to_seconds(self): self.calc = aeidon.Calculator(aeidon.framerates.FPS_25_000) assert self.calc.to_seconds(aeidon.as_time("00:00:01.000")) == 1.0 assert self.calc.to_seconds(aeidon.as_frame(25)) == 1.0 assert self.calc.to_seconds(aeidon.as_seconds(1.0)) == 1.0
def test_is_later__time(self): a = aeidon.as_time("00:00:01.000") b = aeidon.as_time("00:00:02.000") assert self.calc.is_later(b, a) assert not self.calc.is_later(b, b) assert not self.calc.is_later(a, b)
def duration_time(self, value): """Set duration from `value`.""" self.duration = aeidon.as_time(value)
def start_time(self, value): """Set start position from `value`.""" self.start = aeidon.as_time(value)
def end_time(self, value): """Set end position from `value`.""" self.end = aeidon.as_time(value)
def _get_second_point(self): """Return row, output time of the second sync point.""" return (self._subtitle_spin_2.get_value_as_int() - 1, aeidon.as_time(self._output_entry_2.get_text()))
def test_is_time(self): assert aeidon.is_time(aeidon.as_time("12:34:56.789")) assert not aeidon.is_time(aeidon.as_frame(13)) assert not aeidon.is_time(aeidon.as_seconds(13))