From 61e4bd5ca46cc2b5b69eae278660f5c12e7e8d41 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Wed, 9 Oct 2019 20:03:45 -0700 Subject: [PATCH] Reformatted file --- ptulsconv/commands.py | 6 ++++-- ptulsconv/ptuls_parser_visitor.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ptulsconv/commands.py b/ptulsconv/commands.py index 2fefeb2..a54ab71 100644 --- a/ptulsconv/commands.py +++ b/ptulsconv/commands.py @@ -40,6 +40,7 @@ adr_field_map = ((['Title', 'PT.Session.Name'], 'Title', str), (['ADLIB'], 'Adlib', str), (['OPT'], 'Optional', str)) + def fmp_dump(data, input_file_name, output): doc = TreeBuilder(element_factory=None) @@ -106,14 +107,15 @@ def dump_field_map(field_map_name, output=sys.stdout): output.write("# %25s| %20s | %8s\n" % (tag[:25], field[1][:20], field[2].__name__)) -def convert(input_file, output_format='fmpxml', start=None, end=None, progress=False, include_muted=False, output=sys.stdout): +def convert(input_file, output_format='fmpxml', start=None, end=None, progress=False, include_muted=False, + output=sys.stdout): with open(input_file, 'r') as file: ast = ptulsconv.protools_text_export_grammar.parse(file.read()) dict_parser = ptulsconv.DictionaryParserVisitor() parsed = dict_parser.visit(ast) tcxform = ptulsconv.transformations.TimecodeInterpreter() - tagxform = ptulsconv.transformations.TagInterpreter(show_progress=progress, ignore_muted=(not include_muted) ) + tagxform = ptulsconv.transformations.TagInterpreter(show_progress=progress, ignore_muted=(not include_muted)) parsed = tagxform.transform(tcxform.transform(parsed)) diff --git a/ptulsconv/ptuls_parser_visitor.py b/ptulsconv/ptuls_parser_visitor.py index 0e55a63..23c53c0 100644 --- a/ptulsconv/ptuls_parser_visitor.py +++ b/ptulsconv/ptuls_parser_visitor.py @@ -40,7 +40,7 @@ class DictionaryParserVisitor(NodeVisitor): @staticmethod def visit_clips_section(node, visited_children): - channel = next(iter(visited_children[2][5]), 1) + channel = next(iter(visited_children[2][3]), 1) return list(map(lambda child: dict(clip_name=child[0], file=child[2], channel=channel), visited_children[2]))