mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
24 lines
993 B
Python
24 lines
993 B
Python
from ptulsconv.commands import convert
|
|
from optparse import OptionParser
|
|
import sys
|
|
|
|
parser = OptionParser()
|
|
parser.add_option('-t','--timecode', dest='convert_times', default=False, action='store_true',
|
|
help="Include timecode converted to seconds in output.")
|
|
parser.add_option('-z','--offset', dest='apply_start_offset', default=False, action='store_true',
|
|
help='Apply session start offset to converted start and finish timecodes on '
|
|
'clips and markers. Implies -t.')
|
|
parser.usage = "ptulsconv [-tz] TEXT_EXPORT.txt"
|
|
|
|
if __name__ == "__main__":
|
|
(options, args) = parser.parse_args(sys.argv)
|
|
if len(args) < 2:
|
|
print("Error: No input file",file=sys.stderr)
|
|
parser.print_help(sys.stderr)
|
|
exit(-1)
|
|
|
|
convert(input_file=args[1],
|
|
convert_times=(options.convert_times or options.apply_start_offset),
|
|
apply_session_start=options.apply_start_offset,
|
|
output=sys.stdout)
|