mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2026-01-01 09:20:49 +00:00
Event list implementation
This commit is contained in:
@@ -2,16 +2,15 @@ import ptulsconv
|
||||
import json
|
||||
import sys
|
||||
|
||||
def convert(input_file, convert_times, output=sys.stdout):
|
||||
parsed = dict()
|
||||
def convert(input_file, 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)
|
||||
|
||||
if convert_times:
|
||||
xform = ptulsconv.transformations.TimecodeInterpreter()
|
||||
parsed = xform.transform(parsed)
|
||||
tcxform = ptulsconv.transformations.TimecodeInterpreter()
|
||||
tagxform = ptulsconv.transformations.TagInterpreter()
|
||||
|
||||
json.dump(parsed, output)
|
||||
final = tagxform.transform( tcxform.transform(parsed) )
|
||||
|
||||
json.dump(final, output)
|
||||
|
||||
Reference in New Issue
Block a user