mirror of
https://github.com/iluvcapra/pycmx.git
synced 2026-01-02 18:00:55 +00:00
Compare commits
5 Commits
19-unusual
...
a8f35a9ffc
| Author | SHA1 | Date | |
|---|---|---|---|
| a8f35a9ffc | |||
|
|
242f2e08d5 | ||
| 610d406e97 | |||
| 28307608fc | |||
| 9ab3804c89 |
@@ -14,7 +14,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
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# pycmx
|
# pycmx
|
||||||
# (c) 2018-2025 Jamie Hardt
|
# (c) 2018-2025 Jamie Hardt
|
||||||
|
|
||||||
from pycmx.cdl import AscSopComponents, FramecountTriple
|
from .cdl import AscSopComponents, FramecountTriple
|
||||||
from pycmx.statements import (
|
from .statements import (
|
||||||
StmtCdlSat,
|
StmtCdlSat,
|
||||||
StmtCdlSop,
|
StmtCdlSop,
|
||||||
StmtFrmc,
|
StmtFrmc,
|
||||||
@@ -177,6 +177,16 @@ class Edit:
|
|||||||
|
|
||||||
return self._asc_sop_statement.cdl_sop
|
return self._asc_sop_statement.cdl_sop
|
||||||
|
|
||||||
|
@property
|
||||||
|
def asc_sop_raw(self) -> Optional[str]:
|
||||||
|
"""
|
||||||
|
ASC CDL Slope-Offset-Power statement raw line
|
||||||
|
"""
|
||||||
|
if self._asc_sop_statement is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
return self._asc_sop_statement.line
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def asc_sat(self) -> Optional[float]:
|
def asc_sat(self) -> Optional[float]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# pycmx
|
# pycmx
|
||||||
# (c) 2018-2025 Jamie Hardt
|
# (c) 2018-2025 Jamie Hardt
|
||||||
|
|
||||||
from pycmx.statements import (StmtCorruptRemark, StmtTitle, StmtEvent,
|
from .statements import (StmtCorruptRemark, StmtTitle, StmtEvent,
|
||||||
StmtUnrecognized, StmtSourceUMID)
|
StmtUnrecognized, StmtSourceUMID)
|
||||||
from .event import Event
|
from .event import Event
|
||||||
from .channel_map import ChannelMap
|
from .channel_map import ChannelMap
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
# pycmx
|
# pycmx
|
||||||
# (c) 2023-2025 Jamie Hardt
|
# (c) 2023-2025 Jamie Hardt
|
||||||
|
|
||||||
from pycmx.statements import StmtFrmc
|
from .statements import (StmtFrmc, StmtEvent, StmtClipName, StmtSourceFile,
|
||||||
from .parse_cmx_statements import (
|
StmtAudioExt, StmtUnrecognized, StmtEffectsName,
|
||||||
StmtEvent, StmtClipName, StmtSourceFile, StmtAudioExt, StmtUnrecognized,
|
StmtCdlSop, StmtCdlSat)
|
||||||
StmtEffectsName, StmtCdlSop, StmtCdlSat)
|
|
||||||
from .edit import Edit
|
from .edit import Edit
|
||||||
|
|
||||||
from typing import List, Generator, Optional, Tuple, Any
|
from typing import List, Generator, Optional, Tuple, Any
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import re
|
import re
|
||||||
from typing import TextIO, List
|
from typing import TextIO, List
|
||||||
|
|
||||||
from pycmx.cdl import AscSopComponents, Rgb
|
from .cdl import AscSopComponents, Rgb
|
||||||
|
|
||||||
from .statements import (StmtCdlSat, StmtCdlSop, StmtCorruptRemark, StmtFrmc,
|
from .statements import (StmtCdlSat, StmtCdlSop, StmtCorruptRemark, StmtFrmc,
|
||||||
StmtRemark, StmtTitle, StmtUnrecognized, StmtFCM,
|
StmtRemark, StmtTitle, StmtUnrecognized, StmtFCM,
|
||||||
@@ -60,9 +60,8 @@ def _parse_cmx3600_line(line: str, line_number: int,
|
|||||||
source_field_len = len(line) - (event_field_len + 65)
|
source_field_len = len(line) - (event_field_len + 65)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return _parse_columns_for_standard_form(line, event_field_len,
|
return _parse_columns_for_standard_form(
|
||||||
source_field_len,
|
line, event_field_len, source_field_len, line_number)
|
||||||
line_number)
|
|
||||||
|
|
||||||
except EventFormError:
|
except EventFormError:
|
||||||
if tolerant:
|
if tolerant:
|
||||||
@@ -134,15 +133,19 @@ def _parse_remark(line, line_number) -> object:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
return StmtCdlSop(cdl_sop=AscSopComponents(
|
return StmtCdlSop(line=line,
|
||||||
slope=Rgb(red=float(v[0][0]), green=float(v[0][1]),
|
cdl_sop=AscSopComponents(
|
||||||
blue=float(v[0][2])),
|
slope=Rgb(red=float(v[0][0]),
|
||||||
offset=Rgb(red=float(v[1][0]), green=float(v[1][1]),
|
green=float(v[0][1]),
|
||||||
blue=float(v[1][2])),
|
blue=float(v[0][2])),
|
||||||
power=Rgb(red=float(v[2][0]), green=float(v[2][1]),
|
offset=Rgb(red=float(v[1][0]),
|
||||||
blue=float(v[2][2]))
|
green=float(v[1][1]),
|
||||||
),
|
blue=float(v[1][2])),
|
||||||
line_number=line_number)
|
power=Rgb(red=float(v[2][0]),
|
||||||
|
green=float(v[2][1]),
|
||||||
|
blue=float(v[2][2]))
|
||||||
|
),
|
||||||
|
line_number=line_number)
|
||||||
|
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
return StmtCorruptRemark('ASC_SOP', e, line_number)
|
return StmtCorruptRemark('ASC_SOP', e, line_number)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from typing import Any, NamedTuple
|
from typing import Any, NamedTuple
|
||||||
|
|
||||||
from pycmx.cdl import AscSopComponents
|
from .cdl import AscSopComponents
|
||||||
|
|
||||||
# type str = str
|
# type str = str
|
||||||
|
|
||||||
@@ -50,6 +50,7 @@ class StmtSourceFile(NamedTuple):
|
|||||||
|
|
||||||
|
|
||||||
class StmtCdlSop(NamedTuple):
|
class StmtCdlSop(NamedTuple):
|
||||||
|
line: str
|
||||||
cdl_sop: AscSopComponents[float]
|
cdl_sop: AscSopComponents[float]
|
||||||
line_number: int
|
line_number: int
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pycmx"
|
name = "pycmx"
|
||||||
version = "1.4.0"
|
version = "1.5.0"
|
||||||
description = "Python CMX 3600 Edit Decision List Parser"
|
description = "Python CMX 3600 Edit Decision List Parser"
|
||||||
authors = ["Jamie Hardt <jamiehardt@me.com>"]
|
authors = ["Jamie Hardt <jamiehardt@me.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
Reference in New Issue
Block a user