File indexing completed on 2024-05-05 04:52:35

0001 #!/usr/bin/env python3
0002 # SPDX-FileCopyrightText: 2019 Vincent Pinon <vpinon@kde.org>
0003 # SPDX-FileCopyrightText: 2022 Julius Künzel <jk.kdedev@smartlab.uber.space>
0004 # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 
0006 import sys
0007 import opentimelineio as otio
0008 
0009 
0010 def print_help():
0011     print("""
0012     THIS SCRIPT IS PART OF KDENLIVE (www.kdenlive.org)
0013 
0014     Usage: python3 otiointerface.py [options]
0015 
0016     Where [options] is at least one of the following:
0017 
0018     --export-suffixes  print out file suffixes of all otio adapters that can be used for export (support write)
0019     --import-suffixes  print out file suffixes of all otio adapters that can be used for import (support read)
0020     """)
0021 
0022 
0023 if '--help' in sys.argv:
0024     print_help()
0025     sys.exit()
0026 
0027 use_read = False
0028 use_write = False
0029 if '--export-suffixes' in sys.argv:
0030     use_write = True
0031 if '--import-suffixes' in sys.argv:
0032     use_read = True
0033 if not use_read and not use_write:
0034     print_help()
0035     sys.exit("Error: You need to provide at least one valid option")
0036 
0037 suffixes = otio.adapters.suffixes_with_defined_adapters(
0038     read=use_read, write=use_write
0039 )
0040 
0041 print('*.'+' *.'.join(sorted(suffixes)), end=' ')