本文整理汇总了Python中timecode.Timecode.__repr__方法的典型用法代码示例。如果您正苦于以下问题:Python Timecode.__repr__方法的具体用法?Python Timecode.__repr__怎么用?Python Timecode.__repr__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类timecode.Timecode
的用法示例。
在下文中一共展示了Timecode.__repr__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_repr_overload
# 需要导入模块: from timecode import Timecode [as 别名]
# 或者: from timecode.Timecode import __repr__ [as 别名]
def test_repr_overload(self):
timeobj = Timecode('24', '01:00:00:00')
self.assertEqual('01:00:00:00', timeobj.__repr__())
timeobj = Timecode('23.98', '20:00:00:00')
self.assertEqual('20:00:00:00', timeobj.__repr__())
timeobj = Timecode('29.97', '00:09:00;00')
self.assertEqual('00:08:59;28', timeobj.__repr__())
timeobj = Timecode('30', '00:10:00:00')
self.assertEqual('00:10:00:00', timeobj.__repr__())
timeobj = Timecode('60', '00:00:09:00')
self.assertEqual('00:00:09:00', timeobj.__repr__())
timeobj = Timecode('59.94', '00:00:20;00')
self.assertEqual('00:00:20;00', timeobj.__repr__())
timeobj = Timecode('59.94', '00:00:20;00')
self.assertNotEqual('00:00:20:00', timeobj.__repr__())
timeobj = Timecode('ms', '00:00:00.900')
self.assertEqual('00:00:00.900', timeobj.__repr__())
timeobj = Timecode('ms', '00:00:00.900')
self.assertNotEqual('00:00:00:900', timeobj.__repr__())
timeobj = Timecode('24', frames=49)
self.assertEqual('00:00:02:00', timeobj.__repr__())
示例2: test_toggle_fractional_frame
# 需要导入模块: from timecode import Timecode [as 别名]
# 或者: from timecode.Timecode import __repr__ [as 别名]
def test_toggle_fractional_frame(self):
tc = Timecode(24, 421729315)
self.assertEqual(tc.__repr__(), '19:23:14:23')
tc.set_fractional(True)
self.assertEqual(tc.__repr__(), '19:23:14.958')
tc.set_fractional(False)
self.assertEqual(tc.__repr__(), '19:23:14:23')
示例3: test_rational_frame_delimiter
# 需要导入模块: from timecode import Timecode [as 别名]
# 或者: from timecode.Timecode import __repr__ [as 别名]
def test_rational_frame_delimiter(self):
tc = Timecode('24000/1000', frames=1)
self.assertFalse(';' in tc.__repr__())
tc = Timecode('24000/1001', frames=1)
self.assertFalse(';' in tc.__repr__())
tc = Timecode('30000/1001', frames=1)
self.assertTrue(';' in tc.__repr__())
示例4: test_24_hour_limit_in_2997fps
# 需要导入模块: from timecode import Timecode [as 别名]
# 或者: from timecode.Timecode import __repr__ [as 别名]
def test_24_hour_limit_in_2997fps(self):
"""testing if the timecode will loop back to 00:00:00:00 after 24 hours
in 29.97 fps
"""
tc = Timecode('29.97', '00:00:00:21')
self.assertTrue(tc.drop_frame)
self.assertEqual(22, tc.frames)
tc2 = Timecode('29.97', '23:59:59:29')
self.assertTrue(tc2.drop_frame)
self.assertEqual(2589408, tc2.frames)
self.assertEqual(
'00:00:00:21',
tc.__repr__()
)
self.assertEqual(
'23:59:59:29',
tc2.__repr__()
)
self.assertEqual(
'00:00:00:21',
(tc + tc2).__str__()
)
self.assertEqual(
'02:00:00:00',
(tc2 + 215785).__str__()
)
self.assertEqual(
'02:00:00:00',
(tc2 + 215785 + 2589408).__str__()
)
self.assertEqual(
'02:00:00:00',
(tc2 + 215785 + 2589408 + 2589408).__str__()
)