File: otiointerface.py

package info (click to toggle)
kdenlive 25.12.0-1
  • links: PTS
  • area: main
  • in suites: forky
  • size: 125,912 kB
  • sloc: cpp: 206,648; xml: 11,857; python: 1,139; ansic: 1,054; javascript: 578; sh: 389; makefile: 15
file content (41 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2019 Vincent Pinon <vpinon@kde.org>
# SPDX-FileCopyrightText: 2022 Julius Künzel <julius.kuenzel@kde.org>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL

import sys
import opentimelineio as otio


def print_help():
    print("""
    THIS SCRIPT IS PART OF KDENLIVE (www.kdenlive.org)

    Usage: python3 otiointerface.py [options]

    Where [options] is at least one of the following:

    --export-suffixes  print out file suffixes of all otio adapters that can be used for export (support write)
    --import-suffixes  print out file suffixes of all otio adapters that can be used for import (support read)
    """)


if '--help' in sys.argv:
    print_help()
    sys.exit()

use_read = False
use_write = False
if '--export-suffixes' in sys.argv:
    use_write = True
if '--import-suffixes' in sys.argv:
    use_read = True
if not use_read and not use_write:
    print_help()
    sys.exit("Error: You need to provide at least one valid option")

suffixes = otio.adapters.suffixes_with_defined_adapters(
    read=use_read, write=use_write
)

print('*.'+' *.'.join(sorted(suffixes)), end=' ')