mirror of
https://github.com/iluvcapra/pycmx.git
synced 2025-12-31 17:00:53 +00:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
595cf35e57 | ||
|
|
7fa22d4b85 | ||
|
|
42f2de54b5 | ||
|
|
f7d1432014 | ||
|
|
db4eadb73e | ||
|
|
3305bc7920 | ||
|
|
6ba77b3568 | ||
|
|
c68f8bca80 | ||
|
|
284267c9c0 | ||
|
|
bd196f2dbf | ||
|
|
b14a9a6319 | ||
|
|
0cbd01f418 | ||
|
|
50d48708e9 | ||
|
|
f67c4ac2c5 | ||
|
|
1b8a3c3288 | ||
|
|
b37b57d7c9 | ||
|
|
a9937683e5 | ||
|
|
4fae65fa8d | ||
|
|
566e6257f4 | ||
|
|
c56d2066ad | ||
|
|
8b49a788ae | ||
|
|
b31450f03d | ||
|
|
5d14c3177a | ||
|
|
08dea6031d | ||
|
|
d23fa33558 | ||
|
|
fcc4732d1a | ||
|
|
47c1ad96f0 | ||
|
|
804f649570 | ||
|
|
58483198c3 | ||
|
|
aa01e9ad2d | ||
|
|
464052f510 | ||
|
|
3ba28a61dd |
40
.github/workflows/python-package.yml
vendored
Normal file
40
.github/workflows/python-package.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
||||||
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||||
|
|
||||||
|
name: Python package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v4.3.0
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install flake8 pytest
|
||||||
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||||
|
- name: Lint with flake8
|
||||||
|
run: |
|
||||||
|
# stop the build if there are Python syntax errors or undefined names
|
||||||
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||||
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||||
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||||
|
- name: Test with pytest
|
||||||
|
run: |
|
||||||
|
pytest
|
||||||
26
.github/workflows/pythonpublish.yml
vendored
Normal file
26
.github/workflows/pythonpublish.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Upload Python Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install setuptools wheel twine
|
||||||
|
- name: Build and publish
|
||||||
|
env:
|
||||||
|
TWINE_USERNAME: __token__
|
||||||
|
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }}
|
||||||
|
run: |
|
||||||
|
python setup.py sdist bdist_wheel
|
||||||
|
twine upload dist/*
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@
|
|||||||
|
|
||||||
# Vim Swapfiles
|
# Vim Swapfiles
|
||||||
*.swp
|
*.swp
|
||||||
|
.DS_Store
|
||||||
|
|||||||
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
# Default ignored files
|
||||||
|
/workspace.xml
|
||||||
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
||||||
4
.idea/misc.xml
generated
Normal file
4
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
||||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/pycmx.iml" filepath="$PROJECT_DIR$/.idea/pycmx.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
11
.idea/pycmx.iml
generated
Normal file
11
.idea/pycmx.iml
generated
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="PYTHON_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
<component name="TestRunnerService">
|
||||||
|
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
14
.travis.yml
14
.travis.yml
@@ -1,8 +1,18 @@
|
|||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
|
- "3.8"
|
||||||
|
- "3.7"
|
||||||
- "3.6"
|
- "3.6"
|
||||||
- "3.5"
|
- "3.5"
|
||||||
|
- "2.7"
|
||||||
script:
|
script:
|
||||||
- "python3 setup.py test"
|
- "python setup.py test"
|
||||||
|
- "py.test tests/ -v --cov pycmx --cov-report term-missing"
|
||||||
install:
|
install:
|
||||||
- "pip3 install setuptools"
|
- "pip install setuptools"
|
||||||
|
before_install:
|
||||||
|
- "pip install coverage"
|
||||||
|
- "pip install codecov"
|
||||||
|
- "pip install pytest-cov==2.5.0"
|
||||||
|
after_success:
|
||||||
|
- "codecov"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
[](https://travis-ci.com/iluvcapra/pycmx)
|
[](https://travis-ci.com/iluvcapra/pycmx)
|
||||||
|
[](https://codecov.io/gh/iluvcapra/pycmx)
|
||||||
[](https://pycmx.readthedocs.io/en/latest/?badge=latest)   [](https://pypi.org/project/pycmx/) 
|
[](https://pycmx.readthedocs.io/en/latest/?badge=latest)   [](https://pypi.org/project/pycmx/) 
|
||||||
|
|
||||||
|
|
||||||
@@ -83,10 +84,4 @@ Audio channel 7 is present
|
|||||||
False
|
False
|
||||||
```
|
```
|
||||||
|
|
||||||
## Should I Use This?
|
|
||||||
|
|
||||||
At this time, this is (at best) beta software. I feel like the interface is
|
|
||||||
about where where I'd like it to be but more testing is required.
|
|
||||||
|
|
||||||
Contributions are welcome and will make this module production-ready all the
|
|
||||||
faster! Please reach out or file a ticket!
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ copy and reuse this software, refer to the LICENSE file included with the
|
|||||||
distribution.
|
distribution.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = '1.0'
|
__version__ = '1.1.1'
|
||||||
__author__ = 'Jamie Hardt'
|
__author__ = 'Jamie Hardt'
|
||||||
|
|
||||||
from .parse_cmx_events import parse_cmx3600
|
from .parse_cmx_events import parse_cmx3600
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ class ChannelMap:
|
|||||||
'True if video is included'
|
'True if video is included'
|
||||||
return self.v
|
return self.v
|
||||||
|
|
||||||
|
@property
|
||||||
|
def audio(self):
|
||||||
|
'True if an audio channel is included'
|
||||||
|
return len(self._audio_channel_set) > 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def channels(self):
|
def channels(self):
|
||||||
'A generator for each audio channel'
|
'A generator for each audio channel'
|
||||||
@@ -81,7 +86,7 @@ class ChannelMap:
|
|||||||
self._audio_channel_set.remove(chan_num)
|
self._audio_channel_set.remove(chan_num)
|
||||||
|
|
||||||
def _append_event(self, event_str):
|
def _append_event(self, event_str):
|
||||||
alt_channel_re = compile('^A(\d+)')
|
alt_channel_re = compile(r'^A(\d+)')
|
||||||
if event_str in self._chan_map:
|
if event_str in self._chan_map:
|
||||||
channels = self._chan_map[event_str]
|
channels = self._chan_map[event_str]
|
||||||
self.v = channels[0]
|
self.v = channels[0]
|
||||||
@@ -93,8 +98,8 @@ class ChannelMap:
|
|||||||
self.set_audio_channel(int( matchresult.group(1)), True )
|
self.set_audio_channel(int( matchresult.group(1)), True )
|
||||||
|
|
||||||
def _append_ext(self, audio_ext):
|
def _append_ext(self, audio_ext):
|
||||||
self.a3 = ext.audio3
|
self.a3 = audio_ext.audio3
|
||||||
self.a4 = ext.audio4
|
self.a4 = audio_ext.audio4
|
||||||
|
|
||||||
def __or__(self, other):
|
def __or__(self, other):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -70,12 +70,12 @@ class Transition:
|
|||||||
@property
|
@property
|
||||||
def key_background(self):
|
def key_background(self):
|
||||||
"`True` if this edit is a key background."
|
"`True` if this edit is a key background."
|
||||||
return self.transition == KeyBackground
|
return self.transition == Transition.KeyBackground
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def key_foreground(self):
|
def key_foreground(self):
|
||||||
"`True` if this edit is a key foreground."
|
"`True` if this edit is a key foreground."
|
||||||
return self.transition == Key
|
return self.transition == Transition.Key
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def key_out(self):
|
def key_out(self):
|
||||||
@@ -83,4 +83,4 @@ class Transition:
|
|||||||
`True` if this edit is a key out. This material will removed from
|
`True` if this edit is a key out. This material will removed from
|
||||||
the key foreground and replaced with the key background.
|
the key foreground and replaced with the key background.
|
||||||
"""
|
"""
|
||||||
return self.transition == KeyOut
|
return self.transition == Transition.KeyOut
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
|
|
||||||
10
setup.py
10
setup.py
@@ -4,7 +4,7 @@ with open("README.md", "r") as fh:
|
|||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
setup(name='pycmx',
|
setup(name='pycmx',
|
||||||
version='1.0',
|
version='1.1.4',
|
||||||
author='Jamie Hardt',
|
author='Jamie Hardt',
|
||||||
author_email='jamiehardt@me.com',
|
author_email='jamiehardt@me.com',
|
||||||
description='CMX 3600 Edit Decision List Parser',
|
description='CMX 3600 Edit Decision List Parser',
|
||||||
@@ -16,8 +16,10 @@ setup(name='pycmx',
|
|||||||
'Topic :: Multimedia',
|
'Topic :: Multimedia',
|
||||||
'Topic :: Multimedia :: Video',
|
'Topic :: Multimedia :: Video',
|
||||||
'Topic :: Text Processing',
|
'Topic :: Text Processing',
|
||||||
'Programming Language :: Python :: 3 :: Only',
|
'Programming Language :: Python :: 3.6',
|
||||||
'Programming Language :: Python :: 3.5',
|
'Programming Language :: Python :: 3.7',
|
||||||
'Programming Language :: Python :: 3.6'
|
'Programming Language :: Python :: 3.8',
|
||||||
|
'Programming Language :: Python :: 3.9',
|
||||||
|
'Programming Language :: Python :: 3.10'
|
||||||
],
|
],
|
||||||
packages=['pycmx'])
|
packages=['pycmx'])
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class TestParse(TestCase):
|
|||||||
self.assertFalse( events[0].edits[0].channels.a1)
|
self.assertFalse( events[0].edits[0].channels.a1)
|
||||||
self.assertTrue( events[0].edits[0].channels.a2)
|
self.assertTrue( events[0].edits[0].channels.a2)
|
||||||
self.assertTrue( events[2].edits[0].channels.get_audio_channel(7) )
|
self.assertTrue( events[2].edits[0].channels.get_audio_channel(7) )
|
||||||
|
self.assertTrue( events[2].edits[0].channels.audio)
|
||||||
|
|
||||||
|
|
||||||
def test_multi_edit_events(self):
|
def test_multi_edit_events(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user