forked from ebu/ebu-tt-live-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MSPA-728 ebu-tt-3 to ebu-tt-d conversion
- Loading branch information
Showing
112 changed files
with
3,638 additions
and
527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,9 @@ coverage.xml | |
*,cover | ||
.hypothesis/ | ||
|
||
# Pytest cache | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,20 @@ | ||
language: python | ||
|
||
python: | ||
- '2.7' | ||
- '3.7' | ||
|
||
branches: | ||
except: | ||
- gh-pages | ||
|
||
before_install: | ||
- echo "Checking for java" | ||
- java -version | ||
- openssl aes-256-cbc -K $encrypted_f18bb5b3c3d4_key -iv $encrypted_f18bb5b3c3d4_iv -in publish-key.enc -out ~/.ssh/publish-key -d | ||
- chmod u=rw,og= ~/.ssh/publish-key | ||
- echo "Host github.com" >> ~/.ssh/config | ||
- echo " IdentityFile ~/.ssh/publish-key" >> ~/.ssh/config | ||
- sudo apt-get -qq update | ||
- sudo apt-get install graphviz | ||
- git --version | ||
- git remote set-url origin git@github.com:ebu/ebu-tt-live-toolkit.git | ||
- git fetch origin -f gh-pages:gh-pages | ||
|
||
install: | ||
- pip install pip==9.0.1 | ||
- make | ||
- python setup.py develop | ||
- pip install coveralls | ||
- pip install ghp-import | ||
- pip install -U pip | ||
- make init | ||
|
||
script: | ||
- pyxbgen --binding-root=./ebu_tt_live/bindings -m __init__ --schema-root=./ebu_tt_live/xsd/ -r -u ebutt_all.xsd | ||
- python setup.py test | ||
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST | ||
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi) | ||
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH" | ||
|
||
after_success: | ||
- coveralls | ||
- make test | ||
- echo "Compiling documentation" | ||
- make | ||
- sudo apt-get -qq update | ||
- sudo apt-get install graphviz | ||
- python setup.py build_sphinx | ||
- if [ $BRANCH == "master" ]; then ghp-import -n -p -m "Update gh-pages." docs/build; fi | ||
|
||
notifications: | ||
slack: | ||
secure: RLs+ufYg4HcZfaTl73tTKKVja8DJ9LGk1WO+7B1qa4Fgpv0c/3uXcM+6tvDXllTlqcfLHgum0vbzvE4yapo0em0g/m75t1pEfkh5Pfrcas8IKAM9jg/xycWdYoAkKLRvNOcS4amO29FlzOHFaSSjX+V8JK8Mpm+QM2eGnqIbJokaXgBf/bQxHqGSRvYCeSisEG0f79Mn/0v5OOlbvmetFfvcQVNZDtgpA1CDbvK99F/vQT3qZ04Rh/vRnlcZyH9PEp/TEEJ0yX0NhHYEDnuBKPc86Ack/YCQpT12Ej2xTWjgoUrqv1pcr+h0ltYPXnnCyETrlbeLgNIMUsGW579MThqXekBZ7byRK2DMfjyL5+UgPSmTOIzEg7Qbc1u0r1bUuEi7nsJ5Vf65QeIAcewVASOUKmda9ag0MidTR/VoAsMtf5MzbDifSa1aBHRxZJToshNJVY9V8/lJLdwsbqsG2H+8v8ZuzyRLNiaFhNQTZQWpRXMipvbTDnnVxwpeFiLAqAwEKO9KIyGijqv2yeVvi4WtYvwzM7/1y/ycu7kTDFemKKuKmW2rzzBKJ30vo79ufMQCmn0riKkpaNxBf8R3EUEr86A9yuFpo6/Qc47i3PkeD7MszDqhEAfxl1+sQssWXOdVy6ALFb7RZ6EczpPvAjYLLO0aPa8OPaZjy3aJr+8= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Denesting of EBU-TT-Live documents | ||
====================================== | ||
|
||
DenesterNode should be used when a EBU-TT-3 document has a div that contains | ||
other divs, or a span contains another span, and those nested elements need | ||
to be flattened, for example before conversion to EBU-TT-D. These elements | ||
are not able to be nested inside each other in EBU-TT-D documents. | ||
|
||
When documents are Denested, any nested elements must be removed from | ||
their parent elements, while retaining attributes they would have inherited. | ||
To address this, the DenesterNode node processes the | ||
document(s) with the | ||
:py:func:`ebu_tt_live.node.denester.DenesterNode.recurse` and | ||
:py:func:`ebu_tt_live.node.denester.DenesterNode.recurse_span` | ||
functions. These will iterate through the file to locate the deepest | ||
nested element, and create a new copy of it with its content and | ||
expected inherited attributes. The end result is a file containing | ||
these newly created divs/spans in place of the nested ones. | ||
|
||
Once the new divs and spans are created, divs that are sequential in | ||
the list of divs and have the same attributes are combined into a single | ||
div. This is done by the | ||
:py:func:`ebu_tt_live.node.denester.DenesterNode.combine_divs` | ||
function to reduce the number of divs in the resulting file. | ||
|
||
In the combined divs, every p element should have the same region | ||
as its parent div. Any p elements that specify a different region | ||
to their inherited region are removed here: as per TTML semantics, | ||
such p elements are never presented. | ||
The | ||
:py:func:`ebu_tt_live.node.denester.DenesterNode.check_p_regions` | ||
function iterates through the divs that have an assigned region and | ||
removes any p where its region does not match. | ||
It then removes the region attribute from any remaining p, as it will | ||
inhert the region of its parent div and the attribute is unnecessary. | ||
It will also remove any now-empty divs that exist as a result of having | ||
their p elements removed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.