mirror of
https://github.com/iluvcapra/pycmx.git
synced 2025-12-31 17:00:53 +00:00
Compare commits
9 Commits
1b0ccd4ef7
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 688402d195 | |||
| 4e81810584 | |||
| faf2596a57 | |||
| 1e9fbe339c | |||
| a8d00470d4 | |||
| fe1e59e731 | |||
| ec8a08074d | |||
|
|
ef683a7683 | ||
|
|
d778f64230 |
5
.flake8
5
.flake8
@@ -1,5 +0,0 @@
|
|||||||
[flake8]
|
|
||||||
per-file-ignores =
|
|
||||||
src/pycmx/__init__.py: F401
|
|
||||||
tests/__init__.py: F401
|
|
||||||
|
|
||||||
6
.github/workflows/python-package.yml
vendored
6
.github/workflows/python-package.yml
vendored
@@ -27,11 +27,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install -e .[dev]
|
python -m pip install -e .[dev]
|
||||||
- name: Lint with flake8
|
- name: Lint with ruff
|
||||||
run: |
|
run: |
|
||||||
# stop the build if there are Python syntax errors or undefined names
|
ruff check src/
|
||||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
||||||
flake8 . --count --max-line-length=79 --statistics
|
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
pytest
|
pytest
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ build:
|
|||||||
jobs:
|
jobs:
|
||||||
install:
|
install:
|
||||||
- pip install --upgrade pip
|
- pip install --upgrade pip
|
||||||
- pip install --group 'doc'
|
- pip install --group 'doc' -e .
|
||||||
|
|
||||||
# Build documentation in the docs/ directory with Sphinx
|
# Build documentation in the docs/ directory with Sphinx
|
||||||
sphinx:
|
sphinx:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ The `pycmx` package parses a CMX 3600 EDL and its most most common variations.
|
|||||||
read. Event number field and source name field sizes are determined
|
read. Event number field and source name field sizes are determined
|
||||||
dynamically for each statement for a high level of compliance at the expense
|
dynamically for each statement for a high level of compliance at the expense
|
||||||
of strictness.
|
of strictness.
|
||||||
* An more relaxed "tolerant" mode allows parsing of an EDL file where columns
|
* A more relaxed "tolerant" mode allows parsing of an EDL file where columns
|
||||||
use non-standard widths.
|
use non-standard widths.
|
||||||
* Preserves relationship between events and individual edits/clips.
|
* Preserves relationship between events and individual edits/clips.
|
||||||
* Remark or comment fields with common recognized forms are read and
|
* Remark or comment fields with common recognized forms are read and
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
name = "pycmx"
|
name = "pycmx"
|
||||||
version = "1.5.0"
|
version = "1.5.0"
|
||||||
description = "Python CMX 3600 Edit Decision List Parser"
|
description = "Python CMX 3600 Edit Decision List Parser"
|
||||||
authors = [{name = "Jamie Hardt", email= "<jamiehardt@me.com>"}]
|
authors = [{name = "Jamie Hardt", email= "jamiehardt@me.com"}]
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
keywords = [
|
keywords = [
|
||||||
@@ -29,11 +29,11 @@ classifiers = [
|
|||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
doc = [
|
doc = [
|
||||||
'sphinx >= 5.3.0',
|
'sphinx >= 5.3.0',
|
||||||
'sphinx_rtd_theme >= 1.1.1'
|
'sphinx_rtd_theme >= 1.1.1',
|
||||||
]
|
]
|
||||||
dev = [
|
dev = [
|
||||||
'flake8',
|
'pytest',
|
||||||
'pytest'
|
'ruff>=0.14.10'
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
@@ -43,23 +43,37 @@ Repository = "https://github.com/iluvcapra/pycmx.git"
|
|||||||
Tracker = "https://github.com/iluvcapra/pycmx/issues"
|
Tracker = "https://github.com/iluvcapra/pycmx/issues"
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
|
dev = ['ruff', 'pytest']
|
||||||
doc = ['sphinx', 'sphinx_rtd_theme']
|
doc = ['sphinx', 'sphinx_rtd_theme']
|
||||||
|
|
||||||
|
|
||||||
[tool.pyright]
|
[tool.pyright]
|
||||||
typeCheckingMode = "basic"
|
typeCheckingMode = "basic"
|
||||||
|
|
||||||
[tool.pylint]
|
[tool.ruff]
|
||||||
max-line-length = 88
|
line-length = 88
|
||||||
disable = [
|
indent-width = 4
|
||||||
"C0103", # (invalid-name)
|
|
||||||
"C0114", # (missing-module-docstring)
|
[tool.ruff.lint]
|
||||||
"C0115", # (missing-class-docstring)
|
select = ["E", "F", "W"]
|
||||||
"C0116", # (missing-function-docstring)
|
|
||||||
"R0903", # (too-few-public-methods)
|
[tool.ruff.format]
|
||||||
"R0913", # (too-many-arguments)
|
docstring-code-line-length = 88
|
||||||
"W0105", # (pointless-string-statement)
|
|
||||||
]
|
# [tool.pylint]
|
||||||
|
# max-line-length = 88
|
||||||
|
# disable = [
|
||||||
|
# "C0103", # (invalid-name)
|
||||||
|
# "C0114", # (missing-module-docstring)
|
||||||
|
# "C0115", # (missing-class-docstring)
|
||||||
|
# "C0116", # (missing-function-docstring)
|
||||||
|
# "R0903", # (too-few-public-methods)
|
||||||
|
# "R0913", # (too-many-arguments)
|
||||||
|
# "W0105", # (pointless-string-statement)
|
||||||
|
# ]
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["uv_build>=0.9.18,<0.10.0"]
|
requires = ["uv_build>=0.9.18,<0.10.0"]
|
||||||
|
|||||||
@@ -11,3 +11,5 @@ from .parse_cmx_events import parse_cmx3600
|
|||||||
from .transition import Transition
|
from .transition import Transition
|
||||||
from .event import Event
|
from .event import Event
|
||||||
from .edit import Edit
|
from .edit import Edit
|
||||||
|
|
||||||
|
__all__ = ("parse_cmx3600", "Transition", "Event", "Edit")
|
||||||
|
|||||||
@@ -31,12 +31,27 @@ class Event:
|
|||||||
will have multiple edits when a dissolve, wipe or key transition needs
|
will have multiple edits when a dissolve, wipe or key transition needs
|
||||||
to be performed.
|
to be performed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# FTR this is a totall bonkers way of doing this, I wrote this when
|
||||||
|
# I was still learning Python and I'm sure there's easier ways to do
|
||||||
|
# it. The job is complicated because multiple edits can occur in one
|
||||||
|
# event and then other statements can modify the event in different
|
||||||
|
# ways.
|
||||||
|
|
||||||
edits_audio = list(self._statements_with_audio_ext())
|
edits_audio = list(self._statements_with_audio_ext())
|
||||||
clip_names = self._clip_name_statements()
|
clip_names = self._clip_name_statements()
|
||||||
source_files = self._source_file_statements()
|
source_files = self._source_file_statements()
|
||||||
|
|
||||||
|
# We first get the edit events combined with their extra audio
|
||||||
|
# channel statements, if any.
|
||||||
|
|
||||||
|
# The list the_zip contains one element for each initialization
|
||||||
|
# parameter in Edit()
|
||||||
the_zip: List[List[Any]] = [edits_audio]
|
the_zip: List[List[Any]] = [edits_audio]
|
||||||
|
|
||||||
|
# If there are two Clip Name statements and two edits, we look for
|
||||||
|
# "FROM" and "TO" clip name lines. Otherwise we just look for on
|
||||||
|
# each per edit.
|
||||||
if len(edits_audio) == 2:
|
if len(edits_audio) == 2:
|
||||||
start_name: Optional[StmtClipName] = None
|
start_name: Optional[StmtClipName] = None
|
||||||
end_name: Optional[StmtClipName] = None
|
end_name: Optional[StmtClipName] = None
|
||||||
@@ -54,6 +69,10 @@ class Event:
|
|||||||
else:
|
else:
|
||||||
the_zip.append([None] * len(edits_audio))
|
the_zip.append([None] * len(edits_audio))
|
||||||
|
|
||||||
|
# if there's one source file statemnent per clip, we allocate them to
|
||||||
|
# each edit in order. Otherwise if there's only one, we assign the one
|
||||||
|
# to all the edits. If there's no source_file statements, we provide
|
||||||
|
# None.
|
||||||
if len(edits_audio) == len(source_files):
|
if len(edits_audio) == len(source_files):
|
||||||
the_zip.append(source_files)
|
the_zip.append(source_files)
|
||||||
elif len(source_files) == 1:
|
elif len(source_files) == 1:
|
||||||
@@ -61,7 +80,7 @@ class Event:
|
|||||||
else:
|
else:
|
||||||
the_zip.append([None] * len(edits_audio))
|
the_zip.append([None] * len(edits_audio))
|
||||||
|
|
||||||
# attach trans name to last event
|
# attach effects name to last event
|
||||||
try:
|
try:
|
||||||
trans_statement = self._trans_name_statements()[0]
|
trans_statement = self._trans_name_statements()[0]
|
||||||
trans_names: List[Optional[Any]] = [None] * (len(edits_audio) - 1)
|
trans_names: List[Optional[Any]] = [None] * (len(edits_audio) - 1)
|
||||||
@@ -69,6 +88,7 @@ class Event:
|
|||||||
the_zip.append(trans_names)
|
the_zip.append(trans_names)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
the_zip.append([None] * len(edits_audio))
|
the_zip.append([None] * len(edits_audio))
|
||||||
|
|
||||||
return [Edit(edit_statement=e1[0],
|
return [Edit(edit_statement=e1[0],
|
||||||
audio_ext_statement=e1[1],
|
audio_ext_statement=e1[1],
|
||||||
clip_name_statement=n1,
|
clip_name_statement=n1,
|
||||||
|
|||||||
Reference in New Issue
Block a user