From ed568db704293f0d8f28dd5abeff5af4c259b7eb Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 20 Jun 2023 04:12:18 +0000 Subject: automatic import of python-ttconv --- .gitignore | 1 + python-ttconv.spec | 894 +++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 896 insertions(+) create mode 100644 python-ttconv.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..4707c7d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/ttconv-1.0.6.tar.gz diff --git a/python-ttconv.spec b/python-ttconv.spec new file mode 100644 index 0000000..3704a01 --- /dev/null +++ b/python-ttconv.spec @@ -0,0 +1,894 @@ +%global _empty_manifest_terminate_build 0 +Name: python-ttconv +Version: 1.0.6 +Release: 1 +Summary: Library for conversion of common timed text formats +License: BSD License +URL: https://github.com/sandflow/ttconv +Source0: https://mirrors.aliyun.com/pypi/web/packages/a0/1f/a132eade6e94e1c1aad0e31e85fb057aa5fe4cb4dfb58a261e5145b8d235/ttconv-1.0.6.tar.gz +BuildArch: noarch + + +%description +# ttconv (Timed Text Conversion) + + $$\ $$\ + $$ | $$ | + $$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$\ $$\ + \_$$ _|\_$$ _| $$ _____|$$ __$$\ $$ __$$\\$$\ $$ | + $$ | $$ | $$ / $$ / $$ |$$ | $$ |\$$\$$ / + $$ |$$\ $$ |$$\ $$ | $$ | $$ |$$ | $$ | \$$$ / + \$$$$ |\$$$$ |\$$$$$$$\ \$$$$$$ |$$ | $$ | \$ / + \____/ \____/ \_______| \______/ \__| \__| \_/ + +## Introduction + +_ttconv_ is a library and command line application written in pure Python for converting between timed text +formats used in the presentations of captions, subtitles, karaoke, etc. + + TTML / IMSC --- --- IMSC / TTML + \ / + SCC / CEA 608 ----- Canonical Model -------- WebVTT + / \ + EBU STL ------- --- SRT + / + SRT --------- + / + WebVTT ---- + +_ttconv_ works by mapping the input document, whatever its format, into an internal canonical model, which is then mapped to the +format of the output document is derived. The canonical model closely follows the [TTML 2](https://www.w3.org/TR/ttml2) data model, +as constrained by the [IMSC 1.1 Text Profile](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) specification. + +## Online demo + +[https://ttconv.sandflow.com/](https://ttconv.sandflow.com/) + +## Format support + +_ttconv_ currently supports the following input and output formats. Additional input and output formats are planned, and +suggestions/contributions are welcome. + +### Input Formats + +* [CEA 608/.scc](https://en.wikipedia.org/wiki/EIA-608) +* [IMSC 1.1 Text Profile/.ttml](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) +* [EBU STL](https://tech.ebu.ch/docs/tech/tech3264.pdf) +* [SubRip/.srt](https://en.wikipedia.org/wiki/SubRip) +* [WebVTT](https://www.w3.org/TR/webvtt1/) + +### Output Formats + +* [SubRip/.srt](https://en.wikipedia.org/wiki/SubRip) +* [IMSC 1.1 Text Profile/.ttml](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) +* [WebVTT](https://www.w3.org/TR/webvtt1/) + +## Quick start + +To install the latest version of `ttconv`, including pre-releases: + +```sh +pip install --pre ttconv + +tt convert -i -o +``` + +## Documentation + +### Command line + +`tt convert [-h] -i INPUT -o OUTPUT [--itype ITYPE] [--otype OTYPE] [--config CONFIG] [--config_file CONFIG_FILE]` + +* `--itype`: `TTML` | `SCC` | `STL` | `SRT` (extrapolated from the filename, if omitted) +* `--otype`: `TTML` | `SRT` | `VTT` (extrapolated from the filename, if omitted) +* `--config` and `--config_file`: JSON dictionaries with the following members: + * `"general": JSON object`: General configuration options (see below) + * `"imsc_writer": JSON object`: IMSC Writer configuration options (see below) + * `"stl_reader": JSON object`: STL Reader configuration options (see below) + * `"vtt_writer": JSON object`: WebVTT Writer configuration options (see below) + +Example: + +`tt convert -i <.scc file> -o <.ttml file> --itype SCC --otype TTML --config '{"general": {"progress_bar":false, "log_level":"WARN"}}'` + +### General configuration + +#### progress_bar + +`"progress_bar": true | false` + +A progress bar is displayed if `progress_bar` is `true` and `log_level` is `"INFO"`. + +Default: `true` + +### log_level + +`"log_level": "INFO" | "WARN" | "ERROR"` + +Logging verbosity + +Default: `"INFO"` + +### document_lang + +`"document_lang": ` + +Overrides the top-level language of the input document. + +Example: `"document_lang": "es-419"` + +Default: `None` + +### IMSC Writer configuration + +### time_format + +`"time_format": "frames" | "clock_time" | "clock_time_with_frames"` + +Specifies whether the TTML time expressions are in frames (`f`), `HH:MM:SS.mmm` or `HH:MM:SS:FF` + +Default: `"frames"` if `"fps"` is specified, `"clock_time"` otherwise + +### fps + +`"fps": "/"` + +Specifies the `ttp:frameRate` and `ttp:frameRateMultiplier` of the output document. + +Required when `time_format` is `frames` or `clock_time_with_frames`. No effect otherwise. + +Example: + +`--config '{"general": {"progress_bar":false, "log_level":"WARN"}, "imsc_writer": {"time_format":"clock_time_with_frames", "fps": "25/1"}}'` + +### STL Reader configuration + +#### disable_fill_line_gap + +`"disable_fill_line_gap" : true | false` + +`true` means that the STL reader does not fill gaps between lines + +Default: `false` + +#### disable_line_padding + +`"disable_line_padding" : true | false` + +`true` means that the STL reader does not add padding at the begining/end of lines + +Default: `false` + +#### program_start_tc + +`"program_start_tc" : "TCP" | "HH:MM:SS:FF"` + +Specifies a starting offset, either the TCP field of the GSI block or a user-specified timecode + +Default: `"00:00:00:00"` + +#### font_stack + +`"font_stack" : [](https://www.w3.org/TR/ttml2/#style-value-font-families)` + +Overrides the font stack + +Default: `"Verdana, Arial, Tiresias, sansSerif"` + +#### ax_row_count + +`"max_row_count" : "MNR" | integer` + +Specifies a maximum number of rows for open subtitles, either the MNR field of the GSI block or a user-specified value + +Default: `23` + +### VTT Writer configuration + +#### line_position + +`"line_position" : true | false` + +`true` means that the VTT writer outputs line and line alignment cue settings + +Default: `false` + +#### cue_id + +`"cue_id" : true | false` + +`true` means that the VTT writer outputs cue identifiers + +Default: `true` + +### Library + +The overall architecture of the library is as follows: + +* Reader modules validate and convert input files into instances of the canonical model (see `ttconv.imsc.reader.to_model()` for + example); +* Filter modules transform instances of the canonical data model, e.g. all text styling and positioning might be removed from an + instance of the canonical model to match the limited capabilities of downstream devices; and +* Writer modules convert instances of the canonical data model into output files. + +Processing shared across multiple reader and writer modules is factored out in common modules whenever possible. For example, +several output formats require an instance of the canonical data model to be transformed into a sequence of discrete temporal +snapshots – a process called ISD generation. + +The library uses the Python `logging` module to report non-fatal events. + +Unit tests illustrate the use of the library, e.g. `ReaderWriterTest.test_imsc_1_test_suite` at +`src/test/python/test_imsc_writer.py`. + +Detailed documentation including reference documents is under [`doc`](./doc). + +## Dependencies + +### Runtime + +* [python >= 3.7](https://python.org) + +### Development + +The project uses [pipenv](https://pypi.org/project/pipenv/) to manage dependencies. + +* [pylint](https://pypi.org/project/pylint/) +* [coverage](https://pypi.org/project/coverage/) + +## Development + +### Setup + +#### Local + +* run `pipenv install --dev` +* set the `PYTHONPATH` environment variable to `src/main/python`, e.g. `export PYTHONPATH=src/main/python` +* `pipenv run` can then be used + +#### Docker + +```sh +docker build --rm -f Dockerfile -t ttconv:latest . +docker run -it --rm ttconv:latest bash +``` + +### Example + +From the root directory of the project: + +```sh +mkdir build +pipenv install --dev +export PYTHONPATH=src/main/python +python src/main/python/ttconv/tt.py convert -i src/test/resources/scc/mix-rows-roll-up.scc -o build/mix-rows-roll-up.ttml +``` + +### Code coverage + +Unit test code coverage is provided by the script at `scripts/coverage.sh` + +### Continuous integration + +#### Overview + +Automated testing is provided by the script at `scripts/ci.sh` + +#### Local + +Run `./scripts/ci.sh` + +#### GitHub actions + +See `.github/workflows/main.yml` + +#### Docker + +Run `docker run -it --rm ttconv:latest /bin/sh scripts/ci.sh` + + +%package -n python3-ttconv +Summary: Library for conversion of common timed text formats +Provides: python-ttconv +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-ttconv +# ttconv (Timed Text Conversion) + + $$\ $$\ + $$ | $$ | + $$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$\ $$\ + \_$$ _|\_$$ _| $$ _____|$$ __$$\ $$ __$$\\$$\ $$ | + $$ | $$ | $$ / $$ / $$ |$$ | $$ |\$$\$$ / + $$ |$$\ $$ |$$\ $$ | $$ | $$ |$$ | $$ | \$$$ / + \$$$$ |\$$$$ |\$$$$$$$\ \$$$$$$ |$$ | $$ | \$ / + \____/ \____/ \_______| \______/ \__| \__| \_/ + +## Introduction + +_ttconv_ is a library and command line application written in pure Python for converting between timed text +formats used in the presentations of captions, subtitles, karaoke, etc. + + TTML / IMSC --- --- IMSC / TTML + \ / + SCC / CEA 608 ----- Canonical Model -------- WebVTT + / \ + EBU STL ------- --- SRT + / + SRT --------- + / + WebVTT ---- + +_ttconv_ works by mapping the input document, whatever its format, into an internal canonical model, which is then mapped to the +format of the output document is derived. The canonical model closely follows the [TTML 2](https://www.w3.org/TR/ttml2) data model, +as constrained by the [IMSC 1.1 Text Profile](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) specification. + +## Online demo + +[https://ttconv.sandflow.com/](https://ttconv.sandflow.com/) + +## Format support + +_ttconv_ currently supports the following input and output formats. Additional input and output formats are planned, and +suggestions/contributions are welcome. + +### Input Formats + +* [CEA 608/.scc](https://en.wikipedia.org/wiki/EIA-608) +* [IMSC 1.1 Text Profile/.ttml](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) +* [EBU STL](https://tech.ebu.ch/docs/tech/tech3264.pdf) +* [SubRip/.srt](https://en.wikipedia.org/wiki/SubRip) +* [WebVTT](https://www.w3.org/TR/webvtt1/) + +### Output Formats + +* [SubRip/.srt](https://en.wikipedia.org/wiki/SubRip) +* [IMSC 1.1 Text Profile/.ttml](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) +* [WebVTT](https://www.w3.org/TR/webvtt1/) + +## Quick start + +To install the latest version of `ttconv`, including pre-releases: + +```sh +pip install --pre ttconv + +tt convert -i -o +``` + +## Documentation + +### Command line + +`tt convert [-h] -i INPUT -o OUTPUT [--itype ITYPE] [--otype OTYPE] [--config CONFIG] [--config_file CONFIG_FILE]` + +* `--itype`: `TTML` | `SCC` | `STL` | `SRT` (extrapolated from the filename, if omitted) +* `--otype`: `TTML` | `SRT` | `VTT` (extrapolated from the filename, if omitted) +* `--config` and `--config_file`: JSON dictionaries with the following members: + * `"general": JSON object`: General configuration options (see below) + * `"imsc_writer": JSON object`: IMSC Writer configuration options (see below) + * `"stl_reader": JSON object`: STL Reader configuration options (see below) + * `"vtt_writer": JSON object`: WebVTT Writer configuration options (see below) + +Example: + +`tt convert -i <.scc file> -o <.ttml file> --itype SCC --otype TTML --config '{"general": {"progress_bar":false, "log_level":"WARN"}}'` + +### General configuration + +#### progress_bar + +`"progress_bar": true | false` + +A progress bar is displayed if `progress_bar` is `true` and `log_level` is `"INFO"`. + +Default: `true` + +### log_level + +`"log_level": "INFO" | "WARN" | "ERROR"` + +Logging verbosity + +Default: `"INFO"` + +### document_lang + +`"document_lang": ` + +Overrides the top-level language of the input document. + +Example: `"document_lang": "es-419"` + +Default: `None` + +### IMSC Writer configuration + +### time_format + +`"time_format": "frames" | "clock_time" | "clock_time_with_frames"` + +Specifies whether the TTML time expressions are in frames (`f`), `HH:MM:SS.mmm` or `HH:MM:SS:FF` + +Default: `"frames"` if `"fps"` is specified, `"clock_time"` otherwise + +### fps + +`"fps": "/"` + +Specifies the `ttp:frameRate` and `ttp:frameRateMultiplier` of the output document. + +Required when `time_format` is `frames` or `clock_time_with_frames`. No effect otherwise. + +Example: + +`--config '{"general": {"progress_bar":false, "log_level":"WARN"}, "imsc_writer": {"time_format":"clock_time_with_frames", "fps": "25/1"}}'` + +### STL Reader configuration + +#### disable_fill_line_gap + +`"disable_fill_line_gap" : true | false` + +`true` means that the STL reader does not fill gaps between lines + +Default: `false` + +#### disable_line_padding + +`"disable_line_padding" : true | false` + +`true` means that the STL reader does not add padding at the begining/end of lines + +Default: `false` + +#### program_start_tc + +`"program_start_tc" : "TCP" | "HH:MM:SS:FF"` + +Specifies a starting offset, either the TCP field of the GSI block or a user-specified timecode + +Default: `"00:00:00:00"` + +#### font_stack + +`"font_stack" : [](https://www.w3.org/TR/ttml2/#style-value-font-families)` + +Overrides the font stack + +Default: `"Verdana, Arial, Tiresias, sansSerif"` + +#### ax_row_count + +`"max_row_count" : "MNR" | integer` + +Specifies a maximum number of rows for open subtitles, either the MNR field of the GSI block or a user-specified value + +Default: `23` + +### VTT Writer configuration + +#### line_position + +`"line_position" : true | false` + +`true` means that the VTT writer outputs line and line alignment cue settings + +Default: `false` + +#### cue_id + +`"cue_id" : true | false` + +`true` means that the VTT writer outputs cue identifiers + +Default: `true` + +### Library + +The overall architecture of the library is as follows: + +* Reader modules validate and convert input files into instances of the canonical model (see `ttconv.imsc.reader.to_model()` for + example); +* Filter modules transform instances of the canonical data model, e.g. all text styling and positioning might be removed from an + instance of the canonical model to match the limited capabilities of downstream devices; and +* Writer modules convert instances of the canonical data model into output files. + +Processing shared across multiple reader and writer modules is factored out in common modules whenever possible. For example, +several output formats require an instance of the canonical data model to be transformed into a sequence of discrete temporal +snapshots – a process called ISD generation. + +The library uses the Python `logging` module to report non-fatal events. + +Unit tests illustrate the use of the library, e.g. `ReaderWriterTest.test_imsc_1_test_suite` at +`src/test/python/test_imsc_writer.py`. + +Detailed documentation including reference documents is under [`doc`](./doc). + +## Dependencies + +### Runtime + +* [python >= 3.7](https://python.org) + +### Development + +The project uses [pipenv](https://pypi.org/project/pipenv/) to manage dependencies. + +* [pylint](https://pypi.org/project/pylint/) +* [coverage](https://pypi.org/project/coverage/) + +## Development + +### Setup + +#### Local + +* run `pipenv install --dev` +* set the `PYTHONPATH` environment variable to `src/main/python`, e.g. `export PYTHONPATH=src/main/python` +* `pipenv run` can then be used + +#### Docker + +```sh +docker build --rm -f Dockerfile -t ttconv:latest . +docker run -it --rm ttconv:latest bash +``` + +### Example + +From the root directory of the project: + +```sh +mkdir build +pipenv install --dev +export PYTHONPATH=src/main/python +python src/main/python/ttconv/tt.py convert -i src/test/resources/scc/mix-rows-roll-up.scc -o build/mix-rows-roll-up.ttml +``` + +### Code coverage + +Unit test code coverage is provided by the script at `scripts/coverage.sh` + +### Continuous integration + +#### Overview + +Automated testing is provided by the script at `scripts/ci.sh` + +#### Local + +Run `./scripts/ci.sh` + +#### GitHub actions + +See `.github/workflows/main.yml` + +#### Docker + +Run `docker run -it --rm ttconv:latest /bin/sh scripts/ci.sh` + + +%package help +Summary: Development documents and examples for ttconv +Provides: python3-ttconv-doc +%description help +# ttconv (Timed Text Conversion) + + $$\ $$\ + $$ | $$ | + $$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$\ $$\ + \_$$ _|\_$$ _| $$ _____|$$ __$$\ $$ __$$\\$$\ $$ | + $$ | $$ | $$ / $$ / $$ |$$ | $$ |\$$\$$ / + $$ |$$\ $$ |$$\ $$ | $$ | $$ |$$ | $$ | \$$$ / + \$$$$ |\$$$$ |\$$$$$$$\ \$$$$$$ |$$ | $$ | \$ / + \____/ \____/ \_______| \______/ \__| \__| \_/ + +## Introduction + +_ttconv_ is a library and command line application written in pure Python for converting between timed text +formats used in the presentations of captions, subtitles, karaoke, etc. + + TTML / IMSC --- --- IMSC / TTML + \ / + SCC / CEA 608 ----- Canonical Model -------- WebVTT + / \ + EBU STL ------- --- SRT + / + SRT --------- + / + WebVTT ---- + +_ttconv_ works by mapping the input document, whatever its format, into an internal canonical model, which is then mapped to the +format of the output document is derived. The canonical model closely follows the [TTML 2](https://www.w3.org/TR/ttml2) data model, +as constrained by the [IMSC 1.1 Text Profile](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) specification. + +## Online demo + +[https://ttconv.sandflow.com/](https://ttconv.sandflow.com/) + +## Format support + +_ttconv_ currently supports the following input and output formats. Additional input and output formats are planned, and +suggestions/contributions are welcome. + +### Input Formats + +* [CEA 608/.scc](https://en.wikipedia.org/wiki/EIA-608) +* [IMSC 1.1 Text Profile/.ttml](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) +* [EBU STL](https://tech.ebu.ch/docs/tech/tech3264.pdf) +* [SubRip/.srt](https://en.wikipedia.org/wiki/SubRip) +* [WebVTT](https://www.w3.org/TR/webvtt1/) + +### Output Formats + +* [SubRip/.srt](https://en.wikipedia.org/wiki/SubRip) +* [IMSC 1.1 Text Profile/.ttml](https://www.w3.org/TR/ttml-imsc1.1/#text-profile) +* [WebVTT](https://www.w3.org/TR/webvtt1/) + +## Quick start + +To install the latest version of `ttconv`, including pre-releases: + +```sh +pip install --pre ttconv + +tt convert -i -o +``` + +## Documentation + +### Command line + +`tt convert [-h] -i INPUT -o OUTPUT [--itype ITYPE] [--otype OTYPE] [--config CONFIG] [--config_file CONFIG_FILE]` + +* `--itype`: `TTML` | `SCC` | `STL` | `SRT` (extrapolated from the filename, if omitted) +* `--otype`: `TTML` | `SRT` | `VTT` (extrapolated from the filename, if omitted) +* `--config` and `--config_file`: JSON dictionaries with the following members: + * `"general": JSON object`: General configuration options (see below) + * `"imsc_writer": JSON object`: IMSC Writer configuration options (see below) + * `"stl_reader": JSON object`: STL Reader configuration options (see below) + * `"vtt_writer": JSON object`: WebVTT Writer configuration options (see below) + +Example: + +`tt convert -i <.scc file> -o <.ttml file> --itype SCC --otype TTML --config '{"general": {"progress_bar":false, "log_level":"WARN"}}'` + +### General configuration + +#### progress_bar + +`"progress_bar": true | false` + +A progress bar is displayed if `progress_bar` is `true` and `log_level` is `"INFO"`. + +Default: `true` + +### log_level + +`"log_level": "INFO" | "WARN" | "ERROR"` + +Logging verbosity + +Default: `"INFO"` + +### document_lang + +`"document_lang": ` + +Overrides the top-level language of the input document. + +Example: `"document_lang": "es-419"` + +Default: `None` + +### IMSC Writer configuration + +### time_format + +`"time_format": "frames" | "clock_time" | "clock_time_with_frames"` + +Specifies whether the TTML time expressions are in frames (`f`), `HH:MM:SS.mmm` or `HH:MM:SS:FF` + +Default: `"frames"` if `"fps"` is specified, `"clock_time"` otherwise + +### fps + +`"fps": "/"` + +Specifies the `ttp:frameRate` and `ttp:frameRateMultiplier` of the output document. + +Required when `time_format` is `frames` or `clock_time_with_frames`. No effect otherwise. + +Example: + +`--config '{"general": {"progress_bar":false, "log_level":"WARN"}, "imsc_writer": {"time_format":"clock_time_with_frames", "fps": "25/1"}}'` + +### STL Reader configuration + +#### disable_fill_line_gap + +`"disable_fill_line_gap" : true | false` + +`true` means that the STL reader does not fill gaps between lines + +Default: `false` + +#### disable_line_padding + +`"disable_line_padding" : true | false` + +`true` means that the STL reader does not add padding at the begining/end of lines + +Default: `false` + +#### program_start_tc + +`"program_start_tc" : "TCP" | "HH:MM:SS:FF"` + +Specifies a starting offset, either the TCP field of the GSI block or a user-specified timecode + +Default: `"00:00:00:00"` + +#### font_stack + +`"font_stack" : [](https://www.w3.org/TR/ttml2/#style-value-font-families)` + +Overrides the font stack + +Default: `"Verdana, Arial, Tiresias, sansSerif"` + +#### ax_row_count + +`"max_row_count" : "MNR" | integer` + +Specifies a maximum number of rows for open subtitles, either the MNR field of the GSI block or a user-specified value + +Default: `23` + +### VTT Writer configuration + +#### line_position + +`"line_position" : true | false` + +`true` means that the VTT writer outputs line and line alignment cue settings + +Default: `false` + +#### cue_id + +`"cue_id" : true | false` + +`true` means that the VTT writer outputs cue identifiers + +Default: `true` + +### Library + +The overall architecture of the library is as follows: + +* Reader modules validate and convert input files into instances of the canonical model (see `ttconv.imsc.reader.to_model()` for + example); +* Filter modules transform instances of the canonical data model, e.g. all text styling and positioning might be removed from an + instance of the canonical model to match the limited capabilities of downstream devices; and +* Writer modules convert instances of the canonical data model into output files. + +Processing shared across multiple reader and writer modules is factored out in common modules whenever possible. For example, +several output formats require an instance of the canonical data model to be transformed into a sequence of discrete temporal +snapshots – a process called ISD generation. + +The library uses the Python `logging` module to report non-fatal events. + +Unit tests illustrate the use of the library, e.g. `ReaderWriterTest.test_imsc_1_test_suite` at +`src/test/python/test_imsc_writer.py`. + +Detailed documentation including reference documents is under [`doc`](./doc). + +## Dependencies + +### Runtime + +* [python >= 3.7](https://python.org) + +### Development + +The project uses [pipenv](https://pypi.org/project/pipenv/) to manage dependencies. + +* [pylint](https://pypi.org/project/pylint/) +* [coverage](https://pypi.org/project/coverage/) + +## Development + +### Setup + +#### Local + +* run `pipenv install --dev` +* set the `PYTHONPATH` environment variable to `src/main/python`, e.g. `export PYTHONPATH=src/main/python` +* `pipenv run` can then be used + +#### Docker + +```sh +docker build --rm -f Dockerfile -t ttconv:latest . +docker run -it --rm ttconv:latest bash +``` + +### Example + +From the root directory of the project: + +```sh +mkdir build +pipenv install --dev +export PYTHONPATH=src/main/python +python src/main/python/ttconv/tt.py convert -i src/test/resources/scc/mix-rows-roll-up.scc -o build/mix-rows-roll-up.ttml +``` + +### Code coverage + +Unit test code coverage is provided by the script at `scripts/coverage.sh` + +### Continuous integration + +#### Overview + +Automated testing is provided by the script at `scripts/ci.sh` + +#### Local + +Run `./scripts/ci.sh` + +#### GitHub actions + +See `.github/workflows/main.yml` + +#### Docker + +Run `docker run -it --rm ttconv:latest /bin/sh scripts/ci.sh` + + +%prep +%autosetup -n ttconv-1.0.6 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-ttconv -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot - 1.0.6-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..7b1d26b --- /dev/null +++ b/sources @@ -0,0 +1 @@ +24f3df283093228a11c8888c6b8953ef ttconv-1.0.6.tar.gz -- cgit v1.2.3