From daedabd7cc3315afb8f11781c56255ef05bc9162 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Thu, 17 Sep 2026 14:44:46 -0700 Subject: [PATCH] Ruff autofixes --- bin/edl2scenelist.py | 9 ++++----- docs/source/conf.py | 16 ++++++++-------- pyproject.toml | 2 +- src/pycmx/__init__.py | 7 +++---- src/pycmx/channel_map.py | 4 ++-- src/pycmx/edit.py | 14 +++++++------- src/pycmx/edit_list.py | 15 ++++++++++----- src/pycmx/event.py | 18 +++++++++++++----- src/pycmx/parse_cmx_events.py | 2 +- src/pycmx/parse_cmx_statements.py | 23 +++++++++++++++++------ 10 files changed, 66 insertions(+), 44 deletions(-) diff --git a/bin/edl2scenelist.py b/bin/edl2scenelist.py index 54cbbac..48336f5 100644 --- a/bin/edl2scenelist.py +++ b/bin/edl2scenelist.py @@ -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: diff --git a/docs/source/conf.py b/docs/source/conf.py index ac8fd02..3c03a1e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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'), ] diff --git a/pyproject.toml b/pyproject.toml index 256057a..454af67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 diff --git a/src/pycmx/__init__.py b/src/pycmx/__init__.py index 5fdcbd1..7bf6399 100644 --- a/src/pycmx/__init__.py +++ b/src/pycmx/__init__.py @@ -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") diff --git a/src/pycmx/channel_map.py b/src/pycmx/channel_map.py index 3783539..542d780 100644 --- a/src/pycmx/channel_map.py +++ b/src/pycmx/channel_map.py @@ -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: diff --git a/src/pycmx/edit.py b/src/pycmx/edit.py index ca6edfa..b42a605 100644 --- a/src/pycmx/edit.py +++ b/src/pycmx/edit.py @@ -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: diff --git a/src/pycmx/edit_list.py b/src/pycmx/edit_list.py index d5ec58d..819b5fd 100644 --- a/src/pycmx/edit_list.py +++ b/src/pycmx/edit_list.py @@ -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: """ diff --git a/src/pycmx/event.py b/src/pycmx/event.py index 40a93ca..6067c35 100644 --- a/src/pycmx/event.py +++ b/src/pycmx/event.py @@ -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: diff --git a/src/pycmx/parse_cmx_events.py b/src/pycmx/parse_cmx_events.py index 10bd142..e8f38ae 100644 --- a/src/pycmx/parse_cmx_events.py +++ b/src/pycmx/parse_cmx_events.py @@ -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: diff --git a/src/pycmx/parse_cmx_statements.py b/src/pycmx/parse_cmx_statements.py index 7408370..82a8573 100644 --- a/src/pycmx/parse_cmx_statements.py +++ b/src/pycmx/parse_cmx_statements.py @@ -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