17 Commits

Author SHA1 Message Date
Jamie Hardt
42f2de54b5 Update README.md
Removed "Platform Lifecycle" section, this work is done
2022-11-13 17:42:46 -08:00
Jamie Hardt
f7d1432014 Update pythonpublish.yml 2022-11-13 17:41:55 -08:00
Jamie Hardt
db4eadb73e Update python-package.yml
Updated actions/setup-python version pin
2022-11-13 17:37:50 -08:00
Jamie Hardt
3305bc7920 Removing Python 3.5 from support 2022-11-13 17:33:57 -08:00
Jamie Hardt
6ba77b3568 Adding newer python versions
to setup.rb and test grid
2022-11-13 17:32:30 -08:00
Jamie Hardt
c68f8bca80 Fixed spelling of an re 2022-11-13 17:29:10 -08:00
Jamie Hardt
284267c9c0 Fixed some bugs picked up in flake8 2022-11-13 17:25:56 -08:00
Jamie Hardt
bd196f2dbf Create python-package.yml 2022-11-13 17:21:54 -08:00
Jamie Hardt
b14a9a6319 Update .gitignore 2022-01-16 17:16:14 -08:00
Jamie Hardt
0cbd01f418 Update README.md 2020-01-05 14:55:43 -08:00
Jamie Hardt
50d48708e9 .idea files 2020-01-04 22:38:25 -08:00
Jamie Hardt
f67c4ac2c5 Update setup.py 2020-01-04 22:38:15 -08:00
Jamie Hardt
1b8a3c3288 Create pythonpublish.yml 2020-01-04 22:36:54 -08:00
Jamie Hardt
b37b57d7c9 Removed pypi upload code 2020-01-04 22:36:24 -08:00
Jamie Hardt
a9937683e5 Update setup.py 2020-01-03 09:43:38 -08:00
Jamie Hardt
4fae65fa8d Update .travis.yml
Adding python 3.8
2020-01-03 09:42:40 -08:00
Jamie Hardt
566e6257f4 Added 'audio' method to ChannelMap
Added `audio` property to channelmap to test if it contains any audio channels.
2019-08-18 10:57:16 -07:00
17 changed files with 125 additions and 12 deletions

40
.github/workflows/python-package.yml vendored Normal file
View 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
View 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
View File

@@ -10,3 +10,4 @@
# Vim Swapfiles
*.swp
.DS_Store

3
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Default ignored files
/workspace.xml

View 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
View 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
View 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
View 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
View 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>

View File

@@ -1,5 +1,6 @@
language: python
python:
- "3.8"
- "3.7"
- "3.6"
- "3.5"

View File

@@ -83,3 +83,5 @@ Audio channel 7 is present
>>> events[2].edits[0].channels.video
False
```

View File

@@ -8,7 +8,7 @@ copy and reuse this software, refer to the LICENSE file included with the
distribution.
"""
__version__ = '1.0'
__version__ = '1.1.1'
__author__ = 'Jamie Hardt'
from .parse_cmx_events import parse_cmx3600

View File

@@ -27,6 +27,11 @@ class ChannelMap:
'True if video is included'
return self.v
@property
def audio(self):
'True if an audio channel is included'
return len(self._audio_channel_set) > 0
@property
def channels(self):
'A generator for each audio channel'
@@ -81,7 +86,7 @@ class ChannelMap:
self._audio_channel_set.remove(chan_num)
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:
channels = self._chan_map[event_str]
self.v = channels[0]
@@ -93,8 +98,8 @@ class ChannelMap:
self.set_audio_channel(int( matchresult.group(1)), True )
def _append_ext(self, audio_ext):
self.a3 = ext.audio3
self.a4 = ext.audio4
self.a3 = audio_ext.audio3
self.a4 = audio_ext.audio4
def __or__(self, other):
"""

View File

@@ -70,12 +70,12 @@ class Transition:
@property
def key_background(self):
"`True` if this edit is a key background."
return self.transition == KeyBackground
return self.transition == Transition.KeyBackground
@property
def key_foreground(self):
"`True` if this edit is a key foreground."
return self.transition == Key
return self.transition == Transition.Key
@property
def key_out(self):
@@ -83,4 +83,4 @@ class Transition:
`True` if this edit is a key out. This material will removed from
the key foreground and replaced with the key background.
"""
return self.transition == KeyOut
return self.transition == Transition.KeyOut

View File

@@ -1,2 +0,0 @@
#!/bin/bash
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

View File

@@ -4,7 +4,7 @@ with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='pycmx',
version='1.0.1',
version='1.1.1',
author='Jamie Hardt',
author_email='jamiehardt@me.com',
description='CMX 3600 Edit Decision List Parser',
@@ -16,9 +16,10 @@ setup(name='pycmx',
'Topic :: Multimedia',
'Topic :: Multimedia :: Video',
'Topic :: Text Processing',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10'
],
packages=['pycmx'])

View File

@@ -66,6 +66,7 @@ class TestParse(TestCase):
self.assertFalse( events[0].edits[0].channels.a1)
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.audio)
def test_multi_edit_events(self):