diff --git a/ptulsconv/__main__.py b/ptulsconv/__main__.py index b074172..94fb7e5 100644 --- a/ptulsconv/__main__.py +++ b/ptulsconv/__main__.py @@ -1,13 +1,12 @@ -from ptulsconv.commands import convert, dump_field_map -from ptulsconv import __name__, __version__, __author__ from optparse import OptionParser, OptionGroup -from .xml.common import dump_xform_options -from .reporting import print_status_style, print_banner_style, print_section_header_style, print_fatal_error import datetime import sys - import traceback +from ptulsconv import __name__, __version__, __author__ +from ptulsconv.commands import convert, dump_field_map +from ptulsconv.reporting import print_status_style, print_banner_style, print_section_header_style, print_fatal_error + def main(): parser = OptionParser() @@ -46,10 +45,6 @@ def main(): dump_field_map() sys.exit(0) - if options.show_transforms: - dump_xform_options() - sys.exit(0) - if len(args) < 2: print_fatal_error("Error: No input file") parser.print_help(sys.stderr) @@ -57,7 +52,7 @@ def main(): try: output_format = options.output_format - convert(input_file=args[1], output_format=output_format, log_output=sys.stderr, warnings=options.warnings) + convert(input_file=args[1], output_format=output_format, warnings=options.warnings) except FileNotFoundError as e: print_fatal_error("Error trying to read input file") raise e diff --git a/ptulsconv/commands.py b/ptulsconv/commands.py index a4d2eae..e3b71ad 100644 --- a/ptulsconv/commands.py +++ b/ptulsconv/commands.py @@ -128,9 +128,7 @@ def parse_text_export(file): return parsed -def convert(input_file, output_format='fmpxml', - progress=False, include_muted=False, xsl=None, - output=sys.stdout, log_output=sys.stderr, warnings=True): +def convert(input_file, output_format='fmpxml', output=sys.stdout, warnings=True): session = parse_document(input_file) session_tc_format = session.header.timecode_format diff --git a/tests/test_broadcast_timecode.py b/tests/test_broadcast_timecode.py index 378dbbc..32f1617 100644 --- a/tests/test_broadcast_timecode.py +++ b/tests/test_broadcast_timecode.py @@ -66,7 +66,8 @@ class TestBroadcastTimecode(unittest.TestCase): def test_seconds_to_smpte(self): secs = Fraction(25, 24) frame_duration = Fraction(1, 24) - s1 = broadcast_timecode.seconds_to_smpte(secs, frame_duration, 24, False) + tc_format = broadcast_timecode.TimecodeFormat(frame_duration=frame_duration, logical_fps=24, drop_frame=False) + s1 = tc_format.seconds_to_smpte(secs) self.assertEqual(s1, "00:00:01:01") diff --git a/tests/test_robinhood1.py b/tests/test_robinhood1.py index fefd161..cbe8ed1 100644 --- a/tests/test_robinhood1.py +++ b/tests/test_robinhood1.py @@ -14,7 +14,7 @@ class TestRobinHood1(unittest.TestCase): self.assertEqual(session.header.session_name, 'Robin Hood Spotting') self.assertEqual(session.header.sample_rate, 48000.0) self.assertEqual(session.header.bit_depth, 24) - self.assertEqual(session.header.timecode_format, '29.97') + self.assertEqual(session.header.timecode_fps, '29.97') self.assertEqual(session.header.timecode_drop_frame, False) def test_all_sections(self):