Ruff autofixes

This commit is contained in:
2026-09-17 14:44:46 -07:00
parent 9fd5d36611
commit daedabd7cc
10 changed files with 66 additions and 44 deletions
+4 -5
View File
@@ -1,10 +1,9 @@
import pycmx
import re
import argparse
import logging
import re
import sys
import logging
import pycmx
FORMAT = '%(asctime)-15s %(message)s'
logging.basicConfig(format=FORMAT)
@@ -21,7 +20,7 @@ def all_video_edits(edl):
def get_scene_name(edit, pattern):
scene_extractor = re.compile(pattern, re.I)
scene_extractor = re.compile(pattern, re.IGNORECASE)
if edit.clip_name is None:
return None
else:
+8 -8
View File
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
@@ -15,14 +14,15 @@
import importlib
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- Project information -----------------------------------------------------
project = u'pycmx'
copyright = u'(c) 2018-2025, Jamie Hardt'
author = u'Jamie Hardt'
project = 'pycmx'
copyright = '(c) 2018-2025, Jamie Hardt'
author = 'Jamie Hardt'
release = importlib.metadata.version("pycmx")
version = release
@@ -134,8 +134,8 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pycmx.tex', u'pycmx Documentation',
u'Jamie Hardt', 'manual'),
(master_doc, 'pycmx.tex', 'pycmx Documentation',
'Jamie Hardt', 'manual'),
]
@@ -144,7 +144,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pycmx', u'pycmx Documentation',
(master_doc, 'pycmx', 'pycmx Documentation',
[author], "3p")
]
@@ -155,7 +155,7 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pycmx', u'pycmx Documentation',
(master_doc, 'pycmx', 'pycmx Documentation',
author, 'pycmx', 'One line description of project.',
'Miscellaneous'),
]
+1 -1
View File
@@ -55,7 +55,7 @@ line-length = 88
indent-width = 4
[tool.ruff.lint]
select = ["E", "F", "W"]
# select = ["E", "F", "W"]
[tool.ruff.format]
docstring-code-line-length = 88
+3 -4
View File
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pycmx is a parser for CMX 3600-style EDLs.
@@ -7,9 +6,9 @@ copy and reuse this software, refer to the LICENSE file included with the
distribution.
"""
from .edit import Edit
from .event import Event
from .parse_cmx_events import parse_cmx3600
from .transition import Transition
from .event import Event
from .edit import Edit
__all__ = ("parse_cmx3600", "Transition", "Event", "Edit")
__all__ = ("Edit", "Event", "Transition", "parse_cmx3600")
+2 -2
View File
@@ -1,8 +1,8 @@
# pycmx
# (c) 2018-2025 Jamie Hardt
from re import (compile, match)
from typing import Dict, Tuple, Generator
from re import compile, match
from typing import Dict, Generator, Tuple
class ChannelMap:
+7 -7
View File
@@ -1,21 +1,21 @@
# pycmx
# (c) 2018-2025 Jamie Hardt
from typing import Optional
from .cdl import AscSopComponents, FramecountTriple
from .channel_map import ChannelMap
from .statements import (
StmtAudioExt,
StmtCdlSat,
StmtCdlSop,
StmtFrmc,
StmtEvent,
StmtAudioExt,
StmtClipName,
StmtSourceFile,
StmtEffectsName,
StmtEvent,
StmtFrmc,
StmtSourceFile,
)
from .transition import Transition
from .channel_map import ChannelMap
from typing import Optional
class Edit:
+10 -5
View File
@@ -1,13 +1,18 @@
# pycmx
# (c) 2018-2025 Jamie Hardt
from .statements import (StmtCorruptRemark, StmtTitle, StmtEvent,
StmtUnrecognized, StmtSourceUMID)
from .event import Event
from .channel_map import ChannelMap
from typing import Any, Generator
from .channel_map import ChannelMap
from .event import Event
from .statements import (
StmtCorruptRemark,
StmtEvent,
StmtSourceUMID,
StmtTitle,
StmtUnrecognized,
)
class EditList:
"""
+13 -5
View File
@@ -1,12 +1,20 @@
# pycmx
# (c) 2023-2025 Jamie Hardt
from .statements import (StmtFrmc, StmtEvent, StmtClipName, StmtSourceFile,
StmtAudioExt, StmtUnrecognized, StmtEffectsName,
StmtCdlSop, StmtCdlSat)
from .edit import Edit
from typing import Any, Generator, List, Optional, Tuple
from typing import List, Generator, Optional, Tuple, Any
from .edit import Edit
from .statements import (
StmtAudioExt,
StmtCdlSat,
StmtCdlSop,
StmtClipName,
StmtEffectsName,
StmtEvent,
StmtFrmc,
StmtSourceFile,
StmtUnrecognized,
)
class Event:
+1 -1
View File
@@ -3,8 +3,8 @@
from typing import TextIO
from .parse_cmx_statements import (parse_cmx3600_statements)
from .edit_list import EditList
from .parse_cmx_statements import parse_cmx3600_statements
def parse_cmx3600(f: TextIO, tolerant: bool = False) -> EditList:
+17 -6
View File
@@ -2,14 +2,25 @@
# (c) 2018-2025 Jamie Hardt
import re
from typing import TextIO, List
from typing import List, TextIO
from .cdl import AscSopComponents, Rgb
from .statements import (StmtCdlSat, StmtCdlSop, StmtCorruptRemark, StmtFrmc,
StmtRemark, StmtTitle, StmtUnrecognized, StmtFCM,
StmtAudioExt, StmtClipName, StmtEffectsName,
StmtEvent, StmtSourceFile, StmtSplitEdit)
from .statements import (
StmtAudioExt,
StmtCdlSat,
StmtCdlSop,
StmtClipName,
StmtCorruptRemark,
StmtEffectsName,
StmtEvent,
StmtFCM,
StmtFrmc,
StmtRemark,
StmtSourceFile,
StmtSplitEdit,
StmtTitle,
StmtUnrecognized,
)
from .util import collimate