From 657a5d74c0431247b9545ce1e6e6e6d7e4815532 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Sat, 14 Feb 2026 19:37:33 -0500 Subject: [PATCH 01/67] use frame from composite components without extra composite --- src/avp/gui/preview_thread.py | 8 ++++++-- src/avp/video_thread.py | 14 ++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/avp/gui/preview_thread.py b/src/avp/gui/preview_thread.py index 8507f45..d89d98e 100644 --- a/src/avp/gui/preview_thread.py +++ b/src/avp/gui/preview_thread.py @@ -60,13 +60,17 @@ def process(self): components = nextPreviewInformation["components"] for component in reversed(components): try: + isCompositeComponent = "composite" in component.properties() component.lockSize(width, height) - if "composite" in component.properties(): + if isCompositeComponent: newFrame = component.previewRender(frame) else: newFrame = component.previewRender() component.unlockSize() - frame = Image.alpha_composite(frame, newFrame) + if isCompositeComponent: + frame = newFrame + else: + frame = Image.alpha_composite(frame, newFrame) except (AttributeError, ValueError) as e: errMsg = ( diff --git a/src/avp/video_thread.py b/src/avp/video_thread.py index ecd8c4c..eac5c0f 100644 --- a/src/avp/video_thread.py +++ b/src/avp/video_thread.py @@ -238,16 +238,14 @@ def err(): frame = Image.alpha_composite( frame, self.staticComponents[layerNo] ) - + elif frame is None: # bottom-most layer + frame = comp.frameRender(bgI) elif layerNo in self.compositeComponents: - # component that uses previous frame to draw - frame = Image.alpha_composite(frame, comp.frameRender(bgI, frame)) + # component that does its own compositing + frame = comp.frameRender(bgI, frame) else: - # animated component - if frame is None: # bottom-most layer - frame = comp.frameRender(bgI) - else: - frame = Image.alpha_composite(frame, comp.frameRender(bgI)) + # normal animated component + frame = Image.alpha_composite(frame, comp.frameRender(bgI)) except Exception as e: err() return frame From c97fba1d15dcaab66b89a084388d7db0b4d87d08 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Sat, 14 Feb 2026 22:56:08 -0500 Subject: [PATCH 02/67] estimated time remaining --- src/avp/command.py | 9 +++++++++ src/avp/video_thread.py | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/avp/command.py b/src/avp/command.py index b6700a5..41cdb3a 100644 --- a/src/avp/command.py +++ b/src/avp/command.py @@ -195,7 +195,9 @@ def createAudioVisualization(self, input, output): # quit(0) after video is created self.worker.videoCreated.connect(self.videoCreated) self.lastProgressUpdate = time.time() + self.lastEstimatedTimeUpdate = time.time() self.worker.progressBarSetText.connect(self.progressBarSetText) + self.worker.estimatedTimeUpdate.connect(self.estimatedTimeUpdate) self.createVideo.emit() def stopVideo(self, *args): @@ -203,6 +205,13 @@ def stopVideo(self, *args): self.worker.cancelExport() self.worker.cancel() + @QtCore.pyqtSlot(str) + def estimatedTimeUpdate(self, value): + if time.time() - self.lastEstimatedTimeUpdate < 5.0: + return + print(value) + self.lastEstimatedTimeUpdate = time.time() + @QtCore.pyqtSlot(str) def progressBarSetText(self, value): if "Export " in value or time.time() - self.lastProgressUpdate < 0.1: diff --git a/src/avp/video_thread.py b/src/avp/video_thread.py index eac5c0f..192b1cc 100644 --- a/src/avp/video_thread.py +++ b/src/avp/video_thread.py @@ -14,6 +14,8 @@ from PIL.ImageQt import ImageQt import numpy +import time +from math import ceil import subprocess as sp import sys import os @@ -37,6 +39,7 @@ class Worker(QtCore.QObject): imageCreated = pyqtSignal("QImage") videoCreated = pyqtSignal() + estimatedTimeUpdate = pyqtSignal(str) progressBarUpdate = pyqtSignal(int) progressBarSetText = pyqtSignal(str) encoding = pyqtSignal(bool) @@ -322,6 +325,8 @@ def createVideo(self): # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # START CREATING THE VIDEO # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ + progressTimeTotal = time.time() + progressTimeBetween = 0.0 progressBarValue = 0 self.progressBarUpdate.emit(progressBarValue) # Begin piping into ffmpeg! @@ -345,9 +350,21 @@ def createVideo(self): completion = (audioI / self.audioArrayLen) * 100 if progressBarValue + 1 <= completion: progressBarValue = numpy.floor(completion).astype(int) - msg = "Exporting video: %s%%" % str(int(progressBarValue)) self.progressBarUpdate.emit(progressBarValue) - self.progressBarSetText.emit(msg) + self.progressBarSetText.emit( + f"Exporting video: {int(progressBarValue)}%" + ) + + # update estimated time until finished + curTime = time.time() + progressTimeBetween = curTime - progressTimeTotal + progressTimeTotal = curTime + minutesRemaining = ceil( + (progressTimeBetween * (100 - progressBarValue)) / 60 + ) + s = "s" if minutesRemaining != 1 else "" + timeMessage = f"About {minutesRemaining} minute{s} remaining" + self.estimatedTimeUpdate.emit(timeMessage) # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # Finished creating the video! From a97d45e1a08f279fd277c03f9045799b8e58ee87 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Tue, 3 Mar 2026 19:20:20 -0500 Subject: [PATCH 03/67] begin testing preset manager --- .gitignore | 1 - .../presets/Classic Visualizer/1/testPreset | 1 + tests/test_presetmanager.py | 26 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tests/data/config/presets/Classic Visualizer/1/testPreset create mode 100644 tests/test_presetmanager.py diff --git a/.gitignore b/.gitignore index 68c7fcb..5f7cabb 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ prof/ .env/ .vscode/ tests/data/config/log/ -tests/data/config/presets/ tests/data/config/settings.ini tests/data/config/autosave.avp *.mkv diff --git a/tests/data/config/presets/Classic Visualizer/1/testPreset b/tests/data/config/presets/Classic Visualizer/1/testPreset new file mode 100644 index 0000000..c9b2498 --- /dev/null +++ b/tests/data/config/presets/Classic Visualizer/1/testPreset @@ -0,0 +1 @@ +OrderedDict({'bars': 63, 'invert': False, 'layout': 0, 'preset': 'testPreset', 'scale': 20, 'smooth': 0, 'visColor': (159, 233, 100), 'y': 0.0}) \ No newline at end of file diff --git a/tests/test_presetmanager.py b/tests/test_presetmanager.py new file mode 100644 index 0000000..c0fd770 --- /dev/null +++ b/tests/test_presetmanager.py @@ -0,0 +1,26 @@ +from pytest import fixture +from pytestqt import qtbot +from avp.gui.presetmanager import PresetManager +from . import getTestDataPath, window + + +@fixture +def presetmanager(window, qtbot): + pm = PresetManager(window) + # ensure presetDir contains test data + # this is needed when settings are stored in /tmp + pm.presetDir = getTestDataPath("config/presets") + pm.findPresets() + qtbot.addWidget(pm) + yield pm + + +def test_presetmanager_list(presetmanager): + assert presetmanager.presets == { + "Classic Visualizer": [ + ( + 1, + "testPreset", + ), + ], + } From 461e33d98ab95d5ca0b9a6f5bda44bac1eae818a Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 28 May 2026 18:05:14 -0400 Subject: [PATCH 04/67] bump version numbers --- pyproject.toml | 5 ++--- requirements.txt | 5 ----- src/avp/__init__.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 requirements.txt diff --git a/pyproject.toml b/pyproject.toml index b02fca5..a82c226 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,18 +1,17 @@ [build-system] -requires = ["uv_build>=0.9.23,<0.10.0"] +requires = ["uv_build>=0.9.23,<=0.11.16"] build-backend = "uv_build" [project] name = "audio-visualizer-python" description = "Create audio visualization videos from a GUI or commandline" readme = "README.md" -version = "2.2.4" +version = "2.3.0" requires-python = ">= 3.12" license = "MIT" license-files = ["LICENSE", "AUTHORS"] classifiers=[ "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Intended Audience :: End Users/Desktop", "Topic :: Multimedia :: Video", diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9942cd5..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -numpy==2.4.1 -pillow==12.1.0 -PyQt6==6.10.2 -PyQt6-Qt6==6.10.1 -PyQt6_sip==13.11.0 diff --git a/src/avp/__init__.py b/src/avp/__init__.py index 184afda..81f8288 100644 --- a/src/avp/__init__.py +++ b/src/avp/__init__.py @@ -3,7 +3,7 @@ import logging -__version__ = "2.2.4" +__version__ = "2.3.0" class Logger(logging.getLoggerClass()): diff --git a/uv.lock b/uv.lock index 461e725..4f756bd 100644 --- a/uv.lock +++ b/uv.lock @@ -4,7 +4,7 @@ requires-python = ">=3.12" [[package]] name = "audio-visualizer-python" -version = "2.2.4" +version = "2.3.0" source = { editable = "." } dependencies = [ { name = "numpy" }, From 6826c69d545192a34c882e776ce38a968b2e16f9 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 28 May 2026 18:08:39 -0400 Subject: [PATCH 05/67] don't complain about known unsupported widgets --- src/avp/toolkit/common.py | 14 +++++++++----- tests/test_toolkit_common.py | 25 ++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/avp/toolkit/common.py b/src/avp/toolkit/common.py index a6195ed..d1cd242 100644 --- a/src/avp/toolkit/common.py +++ b/src/avp/toolkit/common.py @@ -154,8 +154,11 @@ def formatTraceback(tb=None): return "Traceback:\n%s" % "\n".join(traceback.format_tb(tb)) -def connectWidget(widget, func): - unsupportedWidgets = ["QtWidgets.QFontComboBox"] +def connectWidget(widget, func, unsupportedWidgets=None): + if unsupportedWidgets is None: + unsupportedWidgets = ["QFontComboBox"] + widgetClassName = widget.__class__.__name__ + if type(widget) == QtWidgets.QLineEdit: widget.textChanged.connect(func) elif type(widget) == QtWidgets.QSpinBox or type(widget) == QtWidgets.QDoubleSpinBox: @@ -164,12 +167,13 @@ def connectWidget(widget, func): widget.stateChanged.connect(func) elif type(widget) == QtWidgets.QComboBox: widget.currentIndexChanged.connect(func) - elif type(widget) in unsupportedWidgets: + elif widgetClassName in unsupportedWidgets: log.info( - "Could not connect %s using connectWidget()", str(widget.__class__.__name__) + "Could not connect %s using connectWidget() (known unsupportedWidget)", + widgetClassName, ) else: - log.warning("Failed to connect %s ", str(widget.__class__.__name__)) + log.warning("Failed to connect %s ", widgetClassName) return False return True diff --git a/tests/test_toolkit_common.py b/tests/test_toolkit_common.py index b20ae53..3d14d49 100644 --- a/tests/test_toolkit_common.py +++ b/tests/test_toolkit_common.py @@ -1,10 +1,14 @@ from pytest import fixture from pytestqt import qtbot from avp.command import Command -from avp.toolkit import blockSignals, rgbFromString +from avp.toolkit import blockSignals, rgbFromString, connectWidget from . import command +class UnsupportedWidget: + pass + + @fixture def gotWarning(): """Check if a function called log.warning""" @@ -21,6 +25,9 @@ def warning(self, *args): nonlocal warning warning = True + def info(self, *args): + pass + oldLog = tk.log tk.log = log() try: @@ -46,3 +53,19 @@ def test_rgbFromString(gotWarning): def test_rgbFromString_error(gotWarning): assert rgbFromString("255,255,256") == (255, 255, 255) assert gotWarning() + + +def test_connectWidget_unsupportedWidgetInfo(gotWarning): + """A known unsupported widget causes an info message""" + + connectWidget( + UnsupportedWidget(), lambda: ..., unsupportedWidgets=["UnsupportedWidget"] + ) + assert not gotWarning() + + +def test_connectWidget_unsupportedWidgetWarning(gotWarning): + """An unknown unsupported widget causes a warning message""" + + connectWidget(UnsupportedWidget(), lambda: ...) + assert gotWarning() From b19121a8e885d2c79f6b6c706c3d7303e31b86bf Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 28 May 2026 18:38:07 -0400 Subject: [PATCH 06/67] fix test to use list of unwanted files instead of declaring it and then not using it --- tests/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index b08a6bd..0dfc5fe 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -72,11 +72,11 @@ def initCore(): # use test data path so we can easily see it after # a failed test, and help us understand the config configDir = getTestDataPath("config") - unwanted = ["autosave.avp", "settings.ini"] - for file in unwanted: - filename = os.path.join(configDir, "autosave.avp") - if os.path.exists(filename): - os.remove(filename) + unwantedFiles = ["autosave.avp", "settings.ini"] + for filename in unwantedFiles: + filepath = os.path.join(configDir, filename) + if os.path.exists(filepath): + os.remove(filepath) Core.storeSettings(configDir) return configDir if numWorkers > 0 else None From 219f7e6d8075f756ca3b0b0208f3947eb89189b7 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 28 May 2026 18:50:16 -0400 Subject: [PATCH 07/67] Title Text component: rename "Text Layout" to "Alignment". Fixes #102 --- src/avp/components/text.py | 5 ++--- src/avp/components/text.ui | 2 +- tests/test_comp_text.py | 7 +++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/avp/components/text.py b/src/avp/components/text.py index d248772..790ec87 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -10,7 +10,7 @@ class Component(BaseComponent): name = "Title Text" - version = "1.0.1" + version = "1.0.2" def widget(self, *args): super().widget(*args) @@ -91,12 +91,11 @@ def getXY(self): text_width = fm.boundingRect(self.title).width() x = self.pixelValForAttr("xPosition") + offset = 0 if self.alignment == 1: # Middle offset = int(text_width / 2) elif self.alignment == 2: # Right offset = text_width - else: - raise ValueError(f"Alignment value {self.alignment} unknown") x -= offset diff --git a/src/avp/components/text.ui b/src/avp/components/text.ui index ce961fe..bd98790 100644 --- a/src/avp/components/text.ui +++ b/src/avp/components/text.ui @@ -87,7 +87,7 @@ - Text Layout + Alignment diff --git a/tests/test_comp_text.py b/tests/test_comp_text.py index 20b202d..8f98ca0 100644 --- a/tests/test_comp_text.py +++ b/tests/test_comp_text.py @@ -42,3 +42,10 @@ def test_comp_text_renderFrame(coreWithTextComp, width, height): assert comp.shadY == -2 assert comp.shadBlur == 0 assert imageDataSum(image) == 727403 or 738586 + + +@mark.parametrize("alignment", (0, 1, 2)) +def test_comp_text_alignment(coreWithTextComp, alignment): + comp = coreWithTextComp.selectedComponents[0] + comp.page.comboBox_textAlign.setCurrentIndex(alignment) + assert comp.alignment == alignment From 9a7e574b2713d161374921726cfee82b69b871d3 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Sun, 31 May 2026 17:40:26 -0400 Subject: [PATCH 08/67] test that drag-and-drop reorders components --- tests/test_mainwindow_list_actions.py | 47 +++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/tests/test_mainwindow_list_actions.py b/tests/test_mainwindow_list_actions.py index 5f8bde4..d3a5eb4 100644 --- a/tests/test_mainwindow_list_actions.py +++ b/tests/test_mainwindow_list_actions.py @@ -1,10 +1,9 @@ """Tests of `actions.py` - MainWindow component list manipulation via undoable actions""" from PyQt6 import QtCore -import os -from pytest import fixture +import pytest from pytestqt import qtbot -from . import getTestDataPath, window +from . import window def test_mainwindow_addComponent(qtbot, window): @@ -50,3 +49,45 @@ def test_mainwindow_moveComponent_undo(qtbot, window): window.undoStack.undo() # check if 0 is still 0 after undo assert window.core.selectedComponents[1].ui != comp0 + + +def test_mainwindow_componentList_qrect_sizes(qtbot, window): + """Add two components to MainWindow's componentList and test QRect sizes""" + window.compMenu.actions()[0].trigger() + window.compMenu.actions()[1].trigger() + componentListItem0 = window.listWidget_componentList.model().index(0) + componentListItem1 = window.listWidget_componentList.model().index(1) + rect0x, rect0y, rect0w, rect0h = window.listWidget_componentList.visualRect( + componentListItem0 + ).getRect() + rect1x, rect1y, rect1w, rect1h = window.listWidget_componentList.visualRect( + componentListItem1 + ).getRect() + + # only the y coordinate should be different between items in the component list + assert rect0x == rect1x + assert rect0y != rect1y + assert rect0w == rect1w + assert rect0h == rect1h + + +@pytest.mark.parametrize("row, movement", ((0, 1), (1, 0))) +def test_mainwindow_dragDropComponent(qtbot, window, row, movement): + """Add two components to MainWindow's componentList, + then call dragComponent with a fake QMouseEvent to simulate + drag-and-drop reordering components in the list""" + window.compMenu.actions()[0].trigger() + window.compMenu.actions()[1].trigger() + comp0 = window.core.selectedComponents[0].ui + rect0x, rect0y, rect0w, rect0h = window.listWidget_componentList.visualRect( + window.listWidget_componentList.model().index(0) + ).getRect() + + class FakeEvent: + def position(self): + return QtCore.QPoint(rect0x, rect0y + (rect0h * movement)) + + window.listWidget_componentList.setCurrentRow(row) + assert window.core.selectedComponents[0].ui == comp0 + window.dragComponent(FakeEvent()) + assert window.core.selectedComponents[1].ui == comp0 From 3cdc7338fbbd2be0a640b022cad9ffdf97ceac12 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Mon, 1 Jun 2026 17:59:59 -0400 Subject: [PATCH 09/67] bump pillow version --- pyproject.toml | 2 +- uv.lock | 128 ++++++++++++++++++++++++------------------------- 2 files changed, 65 insertions(+), 65 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a82c226..0eb6e7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ maintainers = [ ] dependencies = [ "numpy>=2.4.1", - "pillow>=12.1.0", + "pillow>=12.2.0", "pyqt6>=6.10.2", ] diff --git a/uv.lock b/uv.lock index 4f756bd..8082463 100644 --- a/uv.lock +++ b/uv.lock @@ -21,7 +21,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "numpy", specifier = ">=2.4.1" }, - { name = "pillow", specifier = ">=12.1.0" }, + { name = "pillow", specifier = ">=12.2.0" }, { name = "pyqt6", specifier = ">=6.10.2" }, ] @@ -121,71 +121,71 @@ wheels = [ [[package]] name = "pillow" -version = "12.1.0" +version = "12.2.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/02/d52c733a2452ef1ffcc123b68e6606d07276b0e358db70eabad7e40042b7/pillow-12.1.0.tar.gz", hash = "sha256:5c5ae0a06e9ea030ab786b0251b32c7e4ce10e58d983c0d5c56029455180b5b9", size = 46977283, upload-time = "2026-01-02T09:13:29.892Z" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/21/c2bcdd5906101a30244eaffc1b6e6ce71a31bd0742a01eb89e660ebfac2d/pillow-12.2.0.tar.gz", hash = "sha256:a830b1a40919539d07806aa58e1b114df53ddd43213d9c8b75847eee6c0182b5", size = 46987819, upload-time = "2026-04-01T14:46:17.687Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/31/dc53fe21a2f2996e1b7d92bf671cdb157079385183ef7c1ae08b485db510/pillow-12.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a332ac4ccb84b6dde65dbace8431f3af08874bf9770719d32a635c4ef411b18b", size = 5262642, upload-time = "2026-01-02T09:11:10.138Z" }, - { url = "https://files.pythonhosted.org/packages/ab/c1/10e45ac9cc79419cedf5121b42dcca5a50ad2b601fa080f58c22fb27626e/pillow-12.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:907bfa8a9cb790748a9aa4513e37c88c59660da3bcfffbd24a7d9e6abf224551", size = 4657464, upload-time = "2026-01-02T09:11:12.319Z" }, - { url = "https://files.pythonhosted.org/packages/ad/26/7b82c0ab7ef40ebede7a97c72d473bda5950f609f8e0c77b04af574a0ddb/pillow-12.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:efdc140e7b63b8f739d09a99033aa430accce485ff78e6d311973a67b6bf3208", size = 6234878, upload-time = "2026-01-02T09:11:14.096Z" }, - { url = "https://files.pythonhosted.org/packages/76/25/27abc9792615b5e886ca9411ba6637b675f1b77af3104710ac7353fe5605/pillow-12.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bef9768cab184e7ae6e559c032e95ba8d07b3023c289f79a2bd36e8bf85605a5", size = 8044868, upload-time = "2026-01-02T09:11:15.903Z" }, - { url = "https://files.pythonhosted.org/packages/0a/ea/f200a4c36d836100e7bc738fc48cd963d3ba6372ebc8298a889e0cfc3359/pillow-12.1.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:742aea052cf5ab5034a53c3846165bc3ce88d7c38e954120db0ab867ca242661", size = 6349468, upload-time = "2026-01-02T09:11:17.631Z" }, - { url = "https://files.pythonhosted.org/packages/11/8f/48d0b77ab2200374c66d344459b8958c86693be99526450e7aee714e03e4/pillow-12.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a6dfc2af5b082b635af6e08e0d1f9f1c4e04d17d4e2ca0ef96131e85eda6eb17", size = 7041518, upload-time = "2026-01-02T09:11:19.389Z" }, - { url = "https://files.pythonhosted.org/packages/1d/23/c281182eb986b5d31f0a76d2a2c8cd41722d6fb8ed07521e802f9bba52de/pillow-12.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:609e89d9f90b581c8d16358c9087df76024cf058fa693dd3e1e1620823f39670", size = 6462829, upload-time = "2026-01-02T09:11:21.28Z" }, - { url = "https://files.pythonhosted.org/packages/25/ef/7018273e0faac099d7b00982abdcc39142ae6f3bd9ceb06de09779c4a9d6/pillow-12.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:43b4899cfd091a9693a1278c4982f3e50f7fb7cff5153b05174b4afc9593b616", size = 7166756, upload-time = "2026-01-02T09:11:23.559Z" }, - { url = "https://files.pythonhosted.org/packages/8f/c8/993d4b7ab2e341fe02ceef9576afcf5830cdec640be2ac5bee1820d693d4/pillow-12.1.0-cp312-cp312-win32.whl", hash = "sha256:aa0c9cc0b82b14766a99fbe6084409972266e82f459821cd26997a488a7261a7", size = 6328770, upload-time = "2026-01-02T09:11:25.661Z" }, - { url = "https://files.pythonhosted.org/packages/a7/87/90b358775a3f02765d87655237229ba64a997b87efa8ccaca7dd3e36e7a7/pillow-12.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:d70534cea9e7966169ad29a903b99fc507e932069a881d0965a1a84bb57f6c6d", size = 7033406, upload-time = "2026-01-02T09:11:27.474Z" }, - { url = "https://files.pythonhosted.org/packages/5d/cf/881b457eccacac9e5b2ddd97d5071fb6d668307c57cbf4e3b5278e06e536/pillow-12.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:65b80c1ee7e14a87d6a068dd3b0aea268ffcabfe0498d38661b00c5b4b22e74c", size = 2452612, upload-time = "2026-01-02T09:11:29.309Z" }, - { url = "https://files.pythonhosted.org/packages/dd/c7/2530a4aa28248623e9d7f27316b42e27c32ec410f695929696f2e0e4a778/pillow-12.1.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7b5dd7cbae20285cdb597b10eb5a2c13aa9de6cde9bb64a3c1317427b1db1ae1", size = 4062543, upload-time = "2026-01-02T09:11:31.566Z" }, - { url = "https://files.pythonhosted.org/packages/8f/1f/40b8eae823dc1519b87d53c30ed9ef085506b05281d313031755c1705f73/pillow-12.1.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:29a4cef9cb672363926f0470afc516dbf7305a14d8c54f7abbb5c199cd8f8179", size = 4138373, upload-time = "2026-01-02T09:11:33.367Z" }, - { url = "https://files.pythonhosted.org/packages/d4/77/6fa60634cf06e52139fd0e89e5bbf055e8166c691c42fb162818b7fda31d/pillow-12.1.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:681088909d7e8fa9e31b9799aaa59ba5234c58e5e4f1951b4c4d1082a2e980e0", size = 3601241, upload-time = "2026-01-02T09:11:35.011Z" }, - { url = "https://files.pythonhosted.org/packages/4f/bf/28ab865de622e14b747f0cd7877510848252d950e43002e224fb1c9ababf/pillow-12.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:983976c2ab753166dc66d36af6e8ec15bb511e4a25856e2227e5f7e00a160587", size = 5262410, upload-time = "2026-01-02T09:11:36.682Z" }, - { url = "https://files.pythonhosted.org/packages/1c/34/583420a1b55e715937a85bd48c5c0991598247a1fd2eb5423188e765ea02/pillow-12.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:db44d5c160a90df2d24a24760bbd37607d53da0b34fb546c4c232af7192298ac", size = 4657312, upload-time = "2026-01-02T09:11:38.535Z" }, - { url = "https://files.pythonhosted.org/packages/1d/fd/f5a0896839762885b3376ff04878f86ab2b097c2f9a9cdccf4eda8ba8dc0/pillow-12.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6b7a9d1db5dad90e2991645874f708e87d9a3c370c243c2d7684d28f7e133e6b", size = 6232605, upload-time = "2026-01-02T09:11:40.602Z" }, - { url = "https://files.pythonhosted.org/packages/98/aa/938a09d127ac1e70e6ed467bd03834350b33ef646b31edb7452d5de43792/pillow-12.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:6258f3260986990ba2fa8a874f8b6e808cf5abb51a94015ca3dc3c68aa4f30ea", size = 8041617, upload-time = "2026-01-02T09:11:42.721Z" }, - { url = "https://files.pythonhosted.org/packages/17/e8/538b24cb426ac0186e03f80f78bc8dc7246c667f58b540bdd57c71c9f79d/pillow-12.1.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e115c15e3bc727b1ca3e641a909f77f8ca72a64fff150f666fcc85e57701c26c", size = 6346509, upload-time = "2026-01-02T09:11:44.955Z" }, - { url = "https://files.pythonhosted.org/packages/01/9a/632e58ec89a32738cabfd9ec418f0e9898a2b4719afc581f07c04a05e3c9/pillow-12.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6741e6f3074a35e47c77b23a4e4f2d90db3ed905cb1c5e6e0d49bff2045632bc", size = 7038117, upload-time = "2026-01-02T09:11:46.736Z" }, - { url = "https://files.pythonhosted.org/packages/c7/a2/d40308cf86eada842ca1f3ffa45d0ca0df7e4ab33c83f81e73f5eaed136d/pillow-12.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:935b9d1aed48fcfb3f838caac506f38e29621b44ccc4f8a64d575cb1b2a88644", size = 6460151, upload-time = "2026-01-02T09:11:48.625Z" }, - { url = "https://files.pythonhosted.org/packages/f1/88/f5b058ad6453a085c5266660a1417bdad590199da1b32fb4efcff9d33b05/pillow-12.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5fee4c04aad8932da9f8f710af2c1a15a83582cfb884152a9caa79d4efcdbf9c", size = 7164534, upload-time = "2026-01-02T09:11:50.445Z" }, - { url = "https://files.pythonhosted.org/packages/19/ce/c17334caea1db789163b5d855a5735e47995b0b5dc8745e9a3605d5f24c0/pillow-12.1.0-cp313-cp313-win32.whl", hash = "sha256:a786bf667724d84aa29b5db1c61b7bfdde380202aaca12c3461afd6b71743171", size = 6332551, upload-time = "2026-01-02T09:11:52.234Z" }, - { url = "https://files.pythonhosted.org/packages/e5/07/74a9d941fa45c90a0d9465098fe1ec85de3e2afbdc15cc4766622d516056/pillow-12.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:461f9dfdafa394c59cd6d818bdfdbab4028b83b02caadaff0ffd433faf4c9a7a", size = 7040087, upload-time = "2026-01-02T09:11:54.822Z" }, - { url = "https://files.pythonhosted.org/packages/88/09/c99950c075a0e9053d8e880595926302575bc742b1b47fe1bbcc8d388d50/pillow-12.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:9212d6b86917a2300669511ed094a9406888362e085f2431a7da985a6b124f45", size = 2452470, upload-time = "2026-01-02T09:11:56.522Z" }, - { url = "https://files.pythonhosted.org/packages/b5/ba/970b7d85ba01f348dee4d65412476321d40ee04dcb51cd3735b9dc94eb58/pillow-12.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:00162e9ca6d22b7c3ee8e61faa3c3253cd19b6a37f126cad04f2f88b306f557d", size = 5264816, upload-time = "2026-01-02T09:11:58.227Z" }, - { url = "https://files.pythonhosted.org/packages/10/60/650f2fb55fdba7a510d836202aa52f0baac633e50ab1cf18415d332188fb/pillow-12.1.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:7d6daa89a00b58c37cb1747ec9fb7ac3bc5ffd5949f5888657dfddde6d1312e0", size = 4660472, upload-time = "2026-01-02T09:12:00.798Z" }, - { url = "https://files.pythonhosted.org/packages/2b/c0/5273a99478956a099d533c4f46cbaa19fd69d606624f4334b85e50987a08/pillow-12.1.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e2479c7f02f9d505682dc47df8c0ea1fc5e264c4d1629a5d63fe3e2334b89554", size = 6268974, upload-time = "2026-01-02T09:12:02.572Z" }, - { url = "https://files.pythonhosted.org/packages/b4/26/0bf714bc2e73d5267887d47931d53c4ceeceea6978148ed2ab2a4e6463c4/pillow-12.1.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f188d580bd870cda1e15183790d1cc2fa78f666e76077d103edf048eed9c356e", size = 8073070, upload-time = "2026-01-02T09:12:04.75Z" }, - { url = "https://files.pythonhosted.org/packages/43/cf/1ea826200de111a9d65724c54f927f3111dc5ae297f294b370a670c17786/pillow-12.1.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0fde7ec5538ab5095cc02df38ee99b0443ff0e1c847a045554cf5f9af1f4aa82", size = 6380176, upload-time = "2026-01-02T09:12:06.626Z" }, - { url = "https://files.pythonhosted.org/packages/03/e0/7938dd2b2013373fd85d96e0f38d62b7a5a262af21ac274250c7ca7847c9/pillow-12.1.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0ed07dca4a8464bada6139ab38f5382f83e5f111698caf3191cb8dbf27d908b4", size = 7067061, upload-time = "2026-01-02T09:12:08.624Z" }, - { url = "https://files.pythonhosted.org/packages/86/ad/a2aa97d37272a929a98437a8c0ac37b3cf012f4f8721e1bd5154699b2518/pillow-12.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:f45bd71d1fa5e5749587613037b172e0b3b23159d1c00ef2fc920da6f470e6f0", size = 6491824, upload-time = "2026-01-02T09:12:10.488Z" }, - { url = "https://files.pythonhosted.org/packages/a4/44/80e46611b288d51b115826f136fb3465653c28f491068a72d3da49b54cd4/pillow-12.1.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:277518bf4fe74aa91489e1b20577473b19ee70fb97c374aa50830b279f25841b", size = 7190911, upload-time = "2026-01-02T09:12:12.772Z" }, - { url = "https://files.pythonhosted.org/packages/86/77/eacc62356b4cf81abe99ff9dbc7402750044aed02cfd6a503f7c6fc11f3e/pillow-12.1.0-cp313-cp313t-win32.whl", hash = "sha256:7315f9137087c4e0ee73a761b163fc9aa3b19f5f606a7fc08d83fd3e4379af65", size = 6336445, upload-time = "2026-01-02T09:12:14.775Z" }, - { url = "https://files.pythonhosted.org/packages/e7/3c/57d81d0b74d218706dafccb87a87ea44262c43eef98eb3b164fd000e0491/pillow-12.1.0-cp313-cp313t-win_amd64.whl", hash = "sha256:0ddedfaa8b5f0b4ffbc2fa87b556dc59f6bb4ecb14a53b33f9189713ae8053c0", size = 7045354, upload-time = "2026-01-02T09:12:16.599Z" }, - { url = "https://files.pythonhosted.org/packages/ac/82/8b9b97bba2e3576a340f93b044a3a3a09841170ab4c1eb0d5c93469fd32f/pillow-12.1.0-cp313-cp313t-win_arm64.whl", hash = "sha256:80941e6d573197a0c28f394753de529bb436b1ca990ed6e765cf42426abc39f8", size = 2454547, upload-time = "2026-01-02T09:12:18.704Z" }, - { url = "https://files.pythonhosted.org/packages/8c/87/bdf971d8bbcf80a348cc3bacfcb239f5882100fe80534b0ce67a784181d8/pillow-12.1.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:5cb7bc1966d031aec37ddb9dcf15c2da5b2e9f7cc3ca7c54473a20a927e1eb91", size = 4062533, upload-time = "2026-01-02T09:12:20.791Z" }, - { url = "https://files.pythonhosted.org/packages/ff/4f/5eb37a681c68d605eb7034c004875c81f86ec9ef51f5be4a63eadd58859a/pillow-12.1.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:97e9993d5ed946aba26baf9c1e8cf18adbab584b99f452ee72f7ee8acb882796", size = 4138546, upload-time = "2026-01-02T09:12:23.664Z" }, - { url = "https://files.pythonhosted.org/packages/11/6d/19a95acb2edbace40dcd582d077b991646b7083c41b98da4ed7555b59733/pillow-12.1.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:414b9a78e14ffeb98128863314e62c3f24b8a86081066625700b7985b3f529bd", size = 3601163, upload-time = "2026-01-02T09:12:26.338Z" }, - { url = "https://files.pythonhosted.org/packages/fc/36/2b8138e51cb42e4cc39c3297713455548be855a50558c3ac2beebdc251dd/pillow-12.1.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:e6bdb408f7c9dd2a5ff2b14a3b0bb6d4deb29fb9961e6eb3ae2031ae9a5cec13", size = 5266086, upload-time = "2026-01-02T09:12:28.782Z" }, - { url = "https://files.pythonhosted.org/packages/53/4b/649056e4d22e1caa90816bf99cef0884aed607ed38075bd75f091a607a38/pillow-12.1.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:3413c2ae377550f5487991d444428f1a8ae92784aac79caa8b1e3b89b175f77e", size = 4657344, upload-time = "2026-01-02T09:12:31.117Z" }, - { url = "https://files.pythonhosted.org/packages/6c/6b/c5742cea0f1ade0cd61485dc3d81f05261fc2276f537fbdc00802de56779/pillow-12.1.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e5dcbe95016e88437ecf33544ba5db21ef1b8dd6e1b434a2cb2a3d605299e643", size = 6232114, upload-time = "2026-01-02T09:12:32.936Z" }, - { url = "https://files.pythonhosted.org/packages/bf/8f/9f521268ce22d63991601aafd3d48d5ff7280a246a1ef62d626d67b44064/pillow-12.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d0a7735df32ccbcc98b98a1ac785cc4b19b580be1bdf0aeb5c03223220ea09d5", size = 8042708, upload-time = "2026-01-02T09:12:34.78Z" }, - { url = "https://files.pythonhosted.org/packages/1a/eb/257f38542893f021502a1bbe0c2e883c90b5cff26cc33b1584a841a06d30/pillow-12.1.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0c27407a2d1b96774cbc4a7594129cc027339fd800cd081e44497722ea1179de", size = 6347762, upload-time = "2026-01-02T09:12:36.748Z" }, - { url = "https://files.pythonhosted.org/packages/c4/5a/8ba375025701c09b309e8d5163c5a4ce0102fa86bbf8800eb0d7ac87bc51/pillow-12.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:15c794d74303828eaa957ff8070846d0efe8c630901a1c753fdc63850e19ecd9", size = 7039265, upload-time = "2026-01-02T09:12:39.082Z" }, - { url = "https://files.pythonhosted.org/packages/cf/dc/cf5e4cdb3db533f539e88a7bbf9f190c64ab8a08a9bc7a4ccf55067872e4/pillow-12.1.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c990547452ee2800d8506c4150280757f88532f3de2a58e3022e9b179107862a", size = 6462341, upload-time = "2026-01-02T09:12:40.946Z" }, - { url = "https://files.pythonhosted.org/packages/d0/47/0291a25ac9550677e22eda48510cfc4fa4b2ef0396448b7fbdc0a6946309/pillow-12.1.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b63e13dd27da389ed9475b3d28510f0f954bca0041e8e551b2a4eb1eab56a39a", size = 7165395, upload-time = "2026-01-02T09:12:42.706Z" }, - { url = "https://files.pythonhosted.org/packages/4f/4c/e005a59393ec4d9416be06e6b45820403bb946a778e39ecec62f5b2b991e/pillow-12.1.0-cp314-cp314-win32.whl", hash = "sha256:1a949604f73eb07a8adab38c4fe50791f9919344398bdc8ac6b307f755fc7030", size = 6431413, upload-time = "2026-01-02T09:12:44.944Z" }, - { url = "https://files.pythonhosted.org/packages/1c/af/f23697f587ac5f9095d67e31b81c95c0249cd461a9798a061ed6709b09b5/pillow-12.1.0-cp314-cp314-win_amd64.whl", hash = "sha256:4f9f6a650743f0ddee5593ac9e954ba1bdbc5e150bc066586d4f26127853ab94", size = 7176779, upload-time = "2026-01-02T09:12:46.727Z" }, - { url = "https://files.pythonhosted.org/packages/b3/36/6a51abf8599232f3e9afbd16d52829376a68909fe14efe29084445db4b73/pillow-12.1.0-cp314-cp314-win_arm64.whl", hash = "sha256:808b99604f7873c800c4840f55ff389936ef1948e4e87645eaf3fccbc8477ac4", size = 2543105, upload-time = "2026-01-02T09:12:49.243Z" }, - { url = "https://files.pythonhosted.org/packages/82/54/2e1dd20c8749ff225080d6ba465a0cab4387f5db0d1c5fb1439e2d99923f/pillow-12.1.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:bc11908616c8a283cf7d664f77411a5ed2a02009b0097ff8abbba5e79128ccf2", size = 5268571, upload-time = "2026-01-02T09:12:51.11Z" }, - { url = "https://files.pythonhosted.org/packages/57/61/571163a5ef86ec0cf30d265ac2a70ae6fc9e28413d1dc94fa37fae6bda89/pillow-12.1.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:896866d2d436563fa2a43a9d72f417874f16b5545955c54a64941e87c1376c61", size = 4660426, upload-time = "2026-01-02T09:12:52.865Z" }, - { url = "https://files.pythonhosted.org/packages/5e/e1/53ee5163f794aef1bf84243f755ee6897a92c708505350dd1923f4afec48/pillow-12.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8e178e3e99d3c0ea8fc64b88447f7cac8ccf058af422a6cedc690d0eadd98c51", size = 6269908, upload-time = "2026-01-02T09:12:54.884Z" }, - { url = "https://files.pythonhosted.org/packages/bc/0b/b4b4106ff0ee1afa1dc599fde6ab230417f800279745124f6c50bcffed8e/pillow-12.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:079af2fb0c599c2ec144ba2c02766d1b55498e373b3ac64687e43849fbbef5bc", size = 8074733, upload-time = "2026-01-02T09:12:56.802Z" }, - { url = "https://files.pythonhosted.org/packages/19/9f/80b411cbac4a732439e629a26ad3ef11907a8c7fc5377b7602f04f6fe4e7/pillow-12.1.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bdec5e43377761c5dbca620efb69a77f6855c5a379e32ac5b158f54c84212b14", size = 6381431, upload-time = "2026-01-02T09:12:58.823Z" }, - { url = "https://files.pythonhosted.org/packages/8f/b7/d65c45db463b66ecb6abc17c6ba6917a911202a07662247e1355ce1789e7/pillow-12.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:565c986f4b45c020f5421a4cea13ef294dde9509a8577f29b2fc5edc7587fff8", size = 7068529, upload-time = "2026-01-02T09:13:00.885Z" }, - { url = "https://files.pythonhosted.org/packages/50/96/dfd4cd726b4a45ae6e3c669fc9e49deb2241312605d33aba50499e9d9bd1/pillow-12.1.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:43aca0a55ce1eefc0aefa6253661cb54571857b1a7b2964bd8a1e3ef4b729924", size = 6492981, upload-time = "2026-01-02T09:13:03.314Z" }, - { url = "https://files.pythonhosted.org/packages/4d/1c/b5dc52cf713ae46033359c5ca920444f18a6359ce1020dd3e9c553ea5bc6/pillow-12.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0deedf2ea233722476b3a81e8cdfbad786f7adbed5d848469fa59fe52396e4ef", size = 7191878, upload-time = "2026-01-02T09:13:05.276Z" }, - { url = "https://files.pythonhosted.org/packages/53/26/c4188248bd5edaf543864fe4834aebe9c9cb4968b6f573ce014cc42d0720/pillow-12.1.0-cp314-cp314t-win32.whl", hash = "sha256:b17fbdbe01c196e7e159aacb889e091f28e61020a8abeac07b68079b6e626988", size = 6438703, upload-time = "2026-01-02T09:13:07.491Z" }, - { url = "https://files.pythonhosted.org/packages/b8/0e/69ed296de8ea05cb03ee139cee600f424ca166e632567b2d66727f08c7ed/pillow-12.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:27b9baecb428899db6c0de572d6d305cfaf38ca1596b5c0542a5182e3e74e8c6", size = 7182927, upload-time = "2026-01-02T09:13:09.841Z" }, - { url = "https://files.pythonhosted.org/packages/fc/f5/68334c015eed9b5cff77814258717dec591ded209ab5b6fb70e2ae873d1d/pillow-12.1.0-cp314-cp314t-win_arm64.whl", hash = "sha256:f61333d817698bdcdd0f9d7793e365ac3d2a21c1f1eb02b32ad6aefb8d8ea831", size = 2545104, upload-time = "2026-01-02T09:13:12.068Z" }, + { url = "https://files.pythonhosted.org/packages/58/be/7482c8a5ebebbc6470b3eb791812fff7d5e0216c2be3827b30b8bb6603ed/pillow-12.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2d192a155bbcec180f8564f693e6fd9bccff5a7af9b32e2e4bf8c9c69dbad6b5", size = 5308279, upload-time = "2026-04-01T14:43:13.246Z" }, + { url = "https://files.pythonhosted.org/packages/d8/95/0a351b9289c2b5cbde0bacd4a83ebc44023e835490a727b2a3bd60ddc0f4/pillow-12.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f3f40b3c5a968281fd507d519e444c35f0ff171237f4fdde090dd60699458421", size = 4695490, upload-time = "2026-04-01T14:43:15.584Z" }, + { url = "https://files.pythonhosted.org/packages/de/af/4e8e6869cbed569d43c416fad3dc4ecb944cb5d9492defaed89ddd6fe871/pillow-12.2.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:03e7e372d5240cc23e9f07deca4d775c0817bffc641b01e9c3af208dbd300987", size = 6284462, upload-time = "2026-04-01T14:43:18.268Z" }, + { url = "https://files.pythonhosted.org/packages/e9/9e/c05e19657fd57841e476be1ab46c4d501bffbadbafdc31a6d665f8b737b6/pillow-12.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b86024e52a1b269467a802258c25521e6d742349d760728092e1bc2d135b4d76", size = 8094744, upload-time = "2026-04-01T14:43:20.716Z" }, + { url = "https://files.pythonhosted.org/packages/2b/54/1789c455ed10176066b6e7e6da1b01e50e36f94ba584dc68d9eebfe9156d/pillow-12.2.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7371b48c4fa448d20d2714c9a1f775a81155050d383333e0a6c15b1123dda005", size = 6398371, upload-time = "2026-04-01T14:43:23.443Z" }, + { url = "https://files.pythonhosted.org/packages/43/e3/fdc657359e919462369869f1c9f0e973f353f9a9ee295a39b1fea8ee1a77/pillow-12.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62f5409336adb0663b7caa0da5c7d9e7bdbaae9ce761d34669420c2a801b2780", size = 7087215, upload-time = "2026-04-01T14:43:26.758Z" }, + { url = "https://files.pythonhosted.org/packages/8b/f8/2f6825e441d5b1959d2ca5adec984210f1ec086435b0ed5f52c19b3b8a6e/pillow-12.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:01afa7cf67f74f09523699b4e88c73fb55c13346d212a59a2db1f86b0a63e8c5", size = 6509783, upload-time = "2026-04-01T14:43:29.56Z" }, + { url = "https://files.pythonhosted.org/packages/67/f9/029a27095ad20f854f9dba026b3ea6428548316e057e6fc3545409e86651/pillow-12.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc3d34d4a8fbec3e88a79b92e5465e0f9b842b628675850d860b8bd300b159f5", size = 7212112, upload-time = "2026-04-01T14:43:32.091Z" }, + { url = "https://files.pythonhosted.org/packages/be/42/025cfe05d1be22dbfdb4f264fe9de1ccda83f66e4fc3aac94748e784af04/pillow-12.2.0-cp312-cp312-win32.whl", hash = "sha256:58f62cc0f00fd29e64b29f4fd923ffdb3859c9f9e6105bfc37ba1d08994e8940", size = 6378489, upload-time = "2026-04-01T14:43:34.601Z" }, + { url = "https://files.pythonhosted.org/packages/5d/7b/25a221d2c761c6a8ae21bfa3874988ff2583e19cf8a27bf2fee358df7942/pillow-12.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:7f84204dee22a783350679a0333981df803dac21a0190d706a50475e361c93f5", size = 7084129, upload-time = "2026-04-01T14:43:37.213Z" }, + { url = "https://files.pythonhosted.org/packages/10/e1/542a474affab20fd4a0f1836cb234e8493519da6b76899e30bcc5d990b8b/pillow-12.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:af73337013e0b3b46f175e79492d96845b16126ddf79c438d7ea7ff27783a414", size = 2463612, upload-time = "2026-04-01T14:43:39.421Z" }, + { url = "https://files.pythonhosted.org/packages/4a/01/53d10cf0dbad820a8db274d259a37ba50b88b24768ddccec07355382d5ad/pillow-12.2.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:8297651f5b5679c19968abefd6bb84d95fe30ef712eb1b2d9b2d31ca61267f4c", size = 4100837, upload-time = "2026-04-01T14:43:41.506Z" }, + { url = "https://files.pythonhosted.org/packages/0f/98/f3a6657ecb698c937f6c76ee564882945f29b79bad496abcba0e84659ec5/pillow-12.2.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:50d8520da2a6ce0af445fa6d648c4273c3eeefbc32d7ce049f22e8b5c3daecc2", size = 4176528, upload-time = "2026-04-01T14:43:43.773Z" }, + { url = "https://files.pythonhosted.org/packages/69/bc/8986948f05e3ea490b8442ea1c1d4d990b24a7e43d8a51b2c7d8b1dced36/pillow-12.2.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:766cef22385fa1091258ad7e6216792b156dc16d8d3fa607e7545b2b72061f1c", size = 3640401, upload-time = "2026-04-01T14:43:45.87Z" }, + { url = "https://files.pythonhosted.org/packages/34/46/6c717baadcd62bc8ed51d238d521ab651eaa74838291bda1f86fe1f864c9/pillow-12.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5d2fd0fa6b5d9d1de415060363433f28da8b1526c1c129020435e186794b3795", size = 5308094, upload-time = "2026-04-01T14:43:48.438Z" }, + { url = "https://files.pythonhosted.org/packages/71/43/905a14a8b17fdb1ccb58d282454490662d2cb89a6bfec26af6d3520da5ec/pillow-12.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:56b25336f502b6ed02e889f4ece894a72612fe885889a6e8c4c80239ff6e5f5f", size = 4695402, upload-time = "2026-04-01T14:43:51.292Z" }, + { url = "https://files.pythonhosted.org/packages/73/dd/42107efcb777b16fa0393317eac58f5b5cf30e8392e266e76e51cff28c3d/pillow-12.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f1c943e96e85df3d3478f7b691f229887e143f81fedab9b20205349ab04d73ed", size = 6280005, upload-time = "2026-04-01T14:43:54.242Z" }, + { url = "https://files.pythonhosted.org/packages/a8/68/b93e09e5e8549019e61acf49f65b1a8530765a7f812c77a7461bca7e4494/pillow-12.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:03f6fab9219220f041c74aeaa2939ff0062bd5c364ba9ce037197f4c6d498cd9", size = 8090669, upload-time = "2026-04-01T14:43:57.335Z" }, + { url = "https://files.pythonhosted.org/packages/4b/6e/3ccb54ce8ec4ddd1accd2d89004308b7b0b21c4ac3d20fa70af4760a4330/pillow-12.2.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5cdfebd752ec52bf5bb4e35d9c64b40826bc5b40a13df7c3cda20a2c03a0f5ed", size = 6395194, upload-time = "2026-04-01T14:43:59.864Z" }, + { url = "https://files.pythonhosted.org/packages/67/ee/21d4e8536afd1a328f01b359b4d3997b291ffd35a237c877b331c1c3b71c/pillow-12.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eedf4b74eda2b5a4b2b2fb4c006d6295df3bf29e459e198c90ea48e130dc75c3", size = 7082423, upload-time = "2026-04-01T14:44:02.74Z" }, + { url = "https://files.pythonhosted.org/packages/78/5f/e9f86ab0146464e8c133fe85df987ed9e77e08b29d8d35f9f9f4d6f917ba/pillow-12.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:00a2865911330191c0b818c59103b58a5e697cae67042366970a6b6f1b20b7f9", size = 6505667, upload-time = "2026-04-01T14:44:05.381Z" }, + { url = "https://files.pythonhosted.org/packages/ed/1e/409007f56a2fdce61584fd3acbc2bbc259857d555196cedcadc68c015c82/pillow-12.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1e1757442ed87f4912397c6d35a0db6a7b52592156014706f17658ff58bbf795", size = 7208580, upload-time = "2026-04-01T14:44:08.39Z" }, + { url = "https://files.pythonhosted.org/packages/23/c4/7349421080b12fb35414607b8871e9534546c128a11965fd4a7002ccfbee/pillow-12.2.0-cp313-cp313-win32.whl", hash = "sha256:144748b3af2d1b358d41286056d0003f47cb339b8c43a9ea42f5fea4d8c66b6e", size = 6375896, upload-time = "2026-04-01T14:44:11.197Z" }, + { url = "https://files.pythonhosted.org/packages/3f/82/8a3739a5e470b3c6cbb1d21d315800d8e16bff503d1f16b03a4ec3212786/pillow-12.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:390ede346628ccc626e5730107cde16c42d3836b89662a115a921f28440e6a3b", size = 7081266, upload-time = "2026-04-01T14:44:13.947Z" }, + { url = "https://files.pythonhosted.org/packages/c3/25/f968f618a062574294592f668218f8af564830ccebdd1fa6200f598e65c5/pillow-12.2.0-cp313-cp313-win_arm64.whl", hash = "sha256:8023abc91fba39036dbce14a7d6535632f99c0b857807cbbbf21ecc9f4717f06", size = 2463508, upload-time = "2026-04-01T14:44:16.312Z" }, + { url = "https://files.pythonhosted.org/packages/4d/a4/b342930964e3cb4dce5038ae34b0eab4653334995336cd486c5a8c25a00c/pillow-12.2.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:042db20a421b9bafecc4b84a8b6e444686bd9d836c7fd24542db3e7df7baad9b", size = 5309927, upload-time = "2026-04-01T14:44:18.89Z" }, + { url = "https://files.pythonhosted.org/packages/9f/de/23198e0a65a9cf06123f5435a5d95cea62a635697f8f03d134d3f3a96151/pillow-12.2.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:dd025009355c926a84a612fecf58bb315a3f6814b17ead51a8e48d3823d9087f", size = 4698624, upload-time = "2026-04-01T14:44:21.115Z" }, + { url = "https://files.pythonhosted.org/packages/01/a6/1265e977f17d93ea37aa28aa81bad4fa597933879fac2520d24e021c8da3/pillow-12.2.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:88ddbc66737e277852913bd1e07c150cc7bb124539f94c4e2df5344494e0a612", size = 6321252, upload-time = "2026-04-01T14:44:23.663Z" }, + { url = "https://files.pythonhosted.org/packages/3c/83/5982eb4a285967baa70340320be9f88e57665a387e3a53a7f0db8231a0cd/pillow-12.2.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d362d1878f00c142b7e1a16e6e5e780f02be8195123f164edf7eddd911eefe7c", size = 8126550, upload-time = "2026-04-01T14:44:26.772Z" }, + { url = "https://files.pythonhosted.org/packages/4e/48/6ffc514adce69f6050d0753b1a18fd920fce8cac87620d5a31231b04bfc5/pillow-12.2.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2c727a6d53cb0018aadd8018c2b938376af27914a68a492f59dfcaca650d5eea", size = 6433114, upload-time = "2026-04-01T14:44:29.615Z" }, + { url = "https://files.pythonhosted.org/packages/36/a3/f9a77144231fb8d40ee27107b4463e205fa4677e2ca2548e14da5cf18dce/pillow-12.2.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:efd8c21c98c5cc60653bcb311bef2ce0401642b7ce9d09e03a7da87c878289d4", size = 7115667, upload-time = "2026-04-01T14:44:32.773Z" }, + { url = "https://files.pythonhosted.org/packages/c1/fc/ac4ee3041e7d5a565e1c4fd72a113f03b6394cc72ab7089d27608f8aaccb/pillow-12.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9f08483a632889536b8139663db60f6724bfcb443c96f1b18855860d7d5c0fd4", size = 6538966, upload-time = "2026-04-01T14:44:35.252Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a8/27fb307055087f3668f6d0a8ccb636e7431d56ed0750e07a60547b1e083e/pillow-12.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dac8d77255a37e81a2efcbd1fc05f1c15ee82200e6c240d7e127e25e365c39ea", size = 7238241, upload-time = "2026-04-01T14:44:37.875Z" }, + { url = "https://files.pythonhosted.org/packages/ad/4b/926ab182c07fccae9fcb120043464e1ff1564775ec8864f21a0ebce6ac25/pillow-12.2.0-cp313-cp313t-win32.whl", hash = "sha256:ee3120ae9dff32f121610bb08e4313be87e03efeadfc6c0d18f89127e24d0c24", size = 6379592, upload-time = "2026-04-01T14:44:40.336Z" }, + { url = "https://files.pythonhosted.org/packages/c2/c4/f9e476451a098181b30050cc4c9a3556b64c02cf6497ea421ac047e89e4b/pillow-12.2.0-cp313-cp313t-win_amd64.whl", hash = "sha256:325ca0528c6788d2a6c3d40e3568639398137346c3d6e66bb61db96b96511c98", size = 7085542, upload-time = "2026-04-01T14:44:43.251Z" }, + { url = "https://files.pythonhosted.org/packages/00/a4/285f12aeacbe2d6dc36c407dfbbe9e96d4a80b0fb710a337f6d2ad978c75/pillow-12.2.0-cp313-cp313t-win_arm64.whl", hash = "sha256:2e5a76d03a6c6dcef67edabda7a52494afa4035021a79c8558e14af25313d453", size = 2465765, upload-time = "2026-04-01T14:44:45.996Z" }, + { url = "https://files.pythonhosted.org/packages/bf/98/4595daa2365416a86cb0d495248a393dfc84e96d62ad080c8546256cb9c0/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:3adc9215e8be0448ed6e814966ecf3d9952f0ea40eb14e89a102b87f450660d8", size = 4100848, upload-time = "2026-04-01T14:44:48.48Z" }, + { url = "https://files.pythonhosted.org/packages/0b/79/40184d464cf89f6663e18dfcf7ca21aae2491fff1a16127681bf1fa9b8cf/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:6a9adfc6d24b10f89588096364cc726174118c62130c817c2837c60cf08a392b", size = 4176515, upload-time = "2026-04-01T14:44:51.353Z" }, + { url = "https://files.pythonhosted.org/packages/b0/63/703f86fd4c422a9cf722833670f4f71418fb116b2853ff7da722ea43f184/pillow-12.2.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:6a6e67ea2e6feda684ed370f9a1c52e7a243631c025ba42149a2cc5934dec295", size = 3640159, upload-time = "2026-04-01T14:44:53.588Z" }, + { url = "https://files.pythonhosted.org/packages/71/e0/fb22f797187d0be2270f83500aab851536101b254bfa1eae10795709d283/pillow-12.2.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2bb4a8d594eacdfc59d9e5ad972aa8afdd48d584ffd5f13a937a664c3e7db0ed", size = 5312185, upload-time = "2026-04-01T14:44:56.039Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8c/1a9e46228571de18f8e28f16fabdfc20212a5d019f3e3303452b3f0a580d/pillow-12.2.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:80b2da48193b2f33ed0c32c38140f9d3186583ce7d516526d462645fd98660ae", size = 4695386, upload-time = "2026-04-01T14:44:58.663Z" }, + { url = "https://files.pythonhosted.org/packages/70/62/98f6b7f0c88b9addd0e87c217ded307b36be024d4ff8869a812b241d1345/pillow-12.2.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22db17c68434de69d8ecfc2fe821569195c0c373b25cccb9cbdacf2c6e53c601", size = 6280384, upload-time = "2026-04-01T14:45:01.5Z" }, + { url = "https://files.pythonhosted.org/packages/5e/03/688747d2e91cfbe0e64f316cd2e8005698f76ada3130d0194664174fa5de/pillow-12.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7b14cc0106cd9aecda615dd6903840a058b4700fcb817687d0ee4fc8b6e389be", size = 8091599, upload-time = "2026-04-01T14:45:04.5Z" }, + { url = "https://files.pythonhosted.org/packages/f6/35/577e22b936fcdd66537329b33af0b4ccfefaeabd8aec04b266528cddb33c/pillow-12.2.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cbeb542b2ebc6fcdacabf8aca8c1a97c9b3ad3927d46b8723f9d4f033288a0f", size = 6396021, upload-time = "2026-04-01T14:45:07.117Z" }, + { url = "https://files.pythonhosted.org/packages/11/8d/d2532ad2a603ca2b93ad9f5135732124e57811d0168155852f37fbce2458/pillow-12.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4bfd07bc812fbd20395212969e41931001fd59eb55a60658b0e5710872e95286", size = 7083360, upload-time = "2026-04-01T14:45:09.763Z" }, + { url = "https://files.pythonhosted.org/packages/5e/26/d325f9f56c7e039034897e7380e9cc202b1e368bfd04d4cbe6a441f02885/pillow-12.2.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9aba9a17b623ef750a4d11b742cbafffeb48a869821252b30ee21b5e91392c50", size = 6507628, upload-time = "2026-04-01T14:45:12.378Z" }, + { url = "https://files.pythonhosted.org/packages/5f/f7/769d5632ffb0988f1c5e7660b3e731e30f7f8ec4318e94d0a5d674eb65a4/pillow-12.2.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:deede7c263feb25dba4e82ea23058a235dcc2fe1f6021025dc71f2b618e26104", size = 7209321, upload-time = "2026-04-01T14:45:15.122Z" }, + { url = "https://files.pythonhosted.org/packages/6a/7a/c253e3c645cd47f1aceea6a8bacdba9991bf45bb7dfe927f7c893e89c93c/pillow-12.2.0-cp314-cp314-win32.whl", hash = "sha256:632ff19b2778e43162304d50da0181ce24ac5bb8180122cbe1bf4673428328c7", size = 6479723, upload-time = "2026-04-01T14:45:17.797Z" }, + { url = "https://files.pythonhosted.org/packages/cd/8b/601e6566b957ca50e28725cb6c355c59c2c8609751efbecd980db44e0349/pillow-12.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:4e6c62e9d237e9b65fac06857d511e90d8461a32adcc1b9065ea0c0fa3a28150", size = 7217400, upload-time = "2026-04-01T14:45:20.529Z" }, + { url = "https://files.pythonhosted.org/packages/d6/94/220e46c73065c3e2951bb91c11a1fb636c8c9ad427ac3ce7d7f3359b9b2f/pillow-12.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:b1c1fbd8a5a1af3412a0810d060a78b5136ec0836c8a4ef9aa11807f2a22f4e1", size = 2554835, upload-time = "2026-04-01T14:45:23.162Z" }, + { url = "https://files.pythonhosted.org/packages/b6/ab/1b426a3974cb0e7da5c29ccff4807871d48110933a57207b5a676cccc155/pillow-12.2.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:57850958fe9c751670e49b2cecf6294acc99e562531f4bd317fa5ddee2068463", size = 5314225, upload-time = "2026-04-01T14:45:25.637Z" }, + { url = "https://files.pythonhosted.org/packages/19/1e/dce46f371be2438eecfee2a1960ee2a243bbe5e961890146d2dee1ff0f12/pillow-12.2.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d5d38f1411c0ed9f97bcb49b7bd59b6b7c314e0e27420e34d99d844b9ce3b6f3", size = 4698541, upload-time = "2026-04-01T14:45:28.355Z" }, + { url = "https://files.pythonhosted.org/packages/55/c3/7fbecf70adb3a0c33b77a300dc52e424dc22ad8cdc06557a2e49523b703d/pillow-12.2.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5c0a9f29ca8e79f09de89293f82fc9b0270bb4af1d58bc98f540cc4aedf03166", size = 6322251, upload-time = "2026-04-01T14:45:30.924Z" }, + { url = "https://files.pythonhosted.org/packages/1c/3c/7fbc17cfb7e4fe0ef1642e0abc17fc6c94c9f7a16be41498e12e2ba60408/pillow-12.2.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1610dd6c61621ae1cf811bef44d77e149ce3f7b95afe66a4512f8c59f25d9ebe", size = 8127807, upload-time = "2026-04-01T14:45:33.908Z" }, + { url = "https://files.pythonhosted.org/packages/ff/c3/a8ae14d6defd2e448493ff512fae903b1e9bd40b72efb6ec55ce0048c8ce/pillow-12.2.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a34329707af4f73cf1782a36cd2289c0368880654a2c11f027bcee9052d35dd", size = 6433935, upload-time = "2026-04-01T14:45:36.623Z" }, + { url = "https://files.pythonhosted.org/packages/6e/32/2880fb3a074847ac159d8f902cb43278a61e85f681661e7419e6596803ed/pillow-12.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e9c4f5b3c546fa3458a29ab22646c1c6c787ea8f5ef51300e5a60300736905e", size = 7116720, upload-time = "2026-04-01T14:45:39.258Z" }, + { url = "https://files.pythonhosted.org/packages/46/87/495cc9c30e0129501643f24d320076f4cc54f718341df18cc70ec94c44e1/pillow-12.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fb043ee2f06b41473269765c2feae53fc2e2fbf96e5e22ca94fb5ad677856f06", size = 6540498, upload-time = "2026-04-01T14:45:41.879Z" }, + { url = "https://files.pythonhosted.org/packages/18/53/773f5edca692009d883a72211b60fdaf8871cbef075eaa9d577f0a2f989e/pillow-12.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f278f034eb75b4e8a13a54a876cc4a5ab39173d2cdd93a638e1b467fc545ac43", size = 7239413, upload-time = "2026-04-01T14:45:44.705Z" }, + { url = "https://files.pythonhosted.org/packages/c9/e4/4b64a97d71b2a83158134abbb2f5bd3f8a2ea691361282f010998f339ec7/pillow-12.2.0-cp314-cp314t-win32.whl", hash = "sha256:6bb77b2dcb06b20f9f4b4a8454caa581cd4dd0643a08bacf821216a16d9c8354", size = 6482084, upload-time = "2026-04-01T14:45:47.568Z" }, + { url = "https://files.pythonhosted.org/packages/ba/13/306d275efd3a3453f72114b7431c877d10b1154014c1ebbedd067770d629/pillow-12.2.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6562ace0d3fb5f20ed7290f1f929cae41b25ae29528f2af1722966a0a02e2aa1", size = 7225152, upload-time = "2026-04-01T14:45:50.032Z" }, + { url = "https://files.pythonhosted.org/packages/ff/6e/cf826fae916b8658848d7b9f38d88da6396895c676e8086fc0988073aaf8/pillow-12.2.0-cp314-cp314t-win_arm64.whl", hash = "sha256:aa88ccfe4e32d362816319ed727a004423aab09c5cea43c01a4b435643fa34eb", size = 2556579, upload-time = "2026-04-01T14:45:52.529Z" }, ] [[package]] From 75252a6d2bf1d925e657938e65401261062eb1a2 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Mon, 1 Jun 2026 19:43:00 -0400 Subject: [PATCH 10/67] update Qt namespace --- src/avp/gui/mainwindow.ui | 245 +++++++++++++++++++------------------- 1 file changed, 120 insertions(+), 125 deletions(-) diff --git a/src/avp/gui/mainwindow.ui b/src/avp/gui/mainwindow.ui index cd8454d..998ef6b 100644 --- a/src/avp/gui/mainwindow.ui +++ b/src/avp/gui/mainwindow.ui @@ -23,7 +23,7 @@ - Qt::StrongFocus + Qt::FocusPolicy::StrongFocus MainWindow @@ -50,10 +50,10 @@ - Qt::Vertical + Qt::Orientation::Vertical - QSizePolicy::MinimumExpanding + QSizePolicy::Policy::MinimumExpanding @@ -66,7 +66,7 @@ - QLayout::SetDefaultConstraint + QLayout::SizeConstraint::SetDefaultConstraint 0 @@ -74,10 +74,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::MinimumExpanding + QSizePolicy::Policy::MinimumExpanding @@ -92,7 +92,7 @@ - QLayout::SetMinimumSize + QLayout::SizeConstraint::SetMinimumSize 3 @@ -100,7 +100,7 @@ - QLayout::SetMinimumSize + QLayout::SizeConstraint::SetMinimumSize 3 @@ -108,7 +108,7 @@ - QLayout::SetMinimumSize + QLayout::SizeConstraint::SetMinimumSize @@ -120,10 +120,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Fixed + QSizePolicy::Policy::Fixed @@ -152,10 +152,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Minimum + QSizePolicy::Policy::Minimum @@ -189,10 +189,10 @@ true - QFrame::StyledPanel + QFrame::Shape::StyledPanel - QFrame::Sunken + QFrame::Shadow::Sunken 1 @@ -207,10 +207,10 @@ false - QAbstractItemView::InternalMove + QAbstractItemView::DragDropMode::InternalMove - Qt::MoveAction + Qt::DropAction::MoveAction @@ -265,7 +265,7 @@ - QLayout::SetFixedSize + QLayout::SizeConstraint::SetFixedSize 4 @@ -294,10 +294,10 @@ - QTabWidget::North + QTabWidget::TabPosition::North - QTabWidget::Rounded + QTabWidget::TabShape::Rounded 0 @@ -307,11 +307,11 @@ Export Video - + 10 - + 0 @@ -345,7 +345,7 @@ Audio File - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter @@ -399,85 +399,81 @@ - - - - - - - - 0 - 0 - - - - - 85 - 0 - - - - - 0 - 0 - - - - Output File - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 28 - - - - - 16777215 - 28 - - - - - - - - - 0 - 28 - - - - - 16777215 - 28 - - - - ... - - - - + + + + + + 0 + 0 + + + + + 85 + 0 + + + + + 0 + 0 + + + + Output File + + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + ... + + - - + + 0 @@ -496,10 +492,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Minimum + QSizePolicy::Policy::Minimum @@ -529,32 +525,31 @@ - - - - - - true - - - Qt::AlignCenter - - - -1 - - + + + + + + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + - progressLabel + horizontalLayoutWidget + Encoder Settings - + 10 @@ -591,10 +586,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Minimum + QSizePolicy::Policy::Minimum @@ -669,10 +664,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Fixed + QSizePolicy::Policy::Fixed @@ -738,10 +733,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Fixed + QSizePolicy::Policy::Fixed @@ -780,15 +775,15 @@ - QLayout::SetDefaultConstraint + QLayout::SizeConstraint::SetDefaultConstraint - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::MinimumExpanding + QSizePolicy::Policy::MinimumExpanding From 3695b8d1eb59b7ea5a1b28536d1de2546e730a13 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Mon, 1 Jun 2026 19:48:22 -0400 Subject: [PATCH 11/67] add estimated time to GUI also introduced a global variable to store `sys.platform`, which is used to determine if the progress percentage appears on the progress bar or above it --- src/avp/gui/mainwindow.py | 30 +++++++++++++++++++----------- src/avp/gui/mainwindow.ui | 16 ++++++++++++++++ 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index fac1e41..4b107e4 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -29,12 +29,12 @@ from ..toolkit import ( disableWhenEncoding, disableWhenOpeningProject, - checkOutput, blockSignals, ) log = logging.getLogger("AVP.Gui.MainWindow") +SYSPLATFORM = sys.platform class MainWindow(QtWidgets.QMainWindow): @@ -165,11 +165,13 @@ def toggleUndoButtonEnabled(*_): style.standardIcon(QtWidgets.QStyle.StandardPixmap.SP_DialogDiscardButton) ) - if sys.platform == "darwin": - log.debug("Darwin detected: showing progress label below progress bar") + if SYSPLATFORM == "darwin": + log.debug("Darwin detected: showing progress label above progress bar") self.progressBar_createVideo.setTextVisible(False) - else: - self.progressLabel.setHidden(True) + self.estimatedTimeLabel.setAlignment( + QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter + ) + self.progressLabel.setHidden(True) self.toolButton_selectAudioFile.clicked.connect(self.openInputFileDialog) @@ -642,6 +644,7 @@ def createAudioVisualization(self): self.videoWorker = self.core.newVideoWorker(self, audioFile, outputPath) self.videoWorker.progressBarUpdate.connect(self.progressBarUpdated) self.videoWorker.progressBarSetText.connect(self.progressBarSetText) + self.videoWorker.estimatedTimeUpdate.connect(self.estimatedTimeUpdated) self.videoWorker.imageCreated.connect(self.showPreviewImage) self.videoWorker.encoding.connect(self.changeEncodingStatus) self.createVideo.emit() @@ -664,6 +667,8 @@ def changeEncodingStatus(self, status): self.encoding = status if status: # Disable many widgets when starting to export + if SYSPLATFORM == "darwin": + self.progressLabel.setHidden(False) self.pushButton_createVideo.setEnabled(False) self.pushButton_Cancel.setEnabled(True) self.comboBox_resolution.setEnabled(False) @@ -685,10 +690,9 @@ def changeEncodingStatus(self, status): self.menuButton_openProject.setEnabled(False) # Close undo history dialog if open self.undoDialog.close() - # Show label under progress bar on macOS - if sys.platform == "darwin": - self.progressLabel.setHidden(False) else: + self.estimatedTimeLabel.setText("") + self.progressLabel.setHidden(True) self.pushButton_createVideo.setEnabled(True) self.pushButton_Cancel.setEnabled(False) self.comboBox_resolution.setEnabled(True) @@ -708,16 +712,21 @@ def changeEncodingStatus(self, status): self.menuButton_newProject.setEnabled(True) self.menuButton_openProject.setEnabled(True) self.listWidget_componentList.setEnabled(True) - self.progressLabel.setHidden(True) self.drawPreview(True) + @QtCore.pyqtSlot(str) + def estimatedTimeUpdated(self, value): + if SYSPLATFORM == "darwin": + value = "(%s)" % value + self.estimatedTimeLabel.setText(value) + @QtCore.pyqtSlot(int) def progressBarUpdated(self, value): self.progressBar_createVideo.setValue(value) @QtCore.pyqtSlot(str) def progressBarSetText(self, value): - if sys.platform == "darwin": + if SYSPLATFORM == "darwin": self.progressLabel.setText(value) else: self.progressBar_createVideo.setFormat(value) @@ -852,7 +861,6 @@ def getComponentListMousePos(self, position): if hasattr(position, "toPointF"): position = position.toPointF() position = position.toPoint() - modelIndexes = [ componentList.model().index(i) for i in range(componentList.count()) ] diff --git a/src/avp/gui/mainwindow.ui b/src/avp/gui/mainwindow.ui index 998ef6b..93a52b4 100644 --- a/src/avp/gui/mainwindow.ui +++ b/src/avp/gui/mainwindow.ui @@ -536,6 +536,22 @@ + + + + + + + true + + + Qt::AlignmentFlag::AlignCenter + + + -1 + + + From e5b303e717de0aa905de724bb9be06d1a604a3ae Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Mon, 1 Jun 2026 20:27:35 -0400 Subject: [PATCH 12/67] organize MainWindow.__init__ debatably not an improvement, but it's a start and allows for some code-folding in an editor --- src/avp/gui/mainwindow.py | 486 +++++++++++++++++++++----------------- 1 file changed, 267 insertions(+), 219 deletions(-) diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index 4b107e4..3bd97b5 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -78,206 +78,312 @@ def __init__(self, project, dpi): self.autosavePath = os.path.join(self.dataDir, "autosave.avp") self.settings = Core.settings + # Create Preset Manager + self.presetManager = PresetManager(self) + self.pushButton_presets.clicked.connect(self.openPresetManager) + # Create stack of undoable user actions self.undoStack = UndoStack(self) undoLimit = self.settings.value("pref_undoLimit") self.undoStack.setUndoLimit(undoLimit) - # Create Undo Dialog - A standard QUndoView on a standard QDialog - self.undoDialog = QtWidgets.QDialog(self) - self.undoDialog.setWindowTitle("Undo History") - undoView = QtWidgets.QUndoView(self.undoStack) - layout = QtWidgets.QVBoxLayout() - layout.addWidget(undoView) - self.undoDialog.setLayout(layout) - self.undoDialog.setMinimumWidth(int(self.width() / 2)) - - # Create Preset Manager - self.presetManager = PresetManager(self) - - # Create the preview window and its thread, queues, and timers - log.debug("Creating preview window") - self.previewWindow = PreviewWindow( - self, os.path.join(Core.wd, "gui", "background.png") - ) - self.verticalLayout_previewWrapper.addWidget(self.previewWindow) + # Begin decorating the window and connecting events + def setupHotkeys(): + # Hotkeys for projects + QShortcut("Ctrl+S", self, self.saveCurrentProject) + QShortcut("Ctrl+A", self, self.openSaveProjectDialog) + QShortcut("Ctrl+O", self, self.openOpenProjectDialog) + QShortcut("Ctrl+N", self, self.createNewProject) + + # Hotkeys for undo/redo + QShortcut("Ctrl+Z", self, self.undoStack.undo) + QShortcut("Ctrl+Y", self, self.undoStack.redo) + QShortcut("Ctrl+Shift+Z", self, self.undoStack.redo) + + # Hotkeys for component list + for inskey in ("Ctrl+T", QtCore.Qt.Key.Key_Insert): + QShortcut( + inskey, + self, + activated=lambda: self.pushButton_addComponent.click(), + ) + for delkey in ("Ctrl+R", QtCore.Qt.Key.Key_Delete): + QShortcut(delkey, self.listWidget_componentList, self.removeComponent) + QShortcut( + "Ctrl+Space", + self, + activated=lambda: self.listWidget_componentList.setFocus(), + ) + QShortcut("Ctrl+Shift+S", self, self.presetManager.openSavePresetDialog) + QShortcut("Ctrl+Shift+C", self, self.presetManager.clearPreset) - log.debug("Starting preview thread") - self.previewQueue = Queue() - self.previewThread = QtCore.QThread(self) - self.previewWorker = preview_thread.Worker( - self.core, self.settings, self.previewQueue - ) - self.previewWorker.moveToThread(self.previewThread) - self.newTask.connect(self.previewWorker.createPreviewImage) - self.processTask.connect(self.previewWorker.process) - self.previewWorker.error.connect(self.previewWindow.threadError) - self.previewWorker.imageCreated.connect(self.showPreviewImage) - self.previewThread.start() - self.previewThread.finished.connect( - lambda: log.info("Preview thread finished.") - ) + QShortcut( + "Ctrl+Up", + self.listWidget_componentList, + activated=lambda: self.moveComponent(-1), + ) + QShortcut( + "Ctrl+Down", + self.listWidget_componentList, + activated=lambda: self.moveComponent(1), + ) + QShortcut( + "Ctrl+Home", + self.listWidget_componentList, + activated=lambda: self.moveComponent("top"), + ) + QShortcut( + "Ctrl+End", + self.listWidget_componentList, + activated=lambda: self.moveComponent("bottom"), + ) - timeout = 500 - log.debug("Preview timer set to trigger when idle for %sms" % str(timeout)) - self.timer = QtCore.QTimer(self) - self.timer.timeout.connect(self.processTask.emit) - self.timer.start(timeout) + QShortcut("F1", self, self.showHelpWindow) + QShortcut("Ctrl+Shift+F", self, self.showFfmpegCommand) + QShortcut("Ctrl+Shift+U", self, self.showUndoStack) + + if log.isEnabledFor(logging.DEBUG): + QShortcut("Ctrl+Alt+Shift+R", self, self.drawPreview) + QShortcut("Ctrl+Alt+Shift+A", self, lambda: log.debug(repr(self))) + + def setupMainWindowWidgets(): + def setupUndoDialog(): + """Create Undo Dialog - A standard QUndoView on a standard QDialog""" + self.undoDialog = QtWidgets.QDialog(self) + self.undoDialog.setWindowTitle("Undo History") + undoView = QtWidgets.QUndoView(self.undoStack) + layout = QtWidgets.QVBoxLayout() + layout.addWidget(undoView) + self.undoDialog.setLayout(layout) + self.undoDialog.setMinimumWidth(int(self.width() / 2)) + + def setupPreviewWindow(): + """Create the preview window and its thread, queues, and timers""" + log.debug("Creating preview window") + self.previewWindow = PreviewWindow( + self, os.path.join(Core.wd, "gui", "background.png") + ) + self.verticalLayout_previewWrapper.addWidget(self.previewWindow) - # Begin decorating the window and connecting events - componentList = self.listWidget_componentList + log.debug("Starting preview thread") + self.previewQueue = Queue() + self.previewThread = QtCore.QThread(self) + self.previewWorker = preview_thread.Worker( + self.core, self.settings, self.previewQueue + ) + self.previewWorker.moveToThread(self.previewThread) + self.newTask.connect(self.previewWorker.createPreviewImage) + self.processTask.connect(self.previewWorker.process) + self.previewWorker.error.connect(self.previewWindow.threadError) + self.previewWorker.imageCreated.connect(self.showPreviewImage) + self.previewThread.start() + self.previewThread.finished.connect( + lambda: log.info("Preview thread finished.") + ) - # Undo Feature - def toggleUndoButtonEnabled(*_): - """Enable/disable undo button depending on whether UndoStack contains Actions""" - try: - undoButton.setEnabled(self.undoStack.count()) - except RuntimeError: - # program is probably in midst of exiting - pass + timeout = 500 + log.debug( + "Preview timer set to trigger when idle for %sms" % str(timeout) + ) + self.timer = QtCore.QTimer(self) + self.timer.timeout.connect(self.processTask.emit) + self.timer.start(timeout) + + def setupUndoFeature(): + def toggleUndoButtonEnabled(*_): + """Enable/disable undo button depending on whether UndoStack contains Actions""" + try: + undoButton.setEnabled(self.undoStack.count()) + except RuntimeError: + # program is probably in midst of exiting + pass + + style = self.pushButton_undo.style() + undoButton = self.pushButton_undo + undoButton.setIcon( + style.standardIcon( + QtWidgets.QStyle.StandardPixmap.SP_FileDialogBack + ) + ) + undoButton.clicked.connect(self.undoStack.undo) + undoButton.setEnabled(False) + self.undoStack.cleanChanged.connect(toggleUndoButtonEnabled) + self.undoMenu = QtWidgets.QMenu() + self.undoMenu.addAction(self.undoStack.createUndoAction(self)) + self.undoMenu.addAction(self.undoStack.createRedoAction(self)) + action = self.undoMenu.addAction("Show History...") + action.triggered.connect(lambda _: self.showUndoStack()) + undoButton.setMenu(self.undoMenu) + + def setupProgressBar(): + if SYSPLATFORM == "darwin": + log.debug( + "Darwin detected: showing progress label above progress bar" + ) + self.progressBar_createVideo.setTextVisible(False) + self.estimatedTimeLabel.setAlignment( + QtCore.Qt.AlignmentFlag.AlignLeft + | QtCore.Qt.AlignmentFlag.AlignVCenter + ) + self.progressLabel.setHidden(True) - style = self.pushButton_undo.style() - undoButton = self.pushButton_undo - undoButton.setIcon( - style.standardIcon(QtWidgets.QStyle.StandardPixmap.SP_FileDialogBack) - ) - undoButton.clicked.connect(self.undoStack.undo) - undoButton.setEnabled(False) - self.undoStack.cleanChanged.connect(toggleUndoButtonEnabled) - self.undoMenu = QtWidgets.QMenu() - self.undoMenu.addAction(self.undoStack.createUndoAction(self)) - self.undoMenu.addAction(self.undoStack.createRedoAction(self)) - action = self.undoMenu.addAction("Show History...") - action.triggered.connect(lambda _: self.showUndoStack()) - undoButton.setMenu(self.undoMenu) - # end of Undo Feature - - style = self.pushButton_listMoveUp.style() - self.pushButton_listMoveUp.setIcon( - style.standardIcon(QtWidgets.QStyle.StandardPixmap.SP_ArrowUp) - ) - style = self.pushButton_listMoveDown.style() - self.pushButton_listMoveDown.setIcon( - style.standardIcon(QtWidgets.QStyle.StandardPixmap.SP_ArrowDown) - ) - style = self.pushButton_removeComponent.style() - self.pushButton_removeComponent.setIcon( - style.standardIcon(QtWidgets.QStyle.StandardPixmap.SP_DialogDiscardButton) - ) + def setupExportVideoTab(): + self.toolButton_selectAudioFile.clicked.connect( + self.openInputFileDialog + ) - if SYSPLATFORM == "darwin": - log.debug("Darwin detected: showing progress label above progress bar") - self.progressBar_createVideo.setTextVisible(False) - self.estimatedTimeLabel.setAlignment( - QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter - ) - self.progressLabel.setHidden(True) + self.toolButton_selectOutputFile.clicked.connect( + self.openOutputFileDialog + ) - self.toolButton_selectAudioFile.clicked.connect(self.openInputFileDialog) + def changedField(): + self.autosave() + self.updateWindowTitle() - self.toolButton_selectOutputFile.clicked.connect(self.openOutputFileDialog) + self.lineEdit_audioFile.textChanged.connect(changedField) + self.lineEdit_outputFile.textChanged.connect(changedField) - def changedField(): - self.autosave() - self.updateWindowTitle() + self.progressBar_createVideo.setValue(0) - self.lineEdit_audioFile.textChanged.connect(changedField) - self.lineEdit_outputFile.textChanged.connect(changedField) + self.pushButton_createVideo.clicked.connect( + self.createAudioVisualization + ) - self.progressBar_createVideo.setValue(0) + self.pushButton_Cancel.clicked.connect(self.stopVideo) - self.pushButton_createVideo.clicked.connect(self.createAudioVisualization) + def setupEncoderSettingsTab(): + for i, container in enumerate(Core.encoderOptions["containers"]): + self.comboBox_videoContainer.addItem(container["name"]) + if container["name"] == self.settings.value("outputContainer"): + selectedContainer = i - self.pushButton_Cancel.clicked.connect(self.stopVideo) + self.comboBox_videoContainer.setCurrentIndex(selectedContainer) + self.comboBox_videoContainer.currentIndexChanged.connect( + self.updateCodecs + ) - for i, container in enumerate(Core.encoderOptions["containers"]): - self.comboBox_videoContainer.addItem(container["name"]) - if container["name"] == self.settings.value("outputContainer"): - selectedContainer = i + self.updateCodecs() - self.comboBox_videoContainer.setCurrentIndex(selectedContainer) - self.comboBox_videoContainer.currentIndexChanged.connect(self.updateCodecs) + for i in range(self.comboBox_videoCodec.count()): + codec = self.comboBox_videoCodec.itemText(i) + if codec == self.settings.value("outputVideoCodec"): + self.comboBox_videoCodec.setCurrentIndex(i) - self.updateCodecs() + for i in range(self.comboBox_audioCodec.count()): + codec = self.comboBox_audioCodec.itemText(i) + if codec == self.settings.value("outputAudioCodec"): + self.comboBox_audioCodec.setCurrentIndex(i) - for i in range(self.comboBox_videoCodec.count()): - codec = self.comboBox_videoCodec.itemText(i) - if codec == self.settings.value("outputVideoCodec"): - self.comboBox_videoCodec.setCurrentIndex(i) + self.comboBox_videoCodec.currentIndexChanged.connect( + self.updateCodecSettings + ) - for i in range(self.comboBox_audioCodec.count()): - codec = self.comboBox_audioCodec.itemText(i) - if codec == self.settings.value("outputAudioCodec"): - self.comboBox_audioCodec.setCurrentIndex(i) + self.comboBox_audioCodec.currentIndexChanged.connect( + self.updateCodecSettings + ) - self.comboBox_videoCodec.currentIndexChanged.connect(self.updateCodecSettings) + vBitrate = int(self.settings.value("outputVideoBitrate")) + aBitrate = int(self.settings.value("outputAudioBitrate")) - self.comboBox_audioCodec.currentIndexChanged.connect(self.updateCodecSettings) + self.spinBox_vBitrate.setValue(vBitrate) + self.spinBox_aBitrate.setValue(aBitrate) + self.spinBox_vBitrate.valueChanged.connect(self.updateCodecSettings) + self.spinBox_aBitrate.valueChanged.connect(self.updateCodecSettings) - vBitrate = int(self.settings.value("outputVideoBitrate")) - aBitrate = int(self.settings.value("outputAudioBitrate")) + currentRes = ( + str(self.settings.value("outputWidth")) + + "x" + + str(self.settings.value("outputHeight")) + ) + for i, res in enumerate(Core.resolutions): + self.comboBox_resolution.addItem(res) + if res == currentRes: + currentRes = i + self.comboBox_resolution.setCurrentIndex(currentRes) + self.comboBox_resolution.currentIndexChanged.connect( + self.updateResolution + ) - self.spinBox_vBitrate.setValue(vBitrate) - self.spinBox_aBitrate.setValue(aBitrate) - self.spinBox_vBitrate.valueChanged.connect(self.updateCodecSettings) - self.spinBox_aBitrate.valueChanged.connect(self.updateCodecSettings) + def setupComponentListWidgets(): + componentList = self.listWidget_componentList + style = self.pushButton_listMoveUp.style() + self.pushButton_listMoveUp.setIcon( + style.standardIcon(QtWidgets.QStyle.StandardPixmap.SP_ArrowUp) + ) + style = self.pushButton_listMoveDown.style() + self.pushButton_listMoveDown.setIcon( + style.standardIcon(QtWidgets.QStyle.StandardPixmap.SP_ArrowDown) + ) + style = self.pushButton_removeComponent.style() + self.pushButton_removeComponent.setIcon( + style.standardIcon( + QtWidgets.QStyle.StandardPixmap.SP_DialogDiscardButton + ) + ) - # Make component buttons - self.compMenu = QtWidgets.QMenu() - for i, comp in enumerate(self.core.modules): - action = self.compMenu.addAction(comp.Component.name) - action.triggered.connect(lambda _, item=i: self.addComponent(0, item)) + self.compMenu = QtWidgets.QMenu() + for i, comp in enumerate(self.core.modules): + action = self.compMenu.addAction(comp.Component.name) + action.triggered.connect( + lambda _, item=i: self.addComponent(0, item) + ) - self.pushButton_addComponent.setMenu(self.compMenu) + self.pushButton_addComponent.setMenu(self.compMenu) - componentList.dropEvent = self.dragComponent - componentList.itemSelectionChanged.connect(self.changeComponentWidget) - componentList.itemSelectionChanged.connect( - self.presetManager.clearPresetListSelection - ) - self.pushButton_removeComponent.clicked.connect(lambda: self.removeComponent()) + componentList.dropEvent = self.dragComponent + componentList.itemSelectionChanged.connect(self.changeComponentWidget) + componentList.itemSelectionChanged.connect( + self.presetManager.clearPresetListSelection + ) + self.pushButton_removeComponent.clicked.connect( + lambda: self.removeComponent() + ) - componentList.setContextMenuPolicy( - QtCore.Qt.ContextMenuPolicy.CustomContextMenu - ) - componentList.customContextMenuRequested.connect(self.componentContextMenu) + componentList.setContextMenuPolicy( + QtCore.Qt.ContextMenuPolicy.CustomContextMenu + ) + componentList.customContextMenuRequested.connect( + self.componentContextMenu + ) - currentRes = ( - str(self.settings.value("outputWidth")) - + "x" - + str(self.settings.value("outputHeight")) - ) - for i, res in enumerate(Core.resolutions): - self.comboBox_resolution.addItem(res) - if res == currentRes: - currentRes = i - self.comboBox_resolution.setCurrentIndex(currentRes) - self.comboBox_resolution.currentIndexChanged.connect( - self.updateResolution + self.pushButton_listMoveUp.clicked.connect( + lambda: self.moveComponent(-1) + ) + self.pushButton_listMoveDown.clicked.connect( + lambda: self.moveComponent(1) ) - self.pushButton_listMoveUp.clicked.connect(lambda: self.moveComponent(-1)) - self.pushButton_listMoveDown.clicked.connect(lambda: self.moveComponent(1)) + def setupProjectsMenu(): + """Configure the Projects Menu""" + self.projectMenu = QtWidgets.QMenu() + self.menuButton_newProject = self.projectMenu.addAction("New Project") + self.menuButton_newProject.triggered.connect( + lambda: self.createNewProject() + ) + self.menuButton_openProject = self.projectMenu.addAction("Open Project") + self.menuButton_openProject.triggered.connect( + lambda: self.openOpenProjectDialog() + ) - # Configure the Projects Menu - self.projectMenu = QtWidgets.QMenu() - self.menuButton_newProject = self.projectMenu.addAction("New Project") - self.menuButton_newProject.triggered.connect(lambda: self.createNewProject()) - self.menuButton_openProject = self.projectMenu.addAction("Open Project") - self.menuButton_openProject.triggered.connect( - lambda: self.openOpenProjectDialog() - ) + action = self.projectMenu.addAction("Save Project") + action.triggered.connect(self.saveCurrentProject) - action = self.projectMenu.addAction("Save Project") - action.triggered.connect(self.saveCurrentProject) + action = self.projectMenu.addAction("Save Project As") + action.triggered.connect(self.openSaveProjectDialog) - action = self.projectMenu.addAction("Save Project As") - action.triggered.connect(self.openSaveProjectDialog) + self.pushButton_projects.setMenu(self.projectMenu) - self.pushButton_projects.setMenu(self.projectMenu) + setupUndoDialog() + setupPreviewWindow() + setupUndoFeature() + setupProgressBar() + setupExportVideoTab() + setupEncoderSettingsTab() + setupComponentListWidgets() + setupProjectsMenu() - # Configure the Presets Button - self.pushButton_presets.clicked.connect(self.openPresetManager) + setupMainWindowWidgets() + setupHotkeys() self.updateWindowTitle() log.debug("Showing main window") @@ -340,64 +446,6 @@ def changedField(): ) self.settings.setValue("ffmpegMsgShown", True) - # Hotkeys for projects - - QShortcut("Ctrl+S", self, self.saveCurrentProject) - QShortcut("Ctrl+A", self, self.openSaveProjectDialog) - QShortcut("Ctrl+O", self, self.openOpenProjectDialog) - QShortcut("Ctrl+N", self, self.createNewProject) - - # Hotkeys for undo/redo - QShortcut("Ctrl+Z", self, self.undoStack.undo) - QShortcut("Ctrl+Y", self, self.undoStack.redo) - QShortcut("Ctrl+Shift+Z", self, self.undoStack.redo) - - # Hotkeys for component list - for inskey in ("Ctrl+T", QtCore.Qt.Key.Key_Insert): - QShortcut( - inskey, - self, - activated=lambda: self.pushButton_addComponent.click(), - ) - for delkey in ("Ctrl+R", QtCore.Qt.Key.Key_Delete): - QShortcut(delkey, self.listWidget_componentList, self.removeComponent) - QShortcut( - "Ctrl+Space", - self, - activated=lambda: self.listWidget_componentList.setFocus(), - ) - QShortcut("Ctrl+Shift+S", self, self.presetManager.openSavePresetDialog) - QShortcut("Ctrl+Shift+C", self, self.presetManager.clearPreset) - - QShortcut( - "Ctrl+Up", - self.listWidget_componentList, - activated=lambda: self.moveComponent(-1), - ) - QShortcut( - "Ctrl+Down", - self.listWidget_componentList, - activated=lambda: self.moveComponent(1), - ) - QShortcut( - "Ctrl+Home", - self.listWidget_componentList, - activated=lambda: self.moveComponent("top"), - ) - QShortcut( - "Ctrl+End", - self.listWidget_componentList, - activated=lambda: self.moveComponent("bottom"), - ) - - QShortcut("F1", self, self.showHelpWindow) - QShortcut("Ctrl+Shift+F", self, self.showFfmpegCommand) - QShortcut("Ctrl+Shift+U", self, self.showUndoStack) - - if log.isEnabledFor(logging.DEBUG): - QShortcut("Ctrl+Alt+Shift+R", self, self.drawPreview) - QShortcut("Ctrl+Alt+Shift+A", self, lambda: log.debug(repr(self))) - # Close MainWindow when receiving Ctrl+C from terminal signal.signal(signal.SIGINT, lambda *args: self.close()) From 5b5b8e69e12f50e745d3e0ecc79c17a0165bce28 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 3 Jun 2026 18:19:28 -0400 Subject: [PATCH 13/67] move setup functions to top of __init__ --- src/avp/gui/mainwindow.py | 78 +++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index 3bd97b5..b7f8321 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -55,39 +55,13 @@ def __init__(self, project, dpi): super().__init__() log.debug("Main thread id: {}".format(int(QtCore.QThread.currentThreadId()))) uic.loadUi(os.path.join(Core.wd, "gui", "mainwindow.ui"), self) + log.info("Pillow version %s", Image.__version__) + log.info( + "PyQt version %s (Qt version %s)", + QtCore.PYQT_VERSION_STR, + QtCore.QT_VERSION_STR, + ) - if dpi: - self.resize( - int(self.width() * (dpi / 144)), - int(self.height() * (dpi / 144)), - ) - - self.core = Core() - Core.mode = "GUI" - # widgets of component settings - self.pages = [] - self.lastAutosave = time.time() - # list of previous five autosave times, used to reduce update spam - self.autosaveTimes = [] - self.autosaveCooldown = 0.2 - self.encoding = False - - # Find settings created by Core object - self.dataDir = Core.dataDir - self.presetDir = Core.presetDir - self.autosavePath = os.path.join(self.dataDir, "autosave.avp") - self.settings = Core.settings - - # Create Preset Manager - self.presetManager = PresetManager(self) - self.pushButton_presets.clicked.connect(self.openPresetManager) - - # Create stack of undoable user actions - self.undoStack = UndoStack(self) - undoLimit = self.settings.value("pref_undoLimit") - self.undoStack.setUndoLimit(undoLimit) - - # Begin decorating the window and connecting events def setupHotkeys(): # Hotkeys for projects QShortcut("Ctrl+S", self, self.saveCurrentProject) @@ -382,13 +356,44 @@ def setupProjectsMenu(): setupComponentListWidgets() setupProjectsMenu() + self.core = Core() + Core.mode = "GUI" + # widgets of component settings + self.pages = [] + self.lastAutosave = time.time() + # list of previous five autosave times, used to reduce update spam + self.autosaveTimes = [] + self.autosaveCooldown = 0.2 + self.encoding = False + + # Find settings created by Core object + self.dataDir = Core.dataDir + self.presetDir = Core.presetDir + self.autosavePath = os.path.join(self.dataDir, "autosave.avp") + self.settings = Core.settings + + # Create Preset Manager + self.presetManager = PresetManager(self) + self.pushButton_presets.clicked.connect(self.openPresetManager) + + # Create widgets and hotkeys + self.undoStack = UndoStack(self) + undoLimit = self.settings.value("pref_undoLimit") + self.undoStack.setUndoLimit(undoLimit) setupMainWindowWidgets() setupHotkeys() + # Resize and show main window + if dpi: + self.resize( + int(self.width() * (dpi / 144)), + int(self.height() * (dpi / 144)), + ) self.updateWindowTitle() log.debug("Showing main window") self.show() + # Load project and prompt user to restore unsaved changes if project and project != self.autosavePath: if not project.endswith(".avp"): project += ".avp" @@ -421,14 +426,7 @@ def setupProjectsMenu(): self.openProject(self.currentProject, prompt=False) self.drawPreview(True) - log.info("Pillow version %s", Image.__version__) - log.info( - "PyQt version %s (Qt version %s)", - QtCore.PYQT_VERSION_STR, - QtCore.QT_VERSION_STR, - ) - - # verify Ffmpeg version + # Verify FFmpeg version if not self.core.FFMPEG_BIN: self.showMessage( msg="FFmpeg could not be found. This is a critical error. " From d02d64c57d30130914dedc3ffd3831bbefb0b5a2 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 3 Jun 2026 19:13:57 -0400 Subject: [PATCH 14/67] add ComponentPreviewClick action (QUndoCommand) for sharing of common code with future components that will respond to clicking the preview window --- src/avp/components/life.py | 33 +++------------------------- src/avp/libcomponent/actions.py | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/src/avp/components/life.py b/src/avp/components/life.py index 374b299..ee85cbf 100644 --- a/src/avp/components/life.py +++ b/src/avp/components/life.py @@ -7,6 +7,7 @@ from ..libcomponent import BaseComponent +from ..libcomponent.actions import ComponentPreviewClick from ..toolkit.frame import BlankFrame, scale, addShadow from ..toolkit.visualizer import createSpectrumArray @@ -149,7 +150,7 @@ def previewClickEvent(self, pos, size, button): math.ceil((pos[0] / size[0]) * self.gridWidth) - 1, math.ceil((pos[1] / size[1]) * self.gridHeight) - 1, ) - action = ClickGrid(self, pos, button) + action = ClickGrid(self, pos, size, button) self.parent.undoStack.push(action) def updateGridSize(self): @@ -561,23 +562,7 @@ def nearbyCoords(self, x, y): yield x - 1, y -class ClickGrid(QUndoCommand): - def __init__(self, comp, pos, button): - super().__init__("click %s component #%s" % (comp.name, comp.compPos)) - self.comp = comp - self.pos = [pos] - if button == QtCore.Qt.MouseButton.RightButton: - self.button = 2 - else: - self.button = 1 - - def id(self): - return self.button - - def mergeWith(self, other): - self.pos.extend(other.pos) - return True - +class ClickGrid(ComponentPreviewClick): def add(self): for pos in self.pos[:]: self.comp.startingGrid.add(pos) @@ -588,18 +573,6 @@ def remove(self): self.comp.startingGrid.discard(pos) self.comp.update(auto=True) - def redo(self): - if self.button == 1: # Left-click - self.add() - elif self.button == 2: # Right-click - self.remove() - - def undo(self): - if self.button == 1: # Left-click - self.remove() - elif self.button == 2: # Right-click - self.add() - class ShiftGrid(QUndoCommand): def __init__(self, comp, direction): diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index f534685..67d8625 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -4,6 +4,7 @@ See `../life.py` for an example of a component that uses a custom QUndoCommand """ +from PyQt6 import QtCore from PyQt6.QtGui import QUndoCommand from copy import copy import logging @@ -102,3 +103,40 @@ def undo(self): self.setWidgetValues(self.oldWidgetVals) self.parent.update(auto=True) self.parent.oldAttrs = None + + +class ComponentPreviewClick(QUndoCommand): + def __init__(self, comp, pos, size, button): + super().__init__("click %s component #%s" % (comp.name, comp.compPos)) + self.comp = comp + self.pos = [pos] + self.size = size + if button == QtCore.Qt.MouseButton.RightButton: + self.button = 2 + else: + self.button = 1 + + def id(self): + return self.button + + def mergeWith(self, other): + self.pos.extend(other.pos) + return True + + def add(self): + ... + + def remove(self): + ... + + def redo(self): + if self.button == 1: # Left-click + self.add() + elif self.button == 2: # Right-click + self.remove() + + def undo(self): + if self.button == 1: # Left-click + self.remove() + elif self.button == 2: # Right-click + self.add() \ No newline at end of file From 7948b01c8d9417e95beec76425e2c39c1ed9bcf6 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 3 Jun 2026 19:16:31 -0400 Subject: [PATCH 15/67] click preview window to move title text --- src/avp/components/text.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/avp/components/text.py b/src/avp/components/text.py index 790ec87..f774807 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -3,6 +3,7 @@ import logging from ..libcomponent import BaseComponent +from ..libcomponent.actions import ComponentPreviewClick from ..toolkit.frame import FramePainter, addShadow log = logging.getLogger("AVP.Components.Text") @@ -10,7 +11,7 @@ class Component(BaseComponent): name = "Title Text" - version = "1.0.2" + version = "1.1.0" def widget(self, *args): super().widget(*args) @@ -81,6 +82,12 @@ def update(self): self.page.label_shadBlur.setHidden(True) self.page.spinBox_shadBlur.setHidden(True) + def previewClickEvent(self, pos, size, button): + if button != QtCore.Qt.MouseButton.LeftButton: + return + action = ClickPreviewAction(self, pos, size, button) + self.parent.undoStack.push(action) + def centerXY(self): self.setRelativeWidget("xPosition", 0.5) self.setRelativeWidget("yPosition", 0.521) @@ -208,3 +215,23 @@ def command(self, arg): self.page.lineEdit_title.setText(arg) return super().command(arg) + + +class ClickPreviewAction(ComponentPreviewClick): + def __init__(self, *args): + super().__init__(*args) + + self.oldX = self.comp.xPosition / int(self.comp.settings.value("outputWidth")) + self.oldY = self.comp.yPosition / int(self.comp.settings.value("outputHeight")) + + + def add(self): + for pos in self.pos[:]: + self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) + self.comp.setRelativeWidget("yPosition", pos[1] / self.size[1]) + self.comp.update(auto=True) + + def remove(self): + self.comp.setRelativeWidget("xPosition", self.oldX) + self.comp.setRelativeWidget("yPosition", self.oldY) + self.comp.update(auto=True) \ No newline at end of file From 9b400d2154fe257aea3ea53e320cc9a717e2a565 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 4 Jun 2026 21:15:35 -0400 Subject: [PATCH 16/67] rename ComponentUpdate to ComponentTrackedWidgetUpdate improved comments to better explain how these classes are used --- src/avp/libcomponent/actions.py | 15 +++++++++++++-- src/avp/libcomponent/component.py | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index 67d8625..17faa3c 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -12,8 +12,11 @@ log = logging.getLogger("AVP.ComponentHandler") -class ComponentUpdate(QUndoCommand): - """Command object for making a component action undoable""" +class ComponentTrackedWidgetUpdate(QUndoCommand): + """ + This QUndoCommand represents value changes in a component's `page` (its UI widget) + It is used by the BaseComponent class for input widgets tracked by `trackWidgets()` + """ def __init__(self, parent, oldWidgetVals, modifiedVals): super().__init__("change %s component #%s" % (parent.name, parent.compPos)) @@ -106,6 +109,14 @@ def undo(self): class ComponentPreviewClick(QUndoCommand): + """ + This QUndoCommand represents the user clicking the preview window. + A component that responds to preview click events must define a subclass + which defines `add()` and `remove()` to respond to left and right mouse buttons. + This component should then create instances of its subclass and + add them to the undoStack within a `previewClickEvent` method. + """ + def __init__(self, comp, pos, size, button): super().__init__("click %s component #%s" % (comp.name, comp.compPos)) self.comp = comp diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index 1f81e07..1590ea5 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -11,7 +11,7 @@ from copy import copy from .metaclass import ComponentMetaclass -from .actions import ComponentUpdate +from .actions import ComponentTrackedWidgetUpdate from .exceptions import ComponentError from ..toolkit.frame import BlankFrame @@ -292,7 +292,7 @@ def _userUpdate(self): if val != oldWidgetVals[attr] } if modifiedWidgets: - action = ComponentUpdate(self, oldWidgetVals, modifiedWidgets) + action = ComponentTrackedWidgetUpdate(self, oldWidgetVals, modifiedWidgets) self.parent.undoStack.push(action) def _autoUpdate(self): From 47def1295736b0e4c38a9be2043b90c08feabf60 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 4 Jun 2026 21:17:24 -0400 Subject: [PATCH 17/67] Title Text component: centering text is undoable --- src/avp/components/text.py | 44 +++++++++++++++++++++++++++------ src/avp/libcomponent/actions.py | 26 ++++++++++++++++++- 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/src/avp/components/text.py b/src/avp/components/text.py index f774807..4a14022 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -3,7 +3,7 @@ import logging from ..libcomponent import BaseComponent -from ..libcomponent.actions import ComponentPreviewClick +from ..libcomponent.actions import ComponentPreviewClick, ComponentSettingsUpdate from ..toolkit.frame import FramePainter, addShadow log = logging.getLogger("AVP.Components.Text") @@ -25,7 +25,7 @@ def widget(self, *args): self.page.comboBox_textAlign.addItem("Right") self.page.comboBox_textAlign.setCurrentIndex(int(self.alignment)) self.page.spinBox_fontSize.setValue(int(self.fontSize)) - self.page.pushButton_center.clicked.connect(self.centerXY) + self.page.pushButton_center.clicked.connect(self.addCenterAction) self.page.fontComboBox_titleFont.currentFontChanged.connect( self._sendUpdateSignal @@ -88,6 +88,11 @@ def previewClickEvent(self, pos, size, button): action = ClickPreviewAction(self, pos, size, button) self.parent.undoStack.push(action) + def addCenterAction(self): + """Triggered when user clicks "center text" button.""" + action = CenterTextAction(self) + self.parent.undoStack.push(action) + def centerXY(self): self.setRelativeWidget("xPosition", 0.5) self.setRelativeWidget("yPosition", 0.521) @@ -216,14 +221,22 @@ def command(self, arg): return super().command(arg) + def getRelativeXY(self): + return ( + self.floatValForAttr( + "xPosition", axis=int(self.settings.value("outputWidth")) + ), + self.floatValForAttr( + "yPosition", axis=int(self.settings.value("outputHeight")) + ), + ) + class ClickPreviewAction(ComponentPreviewClick): def __init__(self, *args): super().__init__(*args) - self.oldX = self.comp.xPosition / int(self.comp.settings.value("outputWidth")) - self.oldY = self.comp.yPosition / int(self.comp.settings.value("outputHeight")) - + self.oldXY = self.comp.getRelativeXY() def add(self): for pos in self.pos[:]: @@ -232,6 +245,21 @@ def add(self): self.comp.update(auto=True) def remove(self): - self.comp.setRelativeWidget("xPosition", self.oldX) - self.comp.setRelativeWidget("yPosition", self.oldY) - self.comp.update(auto=True) \ No newline at end of file + self.comp.setRelativeWidget("xPosition", self.oldXY[0]) + self.comp.setRelativeWidget("yPosition", self.oldXY[1]) + self.comp.update(auto=True) + + +class CenterTextAction(ComponentSettingsUpdate): + def __init__(self, comp): + super().__init__(comp) + self.oldXY = self.comp.getRelativeXY() + + def redo(self): + self.comp.centerXY() + + def undo(self): + # set back to old values + self.comp.setRelativeWidget("xPosition", self.oldXY[0]) + self.comp.setRelativeWidget("yPosition", self.oldXY[1]) + self.comp.update(auto=True) diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index 17faa3c..4e4dd06 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -150,4 +150,28 @@ def undo(self): if self.button == 1: # Left-click self.remove() elif self.button == 2: # Right-click - self.add() \ No newline at end of file + self.add() + + +class ComponentSettingsUpdate(QUndoCommand): + """ + This QUndoCommand represents any change to a component's settings + not already covered by another action type above. + A component should define a subclass to define `redo()` and `undo()`, + manually create instances, and add them to the undoStack when needed. + """ + + def __init__(self, comp): + super().__init__("change %s component #%s" % (comp.name, comp.compPos)) + self.comp = comp + self.res = (int(comp.width), int(comp.height)) + + def id(self): + return -1 + + def mergeWith(self): + return True + + def redo(self): ... + + def undo(self): ... From 327eada0c7edaf7af27c5394117f653bd8e5d996 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Fri, 5 Jun 2026 17:31:28 -0400 Subject: [PATCH 18/67] remove some unnecessary code --- src/avp/components/text.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/avp/components/text.py b/src/avp/components/text.py index 4a14022..320a11d 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -221,45 +221,37 @@ def command(self, arg): return super().command(arg) - def getRelativeXY(self): - return ( - self.floatValForAttr( - "xPosition", axis=int(self.settings.value("outputWidth")) - ), - self.floatValForAttr( - "yPosition", axis=int(self.settings.value("outputHeight")) - ), - ) - class ClickPreviewAction(ComponentPreviewClick): def __init__(self, *args): super().__init__(*args) - self.oldXY = self.comp.getRelativeXY() + self.oldXY = ( + self.comp.floatValForAttr("xPosition"), + self.comp.floatValForAttr("yPosition"), + ) def add(self): for pos in self.pos[:]: self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) self.comp.setRelativeWidget("yPosition", pos[1] / self.size[1]) - self.comp.update(auto=True) def remove(self): self.comp.setRelativeWidget("xPosition", self.oldXY[0]) self.comp.setRelativeWidget("yPosition", self.oldXY[1]) - self.comp.update(auto=True) class CenterTextAction(ComponentSettingsUpdate): def __init__(self, comp): super().__init__(comp) - self.oldXY = self.comp.getRelativeXY() + self.oldXY = ( + self.comp.floatValForAttr("xPosition"), + self.comp.floatValForAttr("yPosition"), + ) def redo(self): self.comp.centerXY() def undo(self): - # set back to old values self.comp.setRelativeWidget("xPosition", self.oldXY[0]) self.comp.setRelativeWidget("yPosition", self.oldXY[1]) - self.comp.update(auto=True) From dc3e56741609d4723787d45424726d18f4711426 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Fri, 5 Jun 2026 19:04:01 -0400 Subject: [PATCH 19/67] update Qt namespace --- src/avp/components/__template__.ui | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/avp/components/__template__.ui b/src/avp/components/__template__.ui index 301a2b7..ee2fe84 100644 --- a/src/avp/components/__template__.ui +++ b/src/avp/components/__template__.ui @@ -19,7 +19,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -36,7 +36,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -53,7 +53,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -70,7 +70,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -87,7 +87,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -102,7 +102,7 @@ - Qt::Vertical + Qt::Orientation::Vertical From 3a5126ef5c2112c7469106ed78a31fd3def437aa Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Fri, 5 Jun 2026 19:05:38 -0400 Subject: [PATCH 20/67] minor style/consistency fixes --- src/avp/components/text.py | 6 +++--- src/avp/components/text.ui | 2 +- src/avp/libcomponent/actions.py | 10 ++++------ tests/test_mainwindow_comp_actions.py | 4 +++- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/avp/components/text.py b/src/avp/components/text.py index 320a11d..ff6c7f0 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -33,7 +33,7 @@ def widget(self, *args): # The QFontComboBox must be connected directly to the Qt Signal # which triggers the preview to update. # This unfortunately makes changing the font into a non-undoable action. - # Fix requires updating ComponentAction to handle fonts + # Fix requires updating ComponentTrackedWidgetUpdate to handle fonts self.trackWidgets( { @@ -70,13 +70,13 @@ def widget(self, *args): def update(self): self.titleFont = self.page.fontComboBox_titleFont.currentFont() if self.page.checkBox_shadow.isChecked(): - self.page.label_shadX.setHidden(False) + self.page.label_shadOffset.setHidden(False) self.page.spinBox_shadX.setHidden(False) self.page.spinBox_shadY.setHidden(False) self.page.label_shadBlur.setHidden(False) self.page.spinBox_shadBlur.setHidden(False) else: - self.page.label_shadX.setHidden(True) + self.page.label_shadOffset.setHidden(True) self.page.spinBox_shadX.setHidden(True) self.page.spinBox_shadY.setHidden(True) self.page.label_shadBlur.setHidden(True) diff --git a/src/avp/components/text.ui b/src/avp/components/text.ui index bd98790..312b530 100644 --- a/src/avp/components/text.ui +++ b/src/avp/components/text.ui @@ -557,7 +557,7 @@ - + 0 diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index 4e4dd06..a1bf04f 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -134,12 +134,6 @@ def mergeWith(self, other): self.pos.extend(other.pos) return True - def add(self): - ... - - def remove(self): - ... - def redo(self): if self.button == 1: # Left-click self.add() @@ -152,6 +146,10 @@ def undo(self): elif self.button == 2: # Right-click self.add() + def add(self): ... + + def remove(self): ... + class ComponentSettingsUpdate(QUndoCommand): """ diff --git a/tests/test_mainwindow_comp_actions.py b/tests/test_mainwindow_comp_actions.py index 5d3cc7a..d2b11d3 100644 --- a/tests/test_mainwindow_comp_actions.py +++ b/tests/test_mainwindow_comp_actions.py @@ -1,4 +1,6 @@ -"""Tests of MainWindow undoing certain ComponentActions (changes to component settings)""" +""" +Tests of MainWindow undoing certain ComponentTrackedWidgetUpdates +""" from pytest import fixture from pytestqt import qtbot From b593e20c96fe79940c00968ec835f3b5f82c8501 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Fri, 5 Jun 2026 19:06:57 -0400 Subject: [PATCH 21/67] Image component: Add shadow options & "center image" button --- src/avp/components/image.py | 102 +++++++++++++++++-- src/avp/components/image.ui | 189 ++++++++++++++++++++++++++++++------ 2 files changed, 252 insertions(+), 39 deletions(-) diff --git a/src/avp/components/image.py b/src/avp/components/image.py index a082092..e1857f2 100644 --- a/src/avp/components/image.py +++ b/src/avp/components/image.py @@ -1,15 +1,16 @@ from PIL import Image, ImageOps, ImageEnhance -from PyQt6 import QtWidgets +from PyQt6 import QtWidgets, QtCore import os from ..libcomponent import BaseComponent +from ..libcomponent.actions import ComponentPreviewClick, ComponentSettingsUpdate from ..toolkit.frame import BlankFrame, addShadow from ..toolkit.visualizer import createSpectrumArray class Component(BaseComponent): name = "Image" - version = "2.1.0" + version = "2.2.0" def widget(self, *args): super().widget(*args) @@ -17,7 +18,11 @@ def widget(self, *args): # cache a modified image object in case we are rendering beyond frame 1 self.existingImage = None + # cache image size for reference when centering the image + self.imageSize = (0, 0) + self.page.pushButton_image.clicked.connect(self.pickImage) + self.page.pushButton_centerImage.clicked.connect(self.addCenterAction) self.page.comboBox_resizeMode.addItem("Scale") self.page.comboBox_resizeMode.addItem("Cover") self.page.comboBox_resizeMode.addItem("Stretch") @@ -35,13 +40,23 @@ def widget(self, *args): "respondToAudio": self.page.checkBox_respondToAudio, "sensitivity": self.page.spinBox_sensitivity, "shadow": self.page.checkBox_shadow, + "shadX": self.page.spinBox_shadX, + "shadY": self.page.spinBox_shadY, + "shadBlur": self.page.spinBox_shadBlur, }, presetNames={ "imagePath": "image", "xPosition": "x", "yPosition": "y", }, - relativeWidgets=["xPosition", "yPosition", "scale"], + relativeWidgets=[ + "xPosition", + "yPosition", + "scale", + "shadX", + "shadY", + "shadBlur", + ], ) def update(self): @@ -51,6 +66,41 @@ def update(self): self.page.spinBox_scale.setEnabled( self.page.comboBox_resizeMode.currentIndex() == 0 ) + if self.page.checkBox_shadow.isChecked(): + self.page.label_shadOffset.setHidden(False) + self.page.spinBox_shadX.setHidden(False) + self.page.spinBox_shadY.setHidden(False) + self.page.label_shadBlur.setHidden(False) + self.page.spinBox_shadBlur.setHidden(False) + else: + self.page.label_shadOffset.setHidden(True) + self.page.spinBox_shadX.setHidden(True) + self.page.spinBox_shadY.setHidden(True) + self.page.label_shadBlur.setHidden(True) + self.page.spinBox_shadBlur.setHidden(True) + + def previewClickEvent(self, pos, size, button): + if button != QtCore.Qt.MouseButton.LeftButton: + return + action = ClickPreviewAction(self, pos, size, button) + self.parent.undoStack.push(action) + + def addCenterAction(self): + """Triggered when user clicks "center image" button.""" + if self.imageSize == (0, 0): + return + action = CenterImageAction(self) + self.parent.undoStack.push(action) + + def centerXY(self): + self.setRelativeWidget( + "xPosition", + 0.5 - (self.floatValForAttr("xPosition", self.imageSize[0]) / 2), + ) + self.setRelativeWidget( + "yPosition", + 0.5 - (self.floatValForAttr("yPosition", self.imageSize[1] / 2)), + ) def previewRender(self): return self.drawFrame(self.width, self.height, None) @@ -122,12 +172,15 @@ def drawFrame(self, width, height, dynamicScale): (newWidth, newHeight), Image.Resampling.LANCZOS ) self.existingImage = image + self.imageSize = (image.width, image.height) - # Respond to audio + # Shadow-related variables (modified below if "respond to audio") resolutionFactor = height / 1080 - shadX = int(resolutionFactor * 1) - shadY = int(resolutionFactor * -1) - shadBlur = resolutionFactor * 3.50 + shadX = int(resolutionFactor * self.shadX) + shadY = int(resolutionFactor * self.shadY) + shadBlur = resolutionFactor * (self.shadBlur / 10) + + # Respond to audio scale = 0 if dynamicScale is not None: scale = dynamicScale[36 * 4] / 4 @@ -196,3 +249,38 @@ def fail(): def commandHelp(self): print("Load an image:\n path=/filepath/to/image.png") + + +class ClickPreviewAction(ComponentPreviewClick): + def __init__(self, *args): + super().__init__(*args) + + self.oldXY = ( + self.comp.floatValForAttr("xPosition"), + self.comp.floatValForAttr("yPosition"), + ) + + def add(self): + for pos in self.pos[:]: + self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) + self.comp.setRelativeWidget("yPosition", pos[1] / self.size[1]) + + def remove(self): + self.comp.setRelativeWidget("xPosition", self.oldXY[0]) + self.comp.setRelativeWidget("yPosition", self.oldXY[1]) + + +class CenterImageAction(ComponentSettingsUpdate): + def __init__(self, comp): + super().__init__(comp) + self.oldXY = ( + self.comp.floatValForAttr("xPosition"), + self.comp.floatValForAttr("yPosition"), + ) + + def redo(self): + self.comp.centerXY() + + def undo(self): + self.comp.setRelativeWidget("xPosition", self.oldXY[0]) + self.comp.setRelativeWidget("yPosition", self.oldXY[1]) diff --git a/src/avp/components/image.ui b/src/avp/components/image.ui index b53c4b0..6b8d68b 100644 --- a/src/avp/components/image.ui +++ b/src/avp/components/image.ui @@ -98,7 +98,7 @@ - + 0 @@ -133,7 +133,7 @@ - + 0 @@ -194,13 +194,52 @@ - + + + + 0 + 0 + + + + + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Minimum + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Center Image + + Qt::Orientation::Horizontal + + QSizePolicy::Policy::Minimum + 40 @@ -294,30 +333,7 @@ - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - Qt::LayoutDirection::RightToLeft - - - Shadow - - - - - + 0 @@ -354,12 +370,8 @@ - - - - - + Qt::Orientation::Horizontal @@ -373,6 +385,12 @@ + + + 0 + 0 + + Scale image in response to input audio file @@ -412,6 +430,110 @@ + + + + QLayout::SizeConstraint::SetFixedSize + + + + + + 0 + 0 + + + + Qt::LayoutDirection::LeftToRight + + + Shadow + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Shadow Offset + + + + + + + + 0 + 0 + + + + + + + + + + -1000 + + + 1000 + + + 1 + + + + + + + -1000 + + + 1000 + + + -1 + + + + + + + Shadow Blur + + + + + + + 35 + + + 10 + + + + + @@ -419,6 +541,9 @@ Qt::Orientation::Vertical + + QSizePolicy::Policy::Preferred + 20 From a998a38f8e37deddef6495a960d4df85d8af215e Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Fri, 5 Jun 2026 19:19:16 -0400 Subject: [PATCH 22/67] Image component: don't change x, y with mouse or button if imagePath is invalid --- src/avp/components/image.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/avp/components/image.py b/src/avp/components/image.py index e1857f2..7e0f828 100644 --- a/src/avp/components/image.py +++ b/src/avp/components/image.py @@ -80,7 +80,7 @@ def update(self): self.page.spinBox_shadBlur.setHidden(True) def previewClickEvent(self, pos, size, button): - if button != QtCore.Qt.MouseButton.LeftButton: + if self.imageSize == (0, 0) or button != QtCore.Qt.MouseButton.LeftButton: return action = ClickPreviewAction(self, pos, size, button) self.parent.undoStack.push(action) @@ -208,7 +208,8 @@ def drawFrame(self, width, height, dynamicScale): frame = frame.rotate(self.rotate) if self.shadow: frame = addShadow(frame, shadBlur, shadX, shadY) - + else: + self.imageSize = (0, 0) return frame def postFrameRender(self): From a6d295df9ccb014ef42f8696203b38650a1e16c3 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Fri, 5 Jun 2026 20:19:49 -0400 Subject: [PATCH 23/67] test changing (x, y) with mouse click & center text button --- tests/test_comp_text.py | 45 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tests/test_comp_text.py b/tests/test_comp_text.py index 8f98ca0..8223870 100644 --- a/tests/test_comp_text.py +++ b/tests/test_comp_text.py @@ -1,8 +1,9 @@ from avp.command import Command +from PyQt6 import QtCore from PyQt6.QtGui import QFont from pytestqt import qtbot from pytest import fixture, mark -from . import audioData, command, MockSignal, imageDataSum +from . import audioData, command, window, MockSignal, imageDataSum @fixture @@ -12,6 +13,12 @@ def coreWithTextComp(qtbot, command): yield command.core +@fixture +def windowWithTextComp(qtbot, window): + window.core.insertComponent(0, window.core.moduleIndexFor("Title Text"), window) + yield window + + def setTextSettings(comp): comp.page.spinBox_fontSize.setValue(40) comp.page.checkBox_shadow.setChecked(True) @@ -49,3 +56,39 @@ def test_comp_text_alignment(coreWithTextComp, alignment): comp = coreWithTextComp.selectedComponents[0] comp.page.comboBox_textAlign.setCurrentIndex(alignment) assert comp.alignment == alignment + + +@mark.parametrize("pos", ((0, 0), (23, 37), (900, 900))) +def test_comp_text_previewClickEvent_dynamic_assertion(windowWithTextComp, pos): + comp = windowWithTextComp.core.selectedComponents[0] + comp.previewClickEvent(pos, (555, 333), QtCore.Qt.MouseButton.LeftButton) + assert comp.xPosition == comp.pixelValForAttr("xPosition") + assert comp.yPosition == comp.pixelValForAttr("yPosition") + + +def test_comp_text_previewClickEvent_static_assertion(windowWithTextComp): + """Test without using pixelValForAttr method""" + comp = windowWithTextComp.core.selectedComponents[0] + comp.previewClickEvent((192, 108), (1920, 1080), QtCore.Qt.MouseButton.LeftButton) + assert comp.xPosition == 192 + assert comp.yPosition == 108 + + +def test_comp_text_previewClickEvent_undo_redo(windowWithTextComp): + comp = windowWithTextComp.core.selectedComponents[0] + oldValue = comp.xPosition + comp.previewClickEvent((192, 108), (1920, 1080), QtCore.Qt.MouseButton.LeftButton) + windowWithTextComp.undoStack.undo() + assert comp.xPosition == oldValue + windowWithTextComp.undoStack.redo() + assert comp.xPosition == 192 + + +def test_comp_text_centerText_undo_redo(windowWithTextComp): + comp = windowWithTextComp.core.selectedComponents[0] + comp.page.spinBox_xTextAlign.setValue(0) + comp.page.pushButton_center.click() + windowWithTextComp.undoStack.undo() + assert comp.xPosition == 0 + windowWithTextComp.undoStack.redo() + assert comp.xPosition == comp.pixelValForAttr("xPosition", 0.5) From 2a4d074abf6bff2d93a05510e4821e0c566707c8 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Sat, 6 Jun 2026 19:02:41 -0400 Subject: [PATCH 24/67] change of resolution is undoable --- src/avp/gui/actions.py | 40 +++++++++++++++++++++++++++++++++++++++ src/avp/gui/mainwindow.py | 9 ++------- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/src/avp/gui/actions.py b/src/avp/gui/actions.py index 6a01bdd..64bfbac 100644 --- a/src/avp/gui/actions.py +++ b/src/avp/gui/actions.py @@ -8,11 +8,51 @@ from copy import copy from ..core import Core +from ..toolkit.common import blockSignals log = logging.getLogger("AVP.Gui.Actions") +# =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ +# ENCODER SETTINGS ACTIONS +# =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ + + +class ChangeResolution(QUndoCommand): + def __init__(self, window, newResolutionIndex): + super().__init__( + "change resolution to %s" + % window.comboBox_resolution.itemText(newResolutionIndex) + ) + self.window = window + self.newResolution = tuple(Core.resolutions[newResolutionIndex].split("x")) + self.newResolutionIndex = newResolutionIndex + + # store old resolution + w = window.settings.value("outputWidth") + h = window.settings.value("outputHeight") + self.oldResolution = (w, h) + self.oldResolutionIndex = Core.resolutions.index("%sx%s" % self.oldResolution) + + def updateResolution(self, resolution, index): + self.window.settings.setValue("outputWidth", resolution[0]) + self.window.settings.setValue("outputHeight", resolution[1]) + with blockSignals( + [self.window.comboBox_resolution, *self.window.core.selectedComponents] + ): + self.window.comboBox_resolution.setCurrentIndex(index) + for i in range(len(self.window.core.selectedComponents)): + self.window.core.updateComponent(i) + self.window.drawPreview() + + def redo(self): + self.updateResolution(self.newResolution, self.newResolutionIndex) + + def undo(self): + self.updateResolution(self.oldResolution, self.oldResolutionIndex) + + # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # COMPONENT ACTIONS # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index b7f8321..ba4d841 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -796,13 +796,8 @@ def progressBarSetText(self, value): def updateResolution(self): resIndex = int(self.comboBox_resolution.currentIndex()) - res = Core.resolutions[resIndex].split("x") - changed = res[0] != self.settings.value("outputWidth") - self.settings.setValue("outputWidth", res[0]) - self.settings.setValue("outputHeight", res[1]) - if changed: - for i in range(len(self.core.selectedComponents)): - self.core.updateComponent(i) + action = ChangeResolution(self, resIndex) + self.undoStack.push(action) def drawPreview(self, force=False, **kwargs): """Use autosave keyword arg to force saving or not saving if needed""" From dd7a086fe1386d27b2580411a4140a766cdd4446 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Mon, 8 Jun 2026 21:58:14 -0400 Subject: [PATCH 25/67] close undoDialog and presetManager when MainWindow closes --- src/avp/gui/mainwindow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index ba4d841..3653e45 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -486,6 +486,8 @@ def closeEvent(self, event): self.timer.stop() self.previewThread.quit() self.previewThread.wait() + self.presetManager.close() + self.undoDialog.close() return super().closeEvent(event) @disableWhenOpeningProject From d99cf81482356ffb5e542f9f86a6df373bfdc7dd Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 10 Jun 2026 21:16:08 -0400 Subject: [PATCH 26/67] rework relativeWidgets to use less floats relativeWidgets are no longer saved as floats. Instead, the resolution is saved as part of the preset and the absolute values of relativeWidgets are changed to match the project resolution if it differs from the preset resolution. Component objects now have an `updateResolution` method. fixes #104 --- src/avp/components/life.py | 4 + src/avp/components/text.py | 2 +- src/avp/gui/actions.py | 3 +- src/avp/gui/mainwindow.py | 12 +- src/avp/libcomponent/actions.py | 52 +----- src/avp/libcomponent/component.py | 171 +++++++++--------- .../presets/Classic Visualizer/1/testPreset | 2 +- tests/data/config/projects/testproject.avp | 4 +- .../config/projects/testproject_outdated.avp | 17 ++ tests/test_comp_image.py | 1 + tests/test_comp_text.py | 44 ++++- tests/test_mainwindow_projects.py | 8 + 12 files changed, 162 insertions(+), 158 deletions(-) create mode 100644 tests/data/config/projects/testproject_outdated.avp diff --git a/src/avp/components/life.py b/src/avp/components/life.py index ee85cbf..931e352 100644 --- a/src/avp/components/life.py +++ b/src/avp/components/life.py @@ -108,6 +108,10 @@ def shiftGrid(self, d): action = ShiftGrid(self, d) self.parent.undoStack.push(action) + def updateResolution(self): + super().updateResolution() + self.updateGridSize() + def update(self): self.updateGridSize() diff --git a/src/avp/components/text.py b/src/avp/components/text.py index ff6c7f0..ff334aa 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -101,7 +101,7 @@ def getXY(self): """Returns true x, y after considering alignment settings""" fm = QtGui.QFontMetrics(self.titleFont) text_width = fm.boundingRect(self.title).width() - x = self.pixelValForAttr("xPosition") + x = self.xPosition offset = 0 if self.alignment == 1: # Middle diff --git a/src/avp/gui/actions.py b/src/avp/gui/actions.py index 64bfbac..44573ea 100644 --- a/src/avp/gui/actions.py +++ b/src/avp/gui/actions.py @@ -36,6 +36,7 @@ def __init__(self, window, newResolutionIndex): self.oldResolutionIndex = Core.resolutions.index("%sx%s" % self.oldResolution) def updateResolution(self, resolution, index): + log.debug("Updating resolution to %sx%s" % resolution) self.window.settings.setValue("outputWidth", resolution[0]) self.window.settings.setValue("outputHeight", resolution[1]) with blockSignals( @@ -43,7 +44,7 @@ def updateResolution(self, resolution, index): ): self.window.comboBox_resolution.setCurrentIndex(index) for i in range(len(self.window.core.selectedComponents)): - self.window.core.updateComponent(i) + self.window.core.selectedComponents[i].updateResolution() self.window.drawPreview() def redo(self): diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index 3653e45..751110e 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -492,7 +492,6 @@ def closeEvent(self, event): @disableWhenOpeningProject def updateWindowTitle(self): - log.debug("Setting main window's title") windowTitle = appName try: if self.currentProject: @@ -503,7 +502,7 @@ def updateWindowTitle(self): windowTitle += "*" except AttributeError: pass - log.verbose(f'Window title is "{windowTitle}"') + log.debug("Setting MainWindow title to %s" % windowTitle) self.setWindowTitle(windowTitle) @QtCore.pyqtSlot(int, dict) @@ -796,15 +795,18 @@ def progressBarSetText(self, value): # if the text is our main export progress print(f"\r{value}", end="") - def updateResolution(self): - resIndex = int(self.comboBox_resolution.currentIndex()) + def updateResolution(self, resIndex=None): + if resIndex == -1: + log.error("Resolution combobox is broken.") + return + elif resIndex is None: + resIndex = int(self.comboBox_resolution.currentIndex()) action = ChangeResolution(self, resIndex) self.undoStack.push(action) def drawPreview(self, force=False, **kwargs): """Use autosave keyword arg to force saving or not saving if needed""" self.newTask.emit(self.core.selectedComponents) - # self.processTask.emit() if force or "autosave" in kwargs: if force or kwargs["autosave"]: self.autosave(True) diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index a1bf04f..d8bf3c3 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -24,29 +24,11 @@ def __init__(self, parent, oldWidgetVals, modifiedVals): self.res = (int(parent.width), int(parent.height)) self.parent = parent self.oldWidgetVals = { - attr: ( - copy(val) - if attr not in self.parent._relativeWidgets - else self.parent.floatValForAttr(attr, val, axis=self.res) - ) + attr: (copy(val)) for attr, val in oldWidgetVals.items() if attr in modifiedVals } - self.modifiedVals = { - attr: ( - val - if attr not in self.parent._relativeWidgets - else self.parent.floatValForAttr(attr, val, axis=self.res) - ) - for attr, val in modifiedVals.items() - } - - # Because relative widgets change themselves every update based on - # their previous value, we must store ALL their values in case of undo - self.relativeWidgetValsAfterUndo = { - attr: copy(getattr(self.parent, attr)) - for attr in self.parent._relativeWidgets - } + self.modifiedVals = {attr: (val) for attr, val in modifiedVals.items()} # Determine if this update is mergeable self.id_ = -1 @@ -70,42 +52,16 @@ def mergeWith(self, other): self.modifiedVals.update(other.modifiedVals) return True - def setWidgetValues(self, attrDict): - """ - Mask the component's usual method to handle our - relative widgets in case the resolution has changed. - """ - newAttrDict = { - attr: ( - val - if attr not in self.parent._relativeWidgets - else self.parent.pixelValForAttr(attr, val) - ) - for attr, val in attrDict.items() - } - self.parent.setWidgetValues(newAttrDict) - def redo(self): if self.undone: log.info("Redoing component update") - self.parent.oldAttrs = self.relativeWidgetValsAfterUndo - self.setWidgetValues(self.modifiedVals) + self.parent.setWidgetValues(self.modifiedVals) self.parent.update(auto=True) - self.parent.oldAttrs = None - if not self.undone: - self.relativeWidgetValsAfterRedo = { - attr: copy(getattr(self.parent, attr)) - for attr in self.parent._relativeWidgets - } - self.parent._sendUpdateSignal() def undo(self): log.info("Undoing component update") - self.undone = True - self.parent.oldAttrs = self.relativeWidgetValsAfterRedo - self.setWidgetValues(self.oldWidgetVals) + self.parent.setWidgetValues(self.oldWidgetVals) self.parent.update(auto=True) - self.parent.oldAttrs = None class ComponentPreviewClick(QUndoCommand): diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index 1590ea5..5e8220b 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -46,6 +46,8 @@ def __init__(self, moduleIndex, compPos, core): self.moduleIndex = moduleIndex self.compPos = compPos self.core = core + self._width = int(core.settings.value("outputWidth")) + self._height = int(core.settings.value("outputHeight")) # STATUS VARIABLES self.currentPreset = None @@ -56,9 +58,7 @@ def __init__(self, moduleIndex, compPos, core): self._colorWidgets = {} self._colorFuncs = {} self._relativeWidgets = {} - # Pixel values stored as floats - self._relativeValues = {} - # Maximum values of spinBoxes at 1080p (Core.resolutions[0]) + # Maximum values of relativeWidget spinBoxes at 1080p (Core.resolutions[0]) self._relativeMaximums = {} # LOCKING VARIABLES @@ -67,8 +67,6 @@ def __init__(self, moduleIndex, compPos, core): self._lockedProperties = None self._lockedError = None self._lockedSize = None - # If set to a dict, values are used as basis to update relative widgets - self.oldAttrs = None # Stop lengthy processes in response to this variable self.canceled = False @@ -102,8 +100,9 @@ def previewRender(self): def preFrameRender(self, **kwargs): """ + Occurs once before export begins, before first call to frameRender Must call super() when subclassing - Triggered only before a video is exported (video_thread.py) + Triggered only before a video is exported (in `video_thread.py`) self.audioFile = filepath to the main input audio file self.completeAudioArray = a list of audio samples self.sampleSize = number of audio samples per video frame @@ -116,12 +115,14 @@ def preFrameRender(self, **kwargs): setattr(self, key, value) def frameRender(self, frameNo): + """Occurs once per frame exported""" + # Example code: audioArrayIndex = frameNo * self.sampleSize image = BlankFrame(self.width, self.height) return image def postFrameRender(self): - pass + """Occurs once when export completes, after final call to frameRender""" # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # Properties @@ -192,25 +193,47 @@ def widget(self, parent): def update(self): """ Starting point for a component update. A subclass should override - this method, and the base class will then magically insert a call + this method, and the metaclass will then magically insert a call to either _autoUpdate() or _userUpdate() at the end. """ def loadPreset(self, presetDict, presetName=None): """ - Subclasses should take (presetDict, *args) as args. - Must use super().loadPreset(presetDict, *args) first, + Normally does not need to be implemented by the subclass. + If needed, subclasses should take (presetDict, *args) as args, + use super().loadPreset(presetDict, *args) first, then update self.page widgets using the preset dict. """ + getPresetAttrName = lambda attr: ( + attr if attr not in self._presetNames else self._presetNames[attr] + ) self.currentPreset = ( presetName if presetName is not None else presetDict["preset"] ) + currentResolution = (self.width, self.height) + + # Fix relative widget values if resolution wasn't saved into preset + # This happens if loading a file from before v2.3.0 + if "resolution" not in presetDict: + log.warning( + "Resolution not saved%s. Using project resolution." % "" + if self.currentPreset is None + else " for %s" % self.currentPreset + ) + presetDict["resolution"] = currentResolution + for attr in self._relativeWidgets: + if type(presetDict[getPresetAttrName(attr)]) == float: + presetDict[getPresetAttrName(attr)] = self.pixelValForAttr( + attr, presetDict[getPresetAttrName(attr)] + ) + + self._width, self._height = presetDict["resolution"] for attr, widget in self._trackedWidgets.items(): - key = attr if attr not in self._presetNames else self._presetNames[attr] + key = getPresetAttrName(attr) try: val = presetDict[key] except KeyError as e: - log.info( + log.warning( "%s missing value %s. Outdated preset?", self.currentPreset, str(e), @@ -224,28 +247,22 @@ def loadPreset(self, presetDict, presetName=None): % QColor(*val).name() ) self._colorWidgets[attr].setStyleSheet(btnStyle) - elif attr in self._relativeWidgets: - self._relativeValues[attr] = val - pixelVal = self.pixelValForAttr(attr, val) - setWidgetValue(widget, pixelVal) else: setWidgetValue(widget, val) + if presetDict["resolution"] != currentResolution: + self.updateResolution() + def savePreset(self): saveValueStore = {} for attr, widget in self._trackedWidgets.items(): presetAttrName = ( attr if attr not in self._presetNames else self._presetNames[attr] ) - if attr in self._relativeWidgets: - try: - val = self._relativeValues[attr] - except AttributeError: - val = self.floatValForAttr(attr) - else: - val = getattr(self, attr) + val = getattr(self, attr) saveValueStore[presetAttrName] = val + saveValueStore["resolution"] = (self.width, self.height) return saveValueStore def commandHelp(self): @@ -270,8 +287,6 @@ def command(self, arg=""): # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ def _preUpdate(self): """Happens before subclass update()""" - for attr in self._relativeWidgets: - self.updateRelativeWidget(attr) def _userUpdate(self): """Happens after subclass update() for an undoable update by user.""" @@ -304,6 +319,22 @@ def _autoUpdate(self): self.setAttrs(newWidgetVals) self._sendUpdateSignal() + def updateResolution(self): + newWidth = int(self.parent.settings.value("outputWidth")) + newHeight = int(self.parent.settings.value("outputHeight")) + log.info( + "Updating relative widget values for %s from %sx%s to %sx%s." + % (self.name, self.width, self.height, newWidth, newHeight) + ) + for attr in self._relativeWidgets: + self.updateRelativeWidgetResolution( + attr, (self.width, self.height), (newWidth, newHeight) + ) + self._width = newWidth + self._height = newHeight + self._preUpdate() + self._autoUpdate() + def setAttrs(self, attrDict): """ Sets attrs (linked to trackedWidgets) in this component to @@ -326,7 +357,7 @@ def setAttrs(self, attrDict): else: # Normal tracked widget setattr(self, attr, val) - log.verbose("Setting %s self.%s to %s" % (self.__class__.name, attr, val)) + log.debug("Setting %s self.%s to %s" % (self.__class__.name, attr, val)) def setWidgetValues(self, attrDict): """ @@ -346,6 +377,7 @@ def _sendUpdateSignal(self): self.parent.drawPreview() saveValueStore = self.savePreset() saveValueStore["preset"] = self.currentPreset + saveValueStore["resolution"] = (self.width, self.height) self.modified.emit(self.compPos, saveValueStore) def trackWidgets(self, trackDict, **kwargs): @@ -404,12 +436,12 @@ def pickColor_(): ).name() ) - if kwarg == "relativeWidgets": + elif kwarg == "relativeWidgets": # store maximum values of spinBoxes to be scaled appropriately for attr in kwargs[kwarg]: self._relativeMaximums[attr] = self._trackedWidgets[attr].maximum() - self.updateRelativeWidgetMaximum(attr) - setattr(self, attr, getWidgetValue(self._trackedWidgets[attr])) + self.updateRelativeWidgetMaximum(attr, (self.width, self.height)) + setattr(self, attr, self._trackedWidgets[attr].value()) self._preUpdate() self._autoUpdate() @@ -459,14 +491,14 @@ def loadUi(self, filename): @property def width(self): if self._lockedSize is None: - return int(self.settings.value("outputWidth")) + return self._width else: return self._lockedSize[0] @property def height(self): if self._lockedSize is None: - return int(self.settings.value("outputHeight")) + return self._height else: return self._lockedSize[1] @@ -503,24 +535,10 @@ def relativeWidgetAxis(self, attr, *args, **kwargs): @relativeWidgetAxis def pixelValForAttr(self, attr, val=None, **kwargs): if val is None: - val = self._relativeValues[attr] - if val > 50.0: - log.warning( - "%s #%s attempted to set %s to dangerously high number %s", - self.__class__.name, - self.compPos, - attr, - val, + val = self.floatValForAttr( + attr, self._trackedWidgets[attr].value(), axis=kwargs["axis"] ) - val = 50.0 result = math.ceil(kwargs["axis"] * val) - log.verbose( - "Converting %s: f%s to px%s using axis %s", - attr, - val, - result, - kwargs["axis"], - ) return result @relativeWidgetAxis @@ -536,48 +554,21 @@ def setRelativeWidget(self, attr, floatVal): self._trackedWidgets[attr].setValue(pixelVal) self.update(auto=True) - def getOldAttr(self, attr): - """ - Returns previous state of this attr. Used to determine whether - a relative widget must be updated. Required because undoing/redoing - can make determining the 'previous' value tricky. - """ - if self.oldAttrs is not None: - return self.oldAttrs[attr] - else: - try: - return getattr(self, attr) - except AttributeError: - log.error("Using visible values instead of oldAttrs") - return self._trackedWidgets[attr].value() - - def updateRelativeWidget(self, attr): - """Called by _preUpdate() for each relativeWidget before each update""" - oldUserValue = self.getOldAttr(attr) - newUserValue = self._trackedWidgets[attr].value() - newRelativeVal = self.floatValForAttr(attr, newUserValue) - - if attr in self._relativeValues: - oldRelativeVal = self._relativeValues[attr] - if oldUserValue == newUserValue and oldRelativeVal != newRelativeVal: - # Float changed without pixel value changing, which - # means the pixel value needs to be updated - # TODO QDoubleSpinBox doesn't work with relativeWidgets because of this - log.debug( - "Updating %s #%s's relative widget: %s", - self.__class__.name, - self.compPos, - attr, - ) - with blockSignals(self._trackedWidgets[attr]): - self.updateRelativeWidgetMaximum(attr) - pixelVal = self.pixelValForAttr(attr, oldRelativeVal) - self._trackedWidgets[attr].setValue(pixelVal) - - if attr not in self._relativeValues or oldUserValue != newUserValue: - self._relativeValues[attr] = newRelativeVal + def updateRelativeWidgetResolution(self, attr, oldResolution, newResolution): + """Called for each relativeWidget when resolution changes""" + val = self._trackedWidgets[attr].value() + newVal = self.pixelValForAttr( + attr, + self.floatValForAttr(attr, val, axis=oldResolution), + axis=newResolution, + ) + with blockSignals(self._trackedWidgets[attr]): + self.updateRelativeWidgetMaximum(attr, newResolution) + self._trackedWidgets[attr].setValue(newVal) + return newVal - def updateRelativeWidgetMaximum(self, attr): - maxRes = int(self.core.resolutions[0].split("x")[0]) - newMaximumValue = self.width * (self._relativeMaximums[attr] / maxRes) + def updateRelativeWidgetMaximum(self, attr, newResolution): + newMaximumValue = newResolution[0] * ( + self._relativeMaximums[attr] / int(self.core.resolutions[0].split("x")[0]) + ) self._trackedWidgets[attr].setMaximum(int(newMaximumValue)) diff --git a/tests/data/config/presets/Classic Visualizer/1/testPreset b/tests/data/config/presets/Classic Visualizer/1/testPreset index c9b2498..9a659f3 100644 --- a/tests/data/config/presets/Classic Visualizer/1/testPreset +++ b/tests/data/config/presets/Classic Visualizer/1/testPreset @@ -1 +1 @@ -OrderedDict({'bars': 63, 'invert': False, 'layout': 0, 'preset': 'testPreset', 'scale': 20, 'smooth': 0, 'visColor': (159, 233, 100), 'y': 0.0}) \ No newline at end of file +OrderedDict({'bars': 63, 'invert': False, 'layout': 0, 'preset': 'testPreset', 'scale': 20, 'smooth': 0, 'visColor': (159, 233, 100), 'y': 0}) \ No newline at end of file diff --git a/tests/data/config/projects/testproject.avp b/tests/data/config/projects/testproject.avp index 9639716..471f18c 100644 --- a/tests/data/config/projects/testproject.avp +++ b/tests/data/config/projects/testproject.avp @@ -1,10 +1,10 @@ [Components] Classic Visualizer 1 -OrderedDict({'bars': 63, 'layout': 0, 'preset': None, 'scale': 20, 'smooth': 0, 'visColor': (255, 255, 255), 'y': 0.0}) +OrderedDict({'bars': 63, 'invert': False, 'layout': 0, 'preset': None, 'resolution': (1280, 720), 'scale': 20, 'smooth': 0, 'visColor': (255, 255, 255), 'y': 0}) Color 1 -OrderedDict({'LG_end': 0.0, 'LG_start': 0.0, 'RG_centre': 0.0015625, 'RG_end': 0.0, 'RG_start': 0.0, 'color1': (0, 0, 0), 'color2': (133, 133, 133), 'fillType': 0, 'height': 1.0, 'preset': None, 'spread': 0, 'stretch': False, 'trans': False, 'width': 1.0, 'x': 0.0, 'y': 0.0}) +OrderedDict({'LG_end': 0, 'LG_start': 0, 'RG_centre': 2, 'RG_end': 0, 'RG_start': 0, 'color1': (0, 0, 0), 'color2': (133, 133, 133), 'fillType': 0, 'height': 720, 'preset': None, 'resolution': (1280, 720), 'spread': 0, 'stretch': False, 'trans': False, 'width': 1280, 'x': 0, 'y': 0}) [Settings] componentDir=tests/data/inputfiles diff --git a/tests/data/config/projects/testproject_outdated.avp b/tests/data/config/projects/testproject_outdated.avp new file mode 100644 index 0000000..9639716 --- /dev/null +++ b/tests/data/config/projects/testproject_outdated.avp @@ -0,0 +1,17 @@ +[Components] +Classic Visualizer +1 +OrderedDict({'bars': 63, 'layout': 0, 'preset': None, 'scale': 20, 'smooth': 0, 'visColor': (255, 255, 255), 'y': 0.0}) +Color +1 +OrderedDict({'LG_end': 0.0, 'LG_start': 0.0, 'RG_centre': 0.0015625, 'RG_end': 0.0, 'RG_start': 0.0, 'color1': (0, 0, 0), 'color2': (133, 133, 133), 'fillType': 0, 'height': 1.0, 'preset': None, 'spread': 0, 'stretch': False, 'trans': False, 'width': 1.0, 'x': 0.0, 'y': 0.0}) + +[Settings] +componentDir=tests/data/inputfiles +inputDir=tests/data/inputfiles +presetDir=tests/data/config/presets +projectDir=tests/data/config/projects + +[WindowFields] +lineEdit_audioFile=tests/data/inputfiles/test.ogg +lineEdit_outputFile= diff --git a/tests/test_comp_image.py b/tests/test_comp_image.py index b221df4..209057b 100644 --- a/tests/test_comp_image.py +++ b/tests/test_comp_image.py @@ -45,6 +45,7 @@ def test_comp_image_scale_50_720p(coreWithImageComp): sum = imageDataSum(image) comp.parent.settings.setValue("outputHeight", 720) comp.parent.settings.setValue("outputWidth", 1280) + comp.updateResolution() newImage = comp.previewRender() assert image.width == 1920 assert newImage.width == 1280 diff --git a/tests/test_comp_text.py b/tests/test_comp_text.py index 8223870..d774828 100644 --- a/tests/test_comp_text.py +++ b/tests/test_comp_text.py @@ -38,6 +38,7 @@ def test_comp_text_renderFrame(coreWithTextComp, width, height): comp = coreWithTextComp.selectedComponents[0] comp.parent.settings.setValue("outputWidth", width) comp.parent.settings.setValue("outputHeight", height) + comp.updateResolution() setTextSettings(comp) comp.centerXY() image = comp.frameRender(0) @@ -58,16 +59,7 @@ def test_comp_text_alignment(coreWithTextComp, alignment): assert comp.alignment == alignment -@mark.parametrize("pos", ((0, 0), (23, 37), (900, 900))) -def test_comp_text_previewClickEvent_dynamic_assertion(windowWithTextComp, pos): - comp = windowWithTextComp.core.selectedComponents[0] - comp.previewClickEvent(pos, (555, 333), QtCore.Qt.MouseButton.LeftButton) - assert comp.xPosition == comp.pixelValForAttr("xPosition") - assert comp.yPosition == comp.pixelValForAttr("yPosition") - - -def test_comp_text_previewClickEvent_static_assertion(windowWithTextComp): - """Test without using pixelValForAttr method""" +def test_comp_text_previewClickEvent(windowWithTextComp): comp = windowWithTextComp.core.selectedComponents[0] comp.previewClickEvent((192, 108), (1920, 1080), QtCore.Qt.MouseButton.LeftButton) assert comp.xPosition == 192 @@ -92,3 +84,35 @@ def test_comp_text_centerText_undo_redo(windowWithTextComp): assert comp.xPosition == 0 windowWithTextComp.undoStack.redo() assert comp.xPosition == comp.pixelValForAttr("xPosition", 0.5) + + +def test_comp_text_fontSize_relative_to_resolution(windowWithTextComp): + comp = windowWithTextComp.core.selectedComponents[0] + # resolution is 1920x1080 + comp.page.spinBox_fontSize.setValue(200) + # set resolution to 1280x720 + windowWithTextComp.updateResolution(1) + assert comp.fontSize == 134 + # set resolution to 854x480 + windowWithTextComp.updateResolution(2) + assert comp.fontSize == 90 + + +def test_comp_text_fontSize_rounding_errors(windowWithTextComp): + """Test that `relativeWidgets` system does not interfere with setValue""" + comp = windowWithTextComp.core.selectedComponents[0] + for i in range(1, 501): + comp.page.spinBox_fontSize.setValue(i) + assert comp.fontSize == i + + +def test_comp_text_fontSize_maximum(windowWithTextComp): + comp = windowWithTextComp.core.selectedComponents[0] + # resolution is 1920x1080 + assert comp.page.spinBox_fontSize.maximum() == 500 + # set resolution to 1280x720 + windowWithTextComp.updateResolution(1) + assert comp.page.spinBox_fontSize.maximum() == 333 + # set resolution to 854x480 + windowWithTextComp.updateResolution(2) + assert comp.page.spinBox_fontSize.maximum() == 222 diff --git a/tests/test_mainwindow_projects.py b/tests/test_mainwindow_projects.py index a6df476..fd0f8ef 100644 --- a/tests/test_mainwindow_projects.py +++ b/tests/test_mainwindow_projects.py @@ -29,6 +29,14 @@ def test_mainwindow_openProject(qtbot, window): assert len(window.core.selectedComponents) == 2 +def test_mainwindow_openProject_with_outdated_file(qtbot, window): + """Open outdated project file using MainWindow.openProject()""" + window.openProject( + getTestDataPath("config/projects/testproject_outdated.avp"), prompt=False + ) + assert len(window.core.selectedComponents) == 2 + + def test_mainwindow_newProject_without_unsaved_changes(qtbot, window): """Starting new project without unsaved changes""" didCallFunction = False From 071ff3c24e281a86d40589910627325067a5a14a Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 11 Jun 2026 20:59:45 -0400 Subject: [PATCH 27/67] allow multiple `--verbose`/`-v` arguments to set log level -v sets level to info -vv sets level to debug -vvv sets level to verbose --- src/avp/command.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/avp/command.py b/src/avp/command.py index 41cdb3a..41097ce 100644 --- a/src/avp/command.py +++ b/src/avp/command.py @@ -74,7 +74,8 @@ def parseArgs(self): debugCommands.add_argument( "--verbose", "-v", - action="store_true", + action="count", + default=0, help="send log messages and ffmpeg output to stdout, and create more verbose log files (good to use before --log)", ) @@ -102,8 +103,8 @@ def parseArgs(self): args = parser.parse_args() - if args.verbose: - Core.stdoutLogLvl = logging.DEBUG + if args.verbose > 0: + Core.stdoutLogLvl -= 10 * args.verbose Core.makeLogger(deleteOldLogs=False, fileLogLvl=logging.DEBUG) if args.log: @@ -177,6 +178,8 @@ def parseArgs(self): and "help" not in sys.argv and "--verbose" not in sys.argv and "-v" not in sys.argv + and "-vv" not in sys.argv + and "-vvv" not in sys.argv and "--log" not in sys.argv ): parser.print_help() From fd61520d68a73c6e78dcecd46a77f7985e3e07b2 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 11 Jun 2026 21:09:54 -0400 Subject: [PATCH 28/67] rename parent to loader * remove settings property from components * add hasUndoStack function for checking if the loader has an undostack --- src/avp/components/color.py | 4 ++-- src/avp/components/image.py | 17 +++++++++------ src/avp/components/life.py | 11 ++++++---- src/avp/components/sound.py | 4 ++-- src/avp/components/spectrum.py | 24 ++++++++++----------- src/avp/components/text.py | 9 ++++++-- src/avp/components/video.py | 12 +++++------ src/avp/components/waveform.py | 22 +++++++++---------- src/avp/libcomponent/component.py | 36 ++++++++++++++++++------------- src/avp/libcomponent/metaclass.py | 4 ++-- src/avp/toolkit/common.py | 5 +++++ tests/test_comp_image.py | 4 ++-- tests/test_comp_text.py | 4 ++-- 13 files changed, 90 insertions(+), 66 deletions(-) diff --git a/src/avp/components/color.py b/src/avp/components/color.py index 826f37f..980b4c6 100644 --- a/src/avp/components/color.py +++ b/src/avp/components/color.py @@ -20,8 +20,8 @@ def widget(self, *args): # disable color #2 until non-default 'fill' option gets changed self.page.lineEdit_color2.setDisabled(True) self.page.pushButton_color2.setDisabled(True) - self.page.spinBox_width.setValue(int(self.settings.value("outputWidth"))) - self.page.spinBox_height.setValue(int(self.settings.value("outputHeight"))) + self.page.spinBox_width.setValue(int(self.core.settings.value("outputWidth"))) + self.page.spinBox_height.setValue(int(self.core.settings.value("outputHeight"))) self.fillLabels = [ "Solid", diff --git a/src/avp/components/image.py b/src/avp/components/image.py index 7e0f828..f2c28f3 100644 --- a/src/avp/components/image.py +++ b/src/avp/components/image.py @@ -4,6 +4,7 @@ from ..libcomponent import BaseComponent from ..libcomponent.actions import ComponentPreviewClick, ComponentSettingsUpdate +from ..toolkit import hasUndoStack from ..toolkit.frame import BlankFrame, addShadow from ..toolkit.visualizer import createSpectrumArray @@ -80,17 +81,21 @@ def update(self): self.page.spinBox_shadBlur.setHidden(True) def previewClickEvent(self, pos, size, button): - if self.imageSize == (0, 0) or button != QtCore.Qt.MouseButton.LeftButton: + if ( + not hasUndoStack(self.loader) + or self.imageSize == (0, 0) + or button != QtCore.Qt.MouseButton.LeftButton + ): return action = ClickPreviewAction(self, pos, size, button) - self.parent.undoStack.push(action) + self.loader.undoStack.push(action) def addCenterAction(self): """Triggered when user clicks "center image" button.""" - if self.imageSize == (0, 0): + if not hasUndoStack(self.loader) or self.imageSize == (0, 0): return action = CenterImageAction(self) - self.parent.undoStack.push(action) + self.loader.undoStack.push(action) def centerXY(self): self.setRelativeWidget( @@ -216,7 +221,7 @@ def postFrameRender(self): self.existingImage = None def pickImage(self): - imgDir = self.settings.value("componentDir", os.path.expanduser("~")) + imgDir = self.core.settings.value("componentDir", os.path.expanduser("~")) filename, _ = QtWidgets.QFileDialog.getOpenFileName( self.page, "Choose Image", @@ -224,7 +229,7 @@ def pickImage(self): "Image Files (%s)" % " ".join(self.core.imageFormats), ) if filename: - self.settings.setValue("componentDir", os.path.dirname(filename)) + self.core.settings.setValue("componentDir", os.path.dirname(filename)) self.mergeUndo = False self.page.lineEdit_image.setText(filename) self.mergeUndo = True diff --git a/src/avp/components/life.py b/src/avp/components/life.py index 931e352..73ebce8 100644 --- a/src/avp/components/life.py +++ b/src/avp/components/life.py @@ -8,6 +8,7 @@ from ..libcomponent import BaseComponent from ..libcomponent.actions import ComponentPreviewClick +from ..toolkit import hasUndoStack from ..toolkit.frame import BlankFrame, scale, addShadow from ..toolkit.visualizer import createSpectrumArray @@ -91,7 +92,7 @@ def shift(): self.page.spinBox_scale.valueChanged.connect(self.updateGridSize) def pickImage(self): - imgDir = self.settings.value("componentDir", os.path.expanduser("~")) + imgDir = self.core.settings.value("componentDir", os.path.expanduser("~")) filename, _ = QtWidgets.QFileDialog.getOpenFileName( self.page, "Choose Image", @@ -99,14 +100,14 @@ def pickImage(self): "Image Files (%s)" % " ".join(self.core.imageFormats), ) if filename: - self.settings.setValue("componentDir", os.path.dirname(filename)) + self.core.settings.setValue("componentDir", os.path.dirname(filename)) self.mergeUndo = False self.page.lineEdit_image.setText(filename) self.mergeUndo = True def shiftGrid(self, d): action = ShiftGrid(self, d) - self.parent.undoStack.push(action) + self.loader.undoStack.push(action) def updateResolution(self): super().updateResolution() @@ -150,12 +151,14 @@ def update(self): widget.setEnabled(enabled) def previewClickEvent(self, pos, size, button): + if not hasUndoStack(self.loader): + return pos = ( math.ceil((pos[0] / size[0]) * self.gridWidth) - 1, math.ceil((pos[1] / size[1]) * self.gridHeight) - 1, ) action = ClickGrid(self, pos, size, button) - self.parent.undoStack.push(action) + self.loader.undoStack.push(action) def updateGridSize(self): w, h = self.core.resolutions[-1].split("x") diff --git a/src/avp/components/sound.py b/src/avp/components/sound.py index c212870..6f8f72f 100644 --- a/src/avp/components/sound.py +++ b/src/avp/components/sound.py @@ -48,7 +48,7 @@ def audio(self): return (self.sound, params) def pickSound(self): - sndDir = self.settings.value("componentDir", os.path.expanduser("~")) + sndDir = self.core.settings.value("componentDir", os.path.expanduser("~")) filename, _ = QtWidgets.QFileDialog.getOpenFileName( self.page, "Choose Sound", @@ -56,7 +56,7 @@ def pickSound(self): "Audio Files (%s)" % " ".join(self.core.audioFormats), ) if filename: - self.settings.setValue("componentDir", os.path.dirname(filename)) + self.core.settings.setValue("componentDir", os.path.dirname(filename)) self.mergeUndo = False self.page.lineEdit_sound.setText(filename) self.mergeUndo = True diff --git a/src/avp/components/spectrum.py b/src/avp/components/spectrum.py index 0446865..aeaad2a 100644 --- a/src/avp/components/spectrum.py +++ b/src/avp/components/spectrum.py @@ -4,8 +4,8 @@ import logging from ..libcomponent import BaseComponent -from ..toolkit.frame import BlankFrame, scale from ..toolkit import connectWidget +from ..toolkit.frame import BlankFrame, scale from ..toolkit.ffmpeg import ( openPipe, closePipe, @@ -31,9 +31,9 @@ def widget(self, *args): self.previewSize = (214, 120) self.previewPipe = None - if hasattr(self.parent, "lineEdit_audioFile"): + if hasattr(self.loader, "lineEdit_audioFile"): # update preview when audio file changes (if genericPreview is off) - self.parent.lineEdit_audioFile.textChanged.connect(self.update) + self.loader.lineEdit_audioFile.textChanged.connect(self.update) self.trackWidgets( { @@ -111,8 +111,8 @@ def preFrameRender(self, **kwargs): width=w, height=h, chunkSize=self.chunkSize, - frameRate=int(self.settings.value("outputFrameRate")), - parent=self.parent, + frameRate=int(self.core.settings.value("outputFrameRate")), + parent=self.loader, component=self, ) @@ -125,10 +125,10 @@ def postFrameRender(self): closePipe(self.video.pipe) def getPreviewFrame(self): - genericPreview = self.settings.value("pref_genericPreview") + genericPreview = self.core.settings.value("pref_genericPreview") startPt = 0 if not genericPreview: - inputFile = self.parent.lineEdit_audioFile.text() + inputFile = self.loader.lineEdit_audioFile.text() if not inputFile or not os.path.exists(inputFile): return duration = getAudioDuration(inputFile) @@ -141,7 +141,7 @@ def getPreviewFrame(self): "-thread_queue_size", "512", "-r", - str(self.settings.value("outputFrameRate")), + str(self.core.settings.value("outputFrameRate")), "-ss", "{0:.3f}".format(startPt), "-i", @@ -200,7 +200,7 @@ def makeFfmpegFilter(self, preview=False, startPt=0): def getFilterComplexCommand(): """Inner function that creates the final, complex part of the filter command""" nonlocal self - genericPreview = self.settings.value("pref_genericPreview") + genericPreview = self.core.settings.value("pref_genericPreview") def getFilterComplexCommandForType(): """Determine portion of filter command that changes depending on selected type""" @@ -249,7 +249,7 @@ def getFilterComplexCommandForType(): elif self.display == 4: display = "rlog" filter_ = ( - f'ahistogram=r={str(self.settings.value("outputFrameRate"))}:' + f'ahistogram=r={str(self.core.settings.value("outputFrameRate"))}:' f"s={w}x{h}:" "dmode=separate:" f"ascale={amplitude}:" @@ -274,7 +274,7 @@ def getFilterComplexCommandForType(): ) elif self.filterType == 3: # Musical Scale filter_ = ( - f'showcqt=r={str(self.settings.value("outputFrameRate"))}:' + f'showcqt=r={str(self.core.settings.value("outputFrameRate"))}:' f"s={w}x{h}:" "count=30:" "text=0:" @@ -284,7 +284,7 @@ def getFilterComplexCommandForType(): ) elif self.filterType == 4: # Phase filter_ = ( - f'aphasemeter=r={str(self.settings.value("outputFrameRate"))}:' + f'aphasemeter=r={str(self.core.settings.value("outputFrameRate"))}:' f"s={w}x{h}:" "video=1 [atrash][vtmp1]; " "[atrash] anullsink; " diff --git a/src/avp/components/text.py b/src/avp/components/text.py index ff334aa..f393a65 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -4,6 +4,7 @@ from ..libcomponent import BaseComponent from ..libcomponent.actions import ComponentPreviewClick, ComponentSettingsUpdate +from ..toolkit import hasUndoStack from ..toolkit.frame import FramePainter, addShadow log = logging.getLogger("AVP.Components.Text") @@ -83,15 +84,19 @@ def update(self): self.page.spinBox_shadBlur.setHidden(True) def previewClickEvent(self, pos, size, button): + if not hasUndoStack(self.loader): + return if button != QtCore.Qt.MouseButton.LeftButton: return action = ClickPreviewAction(self, pos, size, button) - self.parent.undoStack.push(action) + self.loader.undoStack.push(action) def addCenterAction(self): """Triggered when user clicks "center text" button.""" + if not hasUndoStack(self.loader): + return action = CenterTextAction(self) - self.parent.undoStack.push(action) + self.loader.undoStack.push(action) def centerXY(self): self.setRelativeWidget("xPosition", 0.5) diff --git a/src/avp/components/video.py b/src/avp/components/video.py index 1e9b788..035ea0f 100644 --- a/src/avp/components/video.py +++ b/src/avp/components/video.py @@ -67,9 +67,9 @@ def previewRender(self): def properties(self): props = [] outputFile = None - if hasattr(self.parent, "lineEdit_outputFile"): + if hasattr(self.loader, "lineEdit_outputFile"): # check only happens in GUI mode - outputFile = self.parent.lineEdit_outputFile.text() + outputFile = self.loader.lineEdit_outputFile.text() if not self.videoPath: self.lockError("There is no video selected.") @@ -103,8 +103,8 @@ def preFrameRender(self, **kwargs): width=self.width, height=self.height, chunkSize=self.chunkSize, - frameRate=int(self.settings.value("outputFrameRate")), - parent=self.parent, + frameRate=int(self.core.settings.value("outputFrameRate")), + parent=self.loader, loopVideo=self.loopVideo, component=self, ) @@ -121,7 +121,7 @@ def postFrameRender(self): closePipe(self.video.pipe) def pickVideo(self): - imgDir = self.settings.value("componentDir", os.path.expanduser("~")) + imgDir = self.core.settings.value("componentDir", os.path.expanduser("~")) filename, _ = QtWidgets.QFileDialog.getOpenFileName( self.page, "Choose Video", @@ -129,7 +129,7 @@ def pickVideo(self): "Video Files (%s)" % " ".join(self.core.videoFormats), ) if filename: - self.settings.setValue("componentDir", os.path.dirname(filename)) + self.core.settings.setValue("componentDir", os.path.dirname(filename)) self.mergeUndo = False self.page.lineEdit_video.setText(filename) self.mergeUndo = True diff --git a/src/avp/components/waveform.py b/src/avp/components/waveform.py index bfebc30..ead3310 100644 --- a/src/avp/components/waveform.py +++ b/src/avp/components/waveform.py @@ -35,8 +35,8 @@ def widget(self, *args): super().widget(*args) self._image = BlankFrame(self.width, self.height) - if hasattr(self.parent, "lineEdit_audioFile"): - self.parent.lineEdit_audioFile.textChanged.connect(self.update) + if hasattr(self.loader, "lineEdit_audioFile"): + self.loader.lineEdit_audioFile.textChanged.connect(self.update) self.trackWidgets( { @@ -83,8 +83,8 @@ def preFrameRender(self, **kwargs): width=w, height=h, chunkSize=self.chunkSize, - frameRate=int(self.settings.value("outputFrameRate")), - parent=self.parent, + frameRate=int(self.core.settings.value("outputFrameRate")), + parent=self.loader, component=self, debug=True, ) @@ -151,10 +151,10 @@ def postFrameRender(self): closePipe(self.video.pipe) def getPreviewFrame(self, width, height): - genericPreview = self.settings.value("pref_genericPreview") + genericPreview = self.core.settings.value("pref_genericPreview") startPt = 0 if not genericPreview: - inputFile = self.parent.lineEdit_audioFile.text() + inputFile = self.loader.lineEdit_audioFile.text() if not inputFile or not os.path.exists(inputFile): return duration = getAudioDuration(inputFile) @@ -169,7 +169,7 @@ def getPreviewFrame(self, width, height): "-thread_queue_size", "512", "-r", - str(self.settings.value("outputFrameRate")), + str(self.core.settings.value("outputFrameRate")), "-ss", "{0:.3f}".format(startPt), "-i", @@ -233,18 +233,18 @@ def makeFfmpegFilter(self, preview=False, startPt=0): amplitude = "lin" hexcolor = QColor(*self.color).name() opacity = "{0:.1f}".format(self.opacity / 100) - genericPreview = self.settings.value("pref_genericPreview") + genericPreview = self.core.settings.value("pref_genericPreview") if self.mode > 1: filter_ = ( "showwaves=" - f'r={str(self.settings.value("outputFrameRate"))}:' - f's={self.settings.value("outputWidth")}x{self.settings.value("outputHeight")}:' + f'r={str(self.core.settings.value("outputFrameRate"))}:' + f"s={self.width}x{self.height}:" f'mode={self.page.comboBox_mode.currentText().lower() if self.mode != 3 else "p2p"}:' f"colors={hexcolor}@{opacity}:scale={amplitude}" ) elif self.mode < 2: filter_ = ( - f'showfreqs=s={str(self.settings.value("outputWidth"))}x{str(self.settings.value("outputHeight"))}:' + f"showfreqs=s={str(self.width)}x{str(self.height)}:" f'mode={"line" if self.mode == 0 else "bar"}:' f"colors={hexcolor}@{opacity}" f":ascale={amplitude}:fscale={'log' if self.mono else 'lin'}" diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index 5e8220b..4ec7c1b 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -163,16 +163,15 @@ def audio(self): # Idle Methods # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ - def widget(self, parent): + def widget(self, loader): """ Call super().widget(*args) to create the component widget which also auto-connects any common widgets (e.g., checkBoxes) to self.update(). Then in a subclass connect special actions (e.g., pushButtons to select a file) and initialize """ - self.parent = parent - self.settings = parent.settings - log.verbose( + self.loader = loader + log.debug( "Creating UI for %s #%s's widget", self.__class__.name, self.compPos, @@ -308,7 +307,7 @@ def _userUpdate(self): } if modifiedWidgets: action = ComponentTrackedWidgetUpdate(self, oldWidgetVals, modifiedWidgets) - self.parent.undoStack.push(action) + self.loader.undoStack.push(action) def _autoUpdate(self): """Happens after subclass update() for an internal component update.""" @@ -320,11 +319,16 @@ def _autoUpdate(self): self._sendUpdateSignal() def updateResolution(self): - newWidth = int(self.parent.settings.value("outputWidth")) - newHeight = int(self.parent.settings.value("outputHeight")) + newWidth = int(self.core.settings.value("outputWidth")) + newHeight = int(self.core.settings.value("outputHeight")) log.info( - "Updating relative widget values for %s from %sx%s to %sx%s." - % (self.name, self.width, self.height, newWidth, newHeight) + "Updating relative widget values for %s #%s from %sx%s to %sx%s.", + self.name, + str(self.compPos), + self.width, + self.height, + newWidth, + newHeight, ) for attr in self._relativeWidgets: self.updateRelativeWidgetResolution( @@ -373,12 +377,13 @@ def setWidgetValues(self, attrDict): setWidgetValue(widget, val) def _sendUpdateSignal(self): - if not self.core.openingProject: - self.parent.drawPreview() - saveValueStore = self.savePreset() - saveValueStore["preset"] = self.currentPreset - saveValueStore["resolution"] = (self.width, self.height) - self.modified.emit(self.compPos, saveValueStore) + if self.core.openingProject: + # TODO use `disableWhenOpeningProject` decorator + return + saveValueStore = self.savePreset() + saveValueStore["preset"] = self.currentPreset + saveValueStore["resolution"] = (self.width, self.height) + self.modified.emit(self.compPos, saveValueStore) def trackWidgets(self, trackDict, **kwargs): """ @@ -517,6 +522,7 @@ def relativeWidgetAxis(self, attr, *args, **kwargs): lambda attr: "height" in attr.lower() or "ypos" in attr.lower() or attr == "y" + or attr.endswith("Y") ) if "axis" not in kwargs: axis = self.width diff --git a/src/avp/libcomponent/metaclass.py b/src/avp/libcomponent/metaclass.py index e8ad949..9591035 100644 --- a/src/avp/libcomponent/metaclass.py +++ b/src/avp/libcomponent/metaclass.py @@ -3,7 +3,7 @@ from PyQt6 import QtCore from .exceptions import ComponentError -from ..toolkit import connectWidget +from ..toolkit import connectWidget, hasUndoStack from ..toolkit.frame import BlankFrame log = logging.getLogger("AVP.ComponentHandler") @@ -139,7 +139,7 @@ def __exit__(self, *args): if ( self.auto or self.comp.openingPreset - or not hasattr(self.comp.parent, "undoStack") + or not hasUndoStack(self.comp.loader) ): log.verbose("Automatic update") self.comp._autoUpdate() diff --git a/src/avp/toolkit/common.py b/src/avp/toolkit/common.py index d1cd242..da7fec4 100644 --- a/src/avp/toolkit/common.py +++ b/src/avp/toolkit/common.py @@ -208,3 +208,8 @@ def getWidgetValue(widget): def randomColor(): return (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) + + +def hasUndoStack(loader): + """Receives a Command or MainWindow object""" + return hasattr(loader, "undoStack") diff --git a/tests/test_comp_image.py b/tests/test_comp_image.py index 209057b..db5ee83 100644 --- a/tests/test_comp_image.py +++ b/tests/test_comp_image.py @@ -43,8 +43,8 @@ def test_comp_image_scale_50_720p(coreWithImageComp): comp.page.spinBox_scale.setValue(50) image = comp.previewRender() sum = imageDataSum(image) - comp.parent.settings.setValue("outputHeight", 720) - comp.parent.settings.setValue("outputWidth", 1280) + coreWithImageComp.settings.setValue("outputHeight", 720) + coreWithImageComp.settings.setValue("outputWidth", 1280) comp.updateResolution() newImage = comp.previewRender() assert image.width == 1920 diff --git a/tests/test_comp_text.py b/tests/test_comp_text.py index d774828..2d83388 100644 --- a/tests/test_comp_text.py +++ b/tests/test_comp_text.py @@ -36,8 +36,8 @@ def setTextSettings(comp): def test_comp_text_renderFrame(coreWithTextComp, width, height): """Call renderFrame of Title Text component added to Command object.""" comp = coreWithTextComp.selectedComponents[0] - comp.parent.settings.setValue("outputWidth", width) - comp.parent.settings.setValue("outputHeight", height) + coreWithTextComp.settings.setValue("outputWidth", width) + coreWithTextComp.settings.setValue("outputHeight", height) comp.updateResolution() setTextSettings(comp) comp.centerXY() From 3b7979f2854a409813c57cdac42a3c32a32006f7 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 11 Jun 2026 22:00:22 -0400 Subject: [PATCH 29/67] reduce log spam --- src/avp/gui/actions.py | 3 ++- src/avp/gui/mainwindow.py | 4 +-- src/avp/gui/preview_thread.py | 43 +++++++++++++++++++++---------- src/avp/gui/undostack.py | 2 +- src/avp/libcomponent/actions.py | 4 +-- src/avp/libcomponent/component.py | 25 +++++++++++++----- src/avp/toolkit/common.py | 12 ++++++++- 7 files changed, 65 insertions(+), 28 deletions(-) diff --git a/src/avp/gui/actions.py b/src/avp/gui/actions.py index 44573ea..3c171e8 100644 --- a/src/avp/gui/actions.py +++ b/src/avp/gui/actions.py @@ -8,7 +8,7 @@ from copy import copy from ..core import Core -from ..toolkit.common import blockSignals +from ..toolkit import blockSignals log = logging.getLogger("AVP.Gui.Actions") @@ -45,6 +45,7 @@ def updateResolution(self, resolution, index): self.window.comboBox_resolution.setCurrentIndex(index) for i in range(len(self.window.core.selectedComponents)): self.window.core.selectedComponents[i].updateResolution() + self.window.previewWorker.newBackground() self.window.drawPreview() def redo(self): diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index 751110e..7a99779 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -53,7 +53,7 @@ class MainWindow(QtWidgets.QMainWindow): def __init__(self, project, dpi): super().__init__() - log.debug("Main thread id: {}".format(int(QtCore.QThread.currentThreadId()))) + # log.debug("Main thread id: {}".format(int(QtCore.QThread.currentThreadId()))) uic.loadUi(os.path.join(Core.wd, "gui", "mainwindow.ui"), self) log.info("Pillow version %s", Image.__version__) log.info( @@ -852,8 +852,8 @@ def insertComponent(self, index): componentList.insertItem(index, self.core.selectedComponents[index].name) componentList.setCurrentRow(index) - # connect to signal that adds an asterisk when modified self.core.selectedComponents[index].modified.connect(self.updateComponentTitle) + self.core.selectedComponents[index].modified.connect(self.drawPreview) self.pages.insert(index, self.core.selectedComponents[index].page) stackedWidget.insertWidget(index, self.pages[index]) diff --git a/src/avp/gui/preview_thread.py b/src/avp/gui/preview_thread.py index d89d98e..fc44ebe 100644 --- a/src/avp/gui/preview_thread.py +++ b/src/avp/gui/preview_thread.py @@ -3,12 +3,12 @@ Processes a queue of component lists. """ -from PyQt6 import QtCore, QtGui, uic +from PyQt6 import QtCore, QtGui from PyQt6.QtCore import pyqtSignal, pyqtSlot from PIL import Image from PIL.ImageQt import ImageQt -from queue import Queue, Empty -import os +from queue import Empty +import time import logging from ..toolkit.frame import Checkerboard @@ -27,9 +27,12 @@ def __init__(self, core, settings, queue): super().__init__() self.core = core self.settings = settings + self.queue = queue + self.newBackground() + + def newBackground(self): width = int(self.settings.value("outputWidth")) height = int(self.settings.value("outputHeight")) - self.queue = queue self.background = Checkerboard(width, height) @disableWhenOpeningProject @@ -38,8 +41,10 @@ def createPreviewImage(self, components): dic = { "components": components, } + for component in reversed(components): + if "composite" not in component.properties(): + dic[component.compPos] = component.previewRender() self.queue.put(dic) - log.debug("Preview thread id: {}".format(int(QtCore.QThread.currentThreadId()))) @pyqtSlot() def process(self): @@ -50,23 +55,26 @@ def process(self): self.queue.get(block=False) except Empty: continue - width = int(self.settings.value("outputWidth")) - height = int(self.settings.value("outputHeight")) - if self.background.width != width or self.background.height != height: - self.background = Checkerboard(width, height) - + timeElapsed = time.time() frame = self.background.copy() - log.info("Creating new preview frame") components = nextPreviewInformation["components"] for component in reversed(components): + if component.width != frame.width or component.height != frame.height: + self.newBackground() + break + try: isCompositeComponent = "composite" in component.properties() - component.lockSize(width, height) if isCompositeComponent: newFrame = component.previewRender(frame) + elif ( + component.compPos in nextPreviewInformation + and nextPreviewInformation[component.compPos].width + == frame.width + ): + newFrame = nextPreviewInformation[component.compPos] else: newFrame = component.previewRender() - component.unlockSize() if isCompositeComponent: frame = newFrame else: @@ -83,7 +91,12 @@ def process(self): "is None" if newFrame is None else "size was %s*%s; should be %s*%s" - % (newFrame.width, newFrame.height, width, height) + % ( + newFrame.width, + newFrame.height, + frame.width, + frame.height, + ) ), ) ) @@ -96,6 +109,8 @@ def process(self): # We must store a reference to this QImage # or else Qt will garbage-collect it on the C++ side self.frame = ImageQt(frame) + timeElapsed = time.time() - timeElapsed + log.info("Generated preview frame in {0:.3f}s".format(timeElapsed)) self.imageCreated.emit(QtGui.QImage(self.frame)) except Empty: diff --git a/src/avp/gui/undostack.py b/src/avp/gui/undostack.py index fd1a3e9..394dc0d 100644 --- a/src/avp/gui/undostack.py +++ b/src/avp/gui/undostack.py @@ -1,5 +1,5 @@ from PyQt6.QtGui import QUndoStack -from ..toolkit.common import disableWhenEncoding +from ..toolkit import disableWhenEncoding class UndoStack(QUndoStack): diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index d8bf3c3..b6bbcad 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -1,7 +1,5 @@ """ -QUndoCommand class for generic undoable user actions performed to a BaseComponent - -See `../life.py` for an example of a component that uses a custom QUndoCommand +QUndoCommand classes for undoable user actions performed to a component """ from PyQt6 import QtCore diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index 4ec7c1b..31f9079 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -10,9 +10,11 @@ import logging from copy import copy + from .metaclass import ComponentMetaclass from .actions import ComponentTrackedWidgetUpdate from .exceptions import ComponentError +from ..toolkit import logWidgetValues from ..toolkit.frame import BlankFrame from ..toolkit import ( @@ -215,12 +217,15 @@ def loadPreset(self, presetDict, presetName=None): # This happens if loading a file from before v2.3.0 if "resolution" not in presetDict: log.warning( - "Resolution not saved%s. Using project resolution." % "" - if self.currentPreset is None - else " for %s" % self.currentPreset + "%s #%s's%s resolution was not saved. Using project resolution instead.", + self.name, + str(self.compPos), + "" if self.currentPreset is None else " %s" % self.currentPreset, ) presetDict["resolution"] = currentResolution for attr in self._relativeWidgets: + if getPresetAttrName(attr) not in presetDict: + continue if type(presetDict[getPresetAttrName(attr)]) == float: presetDict[getPresetAttrName(attr)] = self.pixelValForAttr( attr, presetDict[getPresetAttrName(attr)] @@ -233,8 +238,14 @@ def loadPreset(self, presetDict, presetName=None): val = presetDict[key] except KeyError as e: log.warning( - "%s missing value %s. Outdated preset?", - self.currentPreset, + "%s #%s%s is missing value %s. Outdated preset?", + self.name, + self.compPos, + ( + "'s %s" % self.currentPreset + if self.currentPreset is not None + else "" + ), str(e), ) val = getattr(self, key) @@ -249,6 +260,7 @@ def loadPreset(self, presetDict, presetName=None): else: setWidgetValue(widget, val) + logWidgetValues(self, self._trackedWidgets) if presetDict["resolution"] != currentResolution: self.updateResolution() @@ -361,7 +373,7 @@ def setAttrs(self, attrDict): else: # Normal tracked widget setattr(self, attr, val) - log.debug("Setting %s self.%s to %s" % (self.__class__.name, attr, val)) + logWidgetValues(self, attrDict) def setWidgetValues(self, attrDict): """ @@ -375,6 +387,7 @@ def setWidgetValues(self, attrDict): if attr in self._colorWidgets: val = "%s,%s,%s" % val setWidgetValue(widget, val) + logWidgetValues(self, attrDict) def _sendUpdateSignal(self): if self.core.openingProject: diff --git a/src/avp/toolkit/common.py b/src/avp/toolkit/common.py index da7fec4..9c5d088 100644 --- a/src/avp/toolkit/common.py +++ b/src/avp/toolkit/common.py @@ -180,7 +180,6 @@ def connectWidget(widget, func, unsupportedWidgets=None): def setWidgetValue(widget, val): """Generic setValue method for use with any typical QtWidget""" - log.verbose("Setting %s to %s" % (str(widget.__class__.__name__), val)) if type(widget) == QtWidgets.QLineEdit: widget.setText(val) elif type(widget) == QtWidgets.QSpinBox or type(widget) == QtWidgets.QDoubleSpinBox: @@ -206,6 +205,17 @@ def getWidgetValue(widget): return widget.currentIndex() +def logWidgetValues(component, attrDict): + log.debug( + "Set %s #%s's settings to %s", + component.name, + str(component.compPos), + ", ".join( + ["'%s: %s'" % (key, str(getattr(component, key))) for key in attrDict] + ), + ) + + def randomColor(): return (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) From eaa18ca1f1cd077ab2cd7761fb383ba8e6968280 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Fri, 12 Jun 2026 20:27:44 -0400 Subject: [PATCH 30/67] update GitHub Actions from v3 to v6 --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index fefb727..49b85b4 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -24,9 +24,9 @@ jobs: env: DISPLAY: ':99.0' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Set up Python 3.12 - uses: actions/setup-python@v3 + uses: actions/setup-python@v6 with: python-version: "3.12" - name: Install system dependencies From e04a6b60880051fdacf275804b5fc8cc4e9cefe6 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Tue, 16 Jun 2026 21:23:30 -0400 Subject: [PATCH 31/67] better error when inserting invalid components --- src/avp/core.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/avp/core.py b/src/avp/core.py index c8e070b..0243a92 100644 --- a/src/avp/core.py +++ b/src/avp/core.py @@ -120,13 +120,18 @@ def updateComponent(self, i): self.selectedComponents[i].update(auto=True) def moduleIndexFor(self, compName): - try: + index = None + if compName in self.compNames: index = self.compNames.index(compName) - return self.moduleIndexes[index] - except ValueError: + else: for altName, modI in self.altCompNames: if altName == compName: - return self.moduleIndexes[modI] + index = modI + try: + return self.moduleIndexes[index] + except TypeError: + log.error("Module index not found.") + return def clearPreset(self, compIndex): self.selectedComponents[compIndex].currentPreset = None @@ -166,8 +171,8 @@ def openProject(self, loader, filepath): errcode, data = self.parseAvFile(filepath) if errcode == 0: - self.openingProject = True try: + self.openingProject = True if hasattr(loader, "window"): for widget, value in data["WindowFields"]: widget = eval("loader.%s" % widget) @@ -201,8 +206,10 @@ def openProject(self, loader, filepath): ) continue if i == -1: - loader.showMessage(msg="Invalid components!") - break + loader.showMessage( + msg=f"Invalid component '{name}' was removed." + ) + continue try: if "preset" in preset and preset["preset"] is not None: @@ -220,11 +227,12 @@ def openProject(self, loader, filepath): self.clearPreset(i) if hasattr(loader, "updateComponentTitle"): loader.updateComponentTitle(i, modified) - self.openingProject = False return True except Exception: errcode = 1 data = sys.exc_info() + finally: + self.openingProject = False if errcode == 1: typ, value, tb = data @@ -462,6 +470,7 @@ def storeSettings(cls, dataDir=None): "logDir": os.path.join(dataDir, "log"), "logEnabled": False, "previewEnabled": True, + "maxResolution": (1920, 1080), } settings["videoFormats"] = toolkit.appendUppercase( From 61363f69db0f681acbcbe8ac6576d655e68cd29c Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Tue, 16 Jun 2026 21:27:34 -0400 Subject: [PATCH 32/67] change debug hotkeys to F2 and F5 remove unneeded import of Queue improve __repr__ --- src/avp/gui/mainwindow.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index 7a99779..3369de0 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -116,9 +116,9 @@ def setupHotkeys(): QShortcut("Ctrl+Shift+F", self, self.showFfmpegCommand) QShortcut("Ctrl+Shift+U", self, self.showUndoStack) - if log.isEnabledFor(logging.DEBUG): - QShortcut("Ctrl+Alt+Shift+R", self, self.drawPreview) - QShortcut("Ctrl+Alt+Shift+A", self, lambda: log.debug(repr(self))) + if log.isEnabledFor(logging.INFO): + QShortcut("F2", self, lambda: log.info(repr(self))) + QShortcut("F5", self, self.drawPreview) def setupMainWindowWidgets(): def setupUndoDialog(): @@ -140,11 +140,8 @@ def setupPreviewWindow(): self.verticalLayout_previewWrapper.addWidget(self.previewWindow) log.debug("Starting preview thread") - self.previewQueue = Queue() self.previewThread = QtCore.QThread(self) - self.previewWorker = preview_thread.Worker( - self.core, self.settings, self.previewQueue - ) + self.previewWorker = preview_thread.Worker(self.core, self.settings) self.previewWorker.moveToThread(self.previewThread) self.newTask.connect(self.previewWorker.createPreviewImage) self.processTask.connect(self.previewWorker.process) @@ -463,15 +460,15 @@ def setupProjectsMenu(): def __repr__(self): return ( "%s\n" - "\n%s\n" "#####\n" "Preview thread is %s\n" % ( - super().__repr__(), ( "core not initialized" if not hasattr(self, "core") - else repr(self.core) + else "#####\n".join( + [repr(comp) for comp in self.core.selectedComponents] + ) ), ( "live" From 082e8722c33ed9da4b5d3e52adea939e581d997c Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Tue, 16 Jun 2026 21:29:55 -0400 Subject: [PATCH 33/67] update resolution periodically instead of instantly this helps prevent visual glitches caused by spamming changes to resolution --- src/avp/gui/actions.py | 12 ++++-------- src/avp/gui/mainwindow.py | 19 ++++++++++++------- src/avp/gui/preview_thread.py | 26 ++++++++++---------------- 3 files changed, 26 insertions(+), 31 deletions(-) diff --git a/src/avp/gui/actions.py b/src/avp/gui/actions.py index 3c171e8..b1c1343 100644 --- a/src/avp/gui/actions.py +++ b/src/avp/gui/actions.py @@ -20,20 +20,16 @@ class ChangeResolution(QUndoCommand): - def __init__(self, window, newResolutionIndex): + def __init__(self, window, oldResolutionIndex, newResolutionIndex): super().__init__( "change resolution to %s" % window.comboBox_resolution.itemText(newResolutionIndex) ) self.window = window - self.newResolution = tuple(Core.resolutions[newResolutionIndex].split("x")) self.newResolutionIndex = newResolutionIndex - - # store old resolution - w = window.settings.value("outputWidth") - h = window.settings.value("outputHeight") - self.oldResolution = (w, h) - self.oldResolutionIndex = Core.resolutions.index("%sx%s" % self.oldResolution) + self.newResolution = tuple(Core.resolutions[newResolutionIndex].split("x")) + self.oldResolutionIndex = oldResolutionIndex + self.oldResolution = tuple(Core.resolutions[oldResolutionIndex].split("x")) def updateResolution(self, resolution, index): log.debug("Updating resolution to %sx%s" % resolution) diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index 3369de0..d14054a 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -9,7 +9,6 @@ import PyQt6.QtWidgets as QtWidgets from PyQt6.QtGui import QShortcut from PIL import Image -from queue import Queue import sys import os import signal @@ -147,6 +146,7 @@ def setupPreviewWindow(): self.processTask.connect(self.previewWorker.process) self.previewWorker.error.connect(self.previewWindow.threadError) self.previewWorker.imageCreated.connect(self.showPreviewImage) + self.previewWorker.imageCreated.connect(lambda: self.updateResolution()) self.previewThread.start() self.previewThread.finished.connect( lambda: log.info("Preview thread finished.") @@ -272,7 +272,7 @@ def setupEncoderSettingsTab(): currentRes = i self.comboBox_resolution.setCurrentIndex(currentRes) self.comboBox_resolution.currentIndexChanged.connect( - self.updateResolution + self.drawPreview ) def setupComponentListWidgets(): @@ -793,12 +793,17 @@ def progressBarSetText(self, value): print(f"\r{value}", end="") def updateResolution(self, resIndex=None): - if resIndex == -1: - log.error("Resolution combobox is broken.") - return - elif resIndex is None: + if resIndex is None: resIndex = int(self.comboBox_resolution.currentIndex()) - action = ChangeResolution(self, resIndex) + elif resIndex not in tuple(range(len(self.core.resolutions))): + log.error(f"Resolution {resIndex} unknown") + return + w = self.settings.value("outputWidth") + h = self.settings.value("outputHeight") + oldResIndex = Core.resolutions.index("%sx%s" % (w, h)) + if oldResIndex == resIndex: + return + action = ChangeResolution(self, oldResIndex, resIndex) self.undoStack.push(action) def drawPreview(self, force=False, **kwargs): diff --git a/src/avp/gui/preview_thread.py b/src/avp/gui/preview_thread.py index fc44ebe..ce9ce3b 100644 --- a/src/avp/gui/preview_thread.py +++ b/src/avp/gui/preview_thread.py @@ -7,7 +7,7 @@ from PyQt6.QtCore import pyqtSignal, pyqtSlot from PIL import Image from PIL.ImageQt import ImageQt -from queue import Empty +from queue import Queue, Empty import time import logging @@ -23,12 +23,13 @@ class Worker(QtCore.QObject): imageCreated = pyqtSignal(QtGui.QImage) error = pyqtSignal(str) - def __init__(self, core, settings, queue): + def __init__(self, core, settings): super().__init__() self.core = core self.settings = settings - self.queue = queue + self.queue = Queue() self.newBackground() + self.canceled = False def newBackground(self): width = int(self.settings.value("outputWidth")) @@ -41,13 +42,11 @@ def createPreviewImage(self, components): dic = { "components": components, } - for component in reversed(components): - if "composite" not in component.properties(): - dic[component.compPos] = component.previewRender() self.queue.put(dic) @pyqtSlot() def process(self): + """Process one preview image from the queue""" try: nextPreviewInformation = self.queue.get(block=False) while self.queue.qsize() >= 2: @@ -59,20 +58,13 @@ def process(self): frame = self.background.copy() components = nextPreviewInformation["components"] for component in reversed(components): - if component.width != frame.width or component.height != frame.height: - self.newBackground() - break - try: + lockAcquired = component.lockSize(frame.width, frame.height) + if not lockAcquired: + break isCompositeComponent = "composite" in component.properties() if isCompositeComponent: newFrame = component.previewRender(frame) - elif ( - component.compPos in nextPreviewInformation - and nextPreviewInformation[component.compPos].width - == frame.width - ): - newFrame = nextPreviewInformation[component.compPos] else: newFrame = component.previewRender() if isCompositeComponent: @@ -105,6 +97,8 @@ def process(self): break except RuntimeError as e: log.error(str(e)) + finally: + component.unlockSize() else: # We must store a reference to this QImage # or else Qt will garbage-collect it on the C++ side From 989eba1642d46cd444f612d9032265e4f998712c Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Tue, 16 Jun 2026 21:30:28 -0400 Subject: [PATCH 34/67] improve log messages --- src/avp/libcomponent/metaclass.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/avp/libcomponent/metaclass.py b/src/avp/libcomponent/metaclass.py index 9591035..5019c50 100644 --- a/src/avp/libcomponent/metaclass.py +++ b/src/avp/libcomponent/metaclass.py @@ -30,11 +30,6 @@ def initializationWrapper(self, *args, **kwargs): def renderWrapper(func): def renderWrapper(self, *args, **kwargs): try: - log.verbose( - "### %s #%s renders a preview frame ###", - self.__class__.name, - str(self.compPos), - ) return func(self, *args, **kwargs) except Exception as e: try: @@ -141,14 +136,12 @@ def __exit__(self, *args): or self.comp.openingPreset or not hasUndoStack(self.comp.loader) ): - log.verbose("Automatic update") self.comp._autoUpdate() else: - log.verbose("User update") self.comp._userUpdate() def updateWrapper(self, **kwargs): - auto = kwargs["auto"] if "auto" in kwargs else False + auto = kwargs.get("auto", False) with wrap(self, auto): try: return func(self) @@ -171,13 +164,19 @@ def __enter__(self): pass def __exit__(self, *args): + connectedWidgets = 0 for widgetList in self.comp._allWidgets.values(): for widget in widgetList: - log.verbose("Connecting %s", str(widget.__class__.__name__)) + connectedWidgets += 1 connectWidget(widget, self.comp.update) + log.debug( + "Connected %s widgets from %s #%s", + str(connectedWidgets), + self.comp.name, + str(self.comp.compPos), + ) def widgetWrapper(self, *args, **kwargs): - auto = kwargs["auto"] if "auto" in kwargs else False with wrap(self): try: return func(self, *args, **kwargs) From 21f9290e2244a9c554ccb16c0a6c4c04b42f6632 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Tue, 16 Jun 2026 21:34:30 -0400 Subject: [PATCH 35/67] improve relativeWidgets to prevent drift caused by rounding errors by saving the float values in memory, we prevent rounding errors from accumulating and causing the pixel value to drift --- src/avp/components/image.py | 10 +- src/avp/libcomponent/component.py | 147 +++++++++++++++++++++--------- src/avp/toolkit/common.py | 6 ++ tests/test_comp_text.py | 4 +- 4 files changed, 120 insertions(+), 47 deletions(-) diff --git a/src/avp/components/image.py b/src/avp/components/image.py index f2c28f3..a6471f6 100644 --- a/src/avp/components/image.py +++ b/src/avp/components/image.py @@ -100,11 +100,17 @@ def addCenterAction(self): def centerXY(self): self.setRelativeWidget( "xPosition", - 0.5 - (self.floatValForAttr("xPosition", self.imageSize[0]) / 2), + 0.5 + - self.floatValForAttr( + "xPosition", self.imageSize[0] / 2, (self.width, self.height) + ), ) self.setRelativeWidget( "yPosition", - 0.5 - (self.floatValForAttr("yPosition", self.imageSize[1] / 2)), + 0.5 + - self.floatValForAttr( + "yPosition", self.imageSize[1] / 2, (self.width, self.height) + ), ) def previewRender(self): diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index 31f9079..bd8b792 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -23,6 +23,7 @@ rgbFromString, randomColor, blockSignals, + isVerticalWord, ) log = logging.getLogger("AVP.BaseComponent") @@ -61,7 +62,8 @@ def __init__(self, moduleIndex, compPos, core): self._colorFuncs = {} self._relativeWidgets = {} # Maximum values of relativeWidget spinBoxes at 1080p (Core.resolutions[0]) - self._relativeMaximums = {} + self._relativeWidgetMaximums = {} + self._relativeWidgetFloats = {} # LOCKING VARIABLES self.openingPreset = False @@ -258,6 +260,8 @@ def loadPreset(self, presetDict, presetName=None): ) self._colorWidgets[attr].setStyleSheet(btnStyle) else: + if attr in self._relativeWidgets: + self.updateRelativeWidgetFloat(attr, val) setWidgetValue(widget, val) logWidgetValues(self, self._trackedWidgets) @@ -317,6 +321,11 @@ def _userUpdate(self): for attr, val in newWidgetVals.items() if val != oldWidgetVals[attr] } + for attr in copy(modifiedWidgets): + if attr in self._relativeWidgets: + changed = self.updateRelativeWidgetFloat(attr, modifiedWidgets[attr]) + if not changed: + del modifiedWidgets[attr] if modifiedWidgets: action = ComponentTrackedWidgetUpdate(self, oldWidgetVals, modifiedWidgets) self.loader.undoStack.push(action) @@ -343,9 +352,7 @@ def updateResolution(self): newHeight, ) for attr in self._relativeWidgets: - self.updateRelativeWidgetResolution( - attr, (self.width, self.height), (newWidth, newHeight) - ) + self.updateRelativeWidgetResolution(attr, (newWidth, newHeight)) self._width = newWidth self._height = newHeight self._preUpdate() @@ -386,6 +393,8 @@ def setWidgetValues(self, attrDict): widget = self._trackedWidgets[attr] if attr in self._colorWidgets: val = "%s,%s,%s" % val + if attr in self._relativeWidgets: + self.updateRelativeWidgetFloat(attr, val) setWidgetValue(widget, val) logWidgetValues(self, attrDict) @@ -457,9 +466,21 @@ def pickColor_(): elif kwarg == "relativeWidgets": # store maximum values of spinBoxes to be scaled appropriately for attr in kwargs[kwarg]: - self._relativeMaximums[attr] = self._trackedWidgets[attr].maximum() + self._relativeWidgetMaximums[attr] = self._trackedWidgets[ + attr + ].maximum() self.updateRelativeWidgetMaximum(attr, (self.width, self.height)) - setattr(self, attr, self._trackedWidgets[attr].value()) + self._relativeWidgetFloats[attr] = self.floatValForAttr( + attr, + self._trackedWidgets[attr].value(), + (self.width, self.height), + ) + if log.isEnabledFor(logging.INFO): + self._trackedWidgets[attr].setToolTip( + "relative value: {0:.3f}".format( + self._relativeWidgetFloats[attr] + ) + ) self._preUpdate() self._autoUpdate() @@ -491,7 +512,11 @@ def lockError(self, msg): self._lockedError = msg def lockSize(self, w, h): + if self._lockedSize is not None: + log.warning("%s #%s is already locked.", self.name, str(self.compPos)) + return False self._lockedSize = (w, h) + return True def unlockProperties(self): self._lockedProperties = None @@ -500,7 +525,11 @@ def unlockError(self): self._lockedError = None def unlockSize(self): + if self._lockedSize is None: + log.warning("%s #%s is already unlocked.", self.name, str(self.compPos)) + return False self._lockedSize = None + return True def loadUi(self, filename): """Load a Qt Designer ui file to use for this component's widget""" @@ -529,56 +558,74 @@ def reset(self): self.unlockProperties() self.unlockError() - def relativeWidgetAxis(func): - def relativeWidgetAxis(self, attr, *args, **kwargs): - hasVerticalWords = ( - lambda attr: "height" in attr.lower() - or "ypos" in attr.lower() - or attr == "y" - or attr.endswith("Y") - ) - if "axis" not in kwargs: - axis = self.width - if hasVerticalWords(attr): - axis = self.height - kwargs["axis"] = axis - if "axis" in kwargs and type(kwargs["axis"]) is tuple: - axis = kwargs["axis"][0] - if hasVerticalWords(attr): - axis = kwargs["axis"][1] - kwargs["axis"] = axis - return func(self, attr, *args, **kwargs) - - return relativeWidgetAxis - - @relativeWidgetAxis - def pixelValForAttr(self, attr, val=None, **kwargs): + def pixelValForAttr(self, attr, val=None, axis=None): + """ + Get pixel value from a relativeWidget float. + `attr`: string name of relativeWidget + `val`: optional float; uses _relativeWidgets[attr] if None + `axis`: optional tuple of (width, height); height used if attr "seems vertical" + """ + if axis is None: + axis = self.core.maxResolution + if isVerticalWord(attr): + try: + axis = axis[1] + except IndexError: + if type(axis) != int: + raise + else: + axis = axis[0] if val is None: - val = self.floatValForAttr( - attr, self._trackedWidgets[attr].value(), axis=kwargs["axis"] - ) - result = math.ceil(kwargs["axis"] * val) + val = self._relativeWidgetFloats[attr] + result = math.floor(float(axis) * val) return result - @relativeWidgetAxis - def floatValForAttr(self, attr, val=None, **kwargs): + def floatValForAttr(self, attr, val=None, axis=None): + """If axis != core.maxResolution, mutates `val`""" + if axis is None: + axis = self.core.maxResolution if val is None: val = self._trackedWidgets[attr].value() - return val / kwargs["axis"] + # Convert pixel value to 1080 if needed + convert = False + if axis != self.core.maxResolution: + convert = True + if isVerticalWord(attr): + try: + axis = axis[1] + except IndexError: + if type(axis) != int: + raise + else: + axis = axis[0] + if convert: + val = self.pixelValForAttr(attr, val / axis) + return ( + val / self.core.maxResolution[1] + if isVerticalWord(attr) + else val / self.core.maxResolution[0] + ) - def setRelativeWidget(self, attr, floatVal): + def setRelativeWidget(self, attr, floatVal, axis=None): """Set a relative widget using a float""" - pixelVal = self.pixelValForAttr(attr, floatVal) + if axis is None: + axis = (self.width, self.height) + self._relativeWidgetFloats[attr] = floatVal + pixelVal = self.pixelValForAttr(attr, floatVal, axis) with blockSignals(self._trackedWidgets[attr]): self._trackedWidgets[attr].setValue(pixelVal) + if log.isEnabledFor(logging.INFO): + self._trackedWidgets[attr].setToolTip( + "relative value: {0:.3f}".format(self._relativeWidgetFloats[attr]) + ) self.update(auto=True) - def updateRelativeWidgetResolution(self, attr, oldResolution, newResolution): + def updateRelativeWidgetResolution(self, attr, newResolution): """Called for each relativeWidget when resolution changes""" - val = self._trackedWidgets[attr].value() + # val = self._trackedWidgets[attr].value() newVal = self.pixelValForAttr( attr, - self.floatValForAttr(attr, val, axis=oldResolution), + self._relativeWidgetFloats[attr], axis=newResolution, ) with blockSignals(self._trackedWidgets[attr]): @@ -588,6 +635,20 @@ def updateRelativeWidgetResolution(self, attr, oldResolution, newResolution): def updateRelativeWidgetMaximum(self, attr, newResolution): newMaximumValue = newResolution[0] * ( - self._relativeMaximums[attr] / int(self.core.resolutions[0].split("x")[0]) + self._relativeWidgetMaximums[attr] + / int(self.core.resolutions[0].split("x")[0]) ) self._trackedWidgets[attr].setMaximum(int(newMaximumValue)) + + def updateRelativeWidgetFloat(self, attr, newPixelVal): + newFloatVal = self.floatValForAttr(attr, newPixelVal, (self.width, self.height)) + if self._relativeWidgetFloats[attr] != newFloatVal: + self._relativeWidgetFloats[attr] = self.floatValForAttr( + attr, newPixelVal, (self.width, self.height) + ) + if log.isEnabledFor(logging.INFO): + self._trackedWidgets[attr].setToolTip( + "relative value: {0:.3f}".format(self._relativeWidgetFloats[attr]) + ) + return True + return False diff --git a/src/avp/toolkit/common.py b/src/avp/toolkit/common.py index 9c5d088..e5c5c18 100644 --- a/src/avp/toolkit/common.py +++ b/src/avp/toolkit/common.py @@ -223,3 +223,9 @@ def randomColor(): def hasUndoStack(loader): """Receives a Command or MainWindow object""" return hasattr(loader, "undoStack") + + +def isVerticalWord(word): + word = word.lower() + vertWords = ["height", "ypos"] + return any([vertWord in word for vertWord in vertWords]) or word.endswith("y") diff --git a/tests/test_comp_text.py b/tests/test_comp_text.py index 2d83388..9e71011 100644 --- a/tests/test_comp_text.py +++ b/tests/test_comp_text.py @@ -92,10 +92,10 @@ def test_comp_text_fontSize_relative_to_resolution(windowWithTextComp): comp.page.spinBox_fontSize.setValue(200) # set resolution to 1280x720 windowWithTextComp.updateResolution(1) - assert comp.fontSize == 134 + assert comp.fontSize == 133 # set resolution to 854x480 windowWithTextComp.updateResolution(2) - assert comp.fontSize == 90 + assert comp.fontSize == 88 def test_comp_text_fontSize_rounding_errors(windowWithTextComp): From d0033856c2159a667764709e66bb3167c4a9fe18 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 00:18:43 -0400 Subject: [PATCH 36/67] remove custom logging level --- src/avp/__init__.py | 26 -------------------------- src/avp/command.py | 1 - src/avp/toolkit/common.py | 23 ++++++++++++----------- src/avp/toolkit/frame.py | 2 +- 4 files changed, 13 insertions(+), 39 deletions(-) diff --git a/src/avp/__init__.py b/src/avp/__init__.py index 81f8288..fa49a9c 100644 --- a/src/avp/__init__.py +++ b/src/avp/__init__.py @@ -1,36 +1,10 @@ import sys import os -import logging __version__ = "2.3.0" -class Logger(logging.getLoggerClass()): - """ - Custom Logger class to handle custom VERBOSE log level. - Levels used in this program are as follows: - VERBOSE Annoyingly frequent debug messages (e.g, in loops) - DEBUG Ordinary debug information - INFO Expected events that are expensive or irreversible - WARNING A non-fatal error or suspicious behaviour - ERROR Any error that would interrupt the user - CRITICAL Things that really shouldn't happen at all - """ - - def __init__(self, name, level=logging.NOTSET): - super().__init__(name, level) - logging.addLevelName(5, "VERBOSE") - - def verbose(self, msg, *args, **kwargs): - if self.isEnabledFor(5): - self._log(5, msg, args, **kwargs) - - -logging.setLoggerClass(Logger) -logging.VERBOSE = 5 - - if getattr(sys, "frozen", False): # frozen wd = os.path.dirname(sys.executable) diff --git a/src/avp/command.py b/src/avp/command.py index 41097ce..4f3e34e 100644 --- a/src/avp/command.py +++ b/src/avp/command.py @@ -179,7 +179,6 @@ def parseArgs(self): and "--verbose" not in sys.argv and "-v" not in sys.argv and "-vv" not in sys.argv - and "-vvv" not in sys.argv and "--log" not in sys.argv ): parser.print_help() diff --git a/src/avp/toolkit/common.py b/src/avp/toolkit/common.py index e5c5c18..9fcc853 100644 --- a/src/avp/toolkit/common.py +++ b/src/avp/toolkit/common.py @@ -28,16 +28,11 @@ def __init__(self, widgets): self.widgets = widgets if hasattr(widgets, "__iter__") else [widgets] def __enter__(self): - log.verbose( - "Blocking signals for %s", - ", ".join([str(w.__class__.__name__) for w in self.widgets]), - ) self.oldStates = [w.signalsBlocked() for w in self.widgets] for w in self.widgets: w.blockSignals(True) def __exit__(self, *args): - log.verbose("Resetting blockSignals to %s", str(bool(sum(self.oldStates)))) for w, state in zip(self.widgets, self.oldStates): w.blockSignals(state) @@ -168,12 +163,12 @@ def connectWidget(widget, func, unsupportedWidgets=None): elif type(widget) == QtWidgets.QComboBox: widget.currentIndexChanged.connect(func) elif widgetClassName in unsupportedWidgets: - log.info( - "Could not connect %s using connectWidget() (known unsupportedWidget)", + log.debug( + "%s is not supported by connectWidget()", widgetClassName, ) else: - log.warning("Failed to connect %s ", widgetClassName) + log.info("%s is unknown and unsupported by connectWidget()", widgetClassName) return False return True @@ -189,7 +184,9 @@ def setWidgetValue(widget, val): elif type(widget) == QtWidgets.QComboBox: widget.setCurrentIndex(val) else: - log.warning("Failed to set %s ", str(widget.__class__.__name__)) + log.warning( + "%s is not supported by setWidgetValue()", str(widget.__class__.__name__) + ) return False return True @@ -203,16 +200,20 @@ def getWidgetValue(widget): return widget.isChecked() elif type(widget) == QtWidgets.QComboBox: return widget.currentIndex() + log.warning( + "%s is not supported by getWidgetValue()", str(widget.__class__.__name__) + ) -def logWidgetValues(component, attrDict): +def logWidgetValues(component, attrDict, origin=""): log.debug( - "Set %s #%s's settings to %s", + "Set %s #%s's settings to %s %s", component.name, str(component.compPos), ", ".join( ["'%s: %s'" % (key, str(getattr(component, key))) for key in attrDict] ), + origin, ) diff --git a/src/avp/toolkit/frame.py b/src/avp/toolkit/frame.py index 829b05b..3a49e13 100644 --- a/src/avp/toolkit/frame.py +++ b/src/avp/toolkit/frame.py @@ -35,7 +35,7 @@ def setPen(self, penStyle): super().setPen(penStyle) def finalize(self): - log.verbose("Finalizing FramePainter") + log.debug("Finalizing FramePainter") buffer = QtCore.QBuffer() buffer.open(QtCore.QBuffer.OpenModeFlag.ReadWrite) self.image.save(buffer, "PNG") From 9c3e974373bae69523ad33543bb6c20b630d3018 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 00:19:34 -0400 Subject: [PATCH 37/67] new hotkeys using function keys (F1 through F5) FFmpeg command and debug information is now combined into the help window that comes up from F1 --- src/avp/gui/mainwindow.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index d14054a..743d628 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -6,7 +6,6 @@ """ from PyQt6 import QtCore, QtWidgets, uic -import PyQt6.QtWidgets as QtWidgets from PyQt6.QtGui import QShortcut from PIL import Image import sys @@ -52,7 +51,6 @@ class MainWindow(QtWidgets.QMainWindow): def __init__(self, project, dpi): super().__init__() - # log.debug("Main thread id: {}".format(int(QtCore.QThread.currentThreadId()))) uic.loadUi(os.path.join(Core.wd, "gui", "mainwindow.ui"), self) log.info("Pillow version %s", Image.__version__) log.info( @@ -67,6 +65,7 @@ def setupHotkeys(): QShortcut("Ctrl+A", self, self.openSaveProjectDialog) QShortcut("Ctrl+O", self, self.openOpenProjectDialog) QShortcut("Ctrl+N", self, self.createNewProject) + QShortcut("F2", self, lambda: self.pushButton_projects.click()) # Hotkeys for undo/redo QShortcut("Ctrl+Z", self, self.undoStack.undo) @@ -89,6 +88,7 @@ def setupHotkeys(): ) QShortcut("Ctrl+Shift+S", self, self.presetManager.openSavePresetDialog) QShortcut("Ctrl+Shift+C", self, self.presetManager.clearPreset) + QShortcut("F3", self, lambda: self.openPresetManager) QShortcut( "Ctrl+Up", @@ -112,13 +112,11 @@ def setupHotkeys(): ) QShortcut("F1", self, self.showHelpWindow) - QShortcut("Ctrl+Shift+F", self, self.showFfmpegCommand) + QShortcut("F4", self, self.showUndoStack) + QShortcut("F5", self, self.drawPreview) + QShortcut("Ctrl+Shift+F", self, self.showHelpWindow) QShortcut("Ctrl+Shift+U", self, self.showUndoStack) - if log.isEnabledFor(logging.INFO): - QShortcut("F2", self, lambda: log.info(repr(self))) - QShortcut("F5", self, self.drawPreview) - def setupMainWindowWidgets(): def setupUndoDialog(): """Create Undo Dialog - A standard QUndoView on a standard QDialog""" @@ -825,18 +823,18 @@ def showUndoStack(self): self.undoDialog.show() def showHelpWindow(self): - self.showMessage(msg=f"{appName} v{__version__}") - - def showFfmpegCommand(self): command = createFfmpegCommand( self.lineEdit_audioFile.text(), self.lineEdit_outputFile.text(), self.core.selectedComponents, ) command = " ".join(command) - log.info(f"FFmpeg command: {command}") lines = wrap(command, 49) - self.showMessage(msg=f"Current FFmpeg command:\n\n{' '.join(lines)}") + log.info(f"FFmpeg command: {command}") + log.info(f"MainWindow state: {repr(self)}") + self.showMessage( + msg=f"{appName} v{__version__}\n\nCurrent FFmpeg command:\n\n{' '.join(lines)}" + ) def addComponent(self, compPos, moduleIndex): """Creates an undoable action that adds a new component.""" From 3b724a16c21f4b7b89cd9d2b9671c38e4f380774 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 18:37:44 -0400 Subject: [PATCH 38/67] fix drawing multiple preview frames every program launch previously we always drew a minimum of two, either from the superfluous call to drawPreview or from inserting 2 default components. The superfluous call has been removed, and signals are blocked while inserting and configuring default components. This required adding a way to instantiate a Component object without inserting it, so a new createComponent method has been added to Core --- src/avp/core.py | 15 ++++++++++++-- src/avp/gui/actions.py | 18 ++++++++--------- src/avp/gui/mainwindow.py | 42 +++++++++++++++++++++------------------ 3 files changed, 44 insertions(+), 31 deletions(-) diff --git a/src/avp/core.py b/src/avp/core.py index 0243a92..701db77 100644 --- a/src/avp/core.py +++ b/src/avp/core.py @@ -69,6 +69,17 @@ def componentListChanged(self): for i, component in enumerate(self.selectedComponents): component.compPos = i + def createComponent(self, component, loader): + """ + Creates and returns a Component object + `component`: string component name or int componentModuleIndex + """ + if type(component) == str: + component = self.moduleIndexFor(component) + component = self.modules[component].Component(component, self) + component.widget(loader) + return component + def insertComponent(self, compPos, component, loader): """ Creates a new component using these args: @@ -85,12 +96,12 @@ def insertComponent(self, compPos, component, loader): # create component using module index in self.modules moduleIndex = int(component) log.debug("Creating new component from module #%s", str(moduleIndex)) - component = self.modules[moduleIndex].Component(moduleIndex, compPos, self) - component.widget(loader) + component = self.createComponent(moduleIndex, loader) else: moduleIndex = -1 log.debug("Inserting previously-created %s component", component.name) + component.compPos = compPos component._error.connect(loader.videoThreadError) self.selectedComponents.insert(compPos, component) if hasattr(loader, "insertComponent"): diff --git a/src/avp/gui/actions.py b/src/avp/gui/actions.py index b1c1343..631e644 100644 --- a/src/avp/gui/actions.py +++ b/src/avp/gui/actions.py @@ -69,16 +69,14 @@ def __init__(self, parent, compI, moduleI): def redo(self): if self.comp is None: - i = self.parent.core.insertComponent(self.compI, self.moduleI, self.parent) - if i != self.compI: - self.valid = False - if i is not None: - log.error( - f"Expected new component index to be {self.compI} but received {i}" - ) - else: - # inserting previously-created component - self.parent.core.insertComponent(self.compI, self.comp, self.parent) + self.comp = self.parent.core.createComponent(self.moduleI, self.parent) + i = self.parent.core.insertComponent(self.compI, self.comp, self.parent) + if i != self.compI: + log.error( + "Component could not insert at layer %s (inserted at %s instead)", + self.compI, + i, + ) def undo(self): if not self.valid: diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index 743d628..fedae83 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -150,14 +150,6 @@ def setupPreviewWindow(): lambda: log.info("Preview thread finished.") ) - timeout = 500 - log.debug( - "Preview timer set to trigger when idle for %sms" % str(timeout) - ) - self.timer = QtCore.QTimer(self) - self.timer.timeout.connect(self.processTask.emit) - self.timer.start(timeout) - def setupUndoFeature(): def toggleUndoButtonEnabled(*_): """Enable/disable undo button depending on whether UndoStack contains Actions""" @@ -384,9 +376,6 @@ def setupProjectsMenu(): int(self.width() * (dpi / 144)), int(self.height() * (dpi / 144)), ) - self.updateWindowTitle() - log.debug("Showing main window") - self.show() # Load project and prompt user to restore unsaved changes if project and project != self.autosavePath: @@ -419,7 +408,6 @@ def setupProjectsMenu(): os.remove(self.autosavePath) self.openProject(self.currentProject, prompt=False) - self.drawPreview(True) # Verify FFmpeg version if not self.core.FFMPEG_BIN: @@ -444,16 +432,32 @@ def setupProjectsMenu(): # Add initial components if none are in the list if not self.core.selectedComponents: - self.core.insertComponent( - 0, self.core.moduleIndexFor("Classic Visualizer"), self + log.info("Inserting default components") + classicVisComponent = self.core.createComponent( + self.core.moduleIndexFor("Classic Visualizer"), self ) - self.core.insertComponent(1, self.core.moduleIndexFor("Color"), self) - # set colors to white and black to match classic appearance of program - self.core.selectedComponents[0].page.lineEdit_visColor.setText( - "255,255,255" + colorComponent = self.core.createComponent( + self.core.moduleIndexFor("Color"), self ) - self.core.selectedComponents[1].page.lineEdit_color1.setText("0,0,0") + with blockSignals([classicVisComponent, colorComponent]): + self.core.insertComponent(0, classicVisComponent, self) + self.core.insertComponent(1, colorComponent, self) + # set colors to white and black to match classic appearance of program + with blockSignals(self.core.selectedComponents): + self.core.selectedComponents[0].page.lineEdit_visColor.setText( + "255,255,255" + ) + self.core.selectedComponents[1].page.lineEdit_color1.setText("0,0,0") self.undoStack.clear() + self.drawPreview() + + # Start timer to process preview images every 500ms + self.timer = QtCore.QTimer(self) + self.timer.timeout.connect(self.processTask.emit) + self.timer.start(500) + + # Show the window! + self.show() def __repr__(self): return ( From 5d7013822ba41a99490338aa9e0a6906e269980a Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 18:47:41 -0400 Subject: [PATCH 39/67] clean up log messages --- src/avp/cli.py | 6 +-- src/avp/command.py | 20 ++++---- src/avp/components/color.py | 2 +- src/avp/components/life.py | 2 +- src/avp/components/spectrum.py | 2 +- src/avp/components/text.py | 2 +- src/avp/components/video.py | 2 +- src/avp/components/waveform.py | 2 +- src/avp/core.py | 8 ++-- src/avp/gui/actions.py | 6 +-- src/avp/gui/mainwindow.py | 28 +++++------ src/avp/gui/presetmanager.py | 2 +- src/avp/gui/preview_thread.py | 11 +++-- src/avp/gui/preview_win.py | 4 +- src/avp/libcomponent/actions.py | 27 ++++++++--- src/avp/libcomponent/component.py | 75 +++++++++++++++++------------- src/avp/libcomponent/exceptions.py | 2 +- src/avp/libcomponent/metaclass.py | 11 +++-- src/avp/toolkit/common.py | 8 ++-- src/avp/toolkit/ffmpeg.py | 2 +- src/avp/toolkit/frame.py | 5 +- src/avp/video_thread.py | 2 +- tests/test_toolkit_common.py | 45 ++++++++++-------- 23 files changed, 152 insertions(+), 122 deletions(-) diff --git a/src/avp/cli.py b/src/avp/cli.py index 7d58fe1..44dacbb 100644 --- a/src/avp/cli.py +++ b/src/avp/cli.py @@ -10,7 +10,7 @@ # Core class must store settings as class variables # before we can use many things in AVP Core.storeSettings() -log = logging.getLogger("AVP.Main") +log = logging.getLogger(__name__) def main() -> int: @@ -58,9 +58,9 @@ def main() -> int: if mode == "GUI": from avp.gui.mainwindow import MainWindow - mainWindow = MainWindow(proj, dpi) + main = MainWindow(proj, dpi) log.debug("Finished creating MainWindow") - mainWindow.raise_() + main.raise_() return app.exec() diff --git a/src/avp/command.py b/src/avp/command.py index 4f3e34e..71ce802 100644 --- a/src/avp/command.py +++ b/src/avp/command.py @@ -18,7 +18,7 @@ from .core import Core -log = logging.getLogger("AVP.Commandline") +log = logging.getLogger(__name__) class Command(QtCore.QObject): @@ -54,14 +54,16 @@ def parseArgs(self): ) # input/output automatic-export commands - parser.add_argument("-i", "--input", metavar="SOUND", help="input audio file") parser.add_argument( - "-o", "--output", metavar="OUTPUT", help="output video file" + "-i", "--input", metavar="", help="input audio filename" + ) + parser.add_argument( + "-o", "--output", metavar="", help="output video's filename" ) parser.add_argument( "--export-project", action="store_true", - help="use input and output files from project file if -i or -o is missing", + help="use input and output filenames from project file if -i or -o is missing", ) # mutually exclusive debug options @@ -76,7 +78,7 @@ def parseArgs(self): "-v", action="count", default=0, - help="send log messages and ffmpeg output to stdout, and create more verbose log files (good to use before --log)", + help="send log messages and FFmpeg output to stdout, and create more verbose log files (good to use before --log)", ) # project/GUI options @@ -89,9 +91,11 @@ def parseArgs(self): parser.add_argument( "-c", "--comp", - metavar=("LAYER", "ARG"), - help="first arg must be component NAME to insert at LAYER." - '"help" for information about possible args for a component.', + metavar=("", ""), + help="Insert component at (a number from -1 to 50, " + "where 0 is rendered below 50 and -1 is always on top). " + "First argument must be the name of a component. More arguments configure the component. " + "(For example, use '-c 0 classic help' for help with Classic Visualizer component.)", nargs="*", action="append", ) diff --git a/src/avp/components/color.py b/src/avp/components/color.py index 980b4c6..1fd8573 100644 --- a/src/avp/components/color.py +++ b/src/avp/components/color.py @@ -5,7 +5,7 @@ from ..toolkit.frame import BlankFrame, FloodFrame, FramePainter -log = logging.getLogger("AVP.Components.Color") +log = logging.getLogger(__name__) class Component(BaseComponent): diff --git a/src/avp/components/life.py b/src/avp/components/life.py index 73ebce8..77084a8 100644 --- a/src/avp/components/life.py +++ b/src/avp/components/life.py @@ -13,7 +13,7 @@ from ..toolkit.visualizer import createSpectrumArray -log = logging.getLogger("AVP.Component.Life") +log = logging.getLogger(__name__) class Component(BaseComponent): diff --git a/src/avp/components/spectrum.py b/src/avp/components/spectrum.py index aeaad2a..d361a69 100644 --- a/src/avp/components/spectrum.py +++ b/src/avp/components/spectrum.py @@ -15,7 +15,7 @@ ) -log = logging.getLogger("AVP.Components.Spectrum") +log = logging.getLogger(__name__) class Component(BaseComponent): diff --git a/src/avp/components/text.py b/src/avp/components/text.py index f393a65..5c24f51 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -7,7 +7,7 @@ from ..toolkit import hasUndoStack from ..toolkit.frame import FramePainter, addShadow -log = logging.getLogger("AVP.Components.Text") +log = logging.getLogger(__name__) class Component(BaseComponent): diff --git a/src/avp/components/video.py b/src/avp/components/video.py index 035ea0f..bb41bf8 100644 --- a/src/avp/components/video.py +++ b/src/avp/components/video.py @@ -9,7 +9,7 @@ from ..toolkit.ffmpeg import openPipe, closePipe, testAudioStream, FfmpegVideo -log = logging.getLogger("AVP.Components.Video") +log = logging.getLogger(__name__) class Component(BaseComponent): diff --git a/src/avp/components/waveform.py b/src/avp/components/waveform.py index ead3310..1873f1d 100644 --- a/src/avp/components/waveform.py +++ b/src/avp/components/waveform.py @@ -16,7 +16,7 @@ ) -log = logging.getLogger("AVP.Components.Waveform") +log = logging.getLogger(__name__) class Component(BaseComponent): diff --git a/src/avp/core.py b/src/avp/core.py index 701db77..762cc6e 100644 --- a/src/avp/core.py +++ b/src/avp/core.py @@ -13,7 +13,7 @@ from . import toolkit appName = "Audio Visualizer Python" -log = logging.getLogger("AVP.Core") +log = logging.getLogger(__name__) class Core: @@ -538,8 +538,8 @@ def storeSettings(cls, dataDir=None): def loadDefaultSettings(cls): # settings that get saved into the ini file cls.defaultSettings = { - "outputWidth": 1280, - "outputHeight": 720, + "outputWidth": 1920, + "outputHeight": 1080, "outputFrameRate": 30, "outputAudioCodec": "AAC", "outputAudioBitrate": "192", @@ -581,7 +581,7 @@ def makeLogger(deleteOldLogs=False, fileLogLvl=None): logStream.setLevel(Core.stdoutLogLvl) streamFormatter = logging.Formatter("<%(name)s> %(levelname)s: %(message)s") logStream.setFormatter(streamFormatter) - log = logging.getLogger("AVP") + log = logging.getLogger(__package__) log.addHandler(logStream) if fileLogLvl is not None: diff --git a/src/avp/gui/actions.py b/src/avp/gui/actions.py index 631e644..4af7837 100644 --- a/src/avp/gui/actions.py +++ b/src/avp/gui/actions.py @@ -11,7 +11,7 @@ from ..toolkit import blockSignals -log = logging.getLogger("AVP.Gui.Actions") +log = logging.getLogger(__name__) # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ @@ -79,9 +79,6 @@ def redo(self): ) def undo(self): - if not self.valid: - return - self.comp = self.parent.core.selectedComponents[self.compI] self.parent._removeComponent(self.compI) @@ -97,7 +94,6 @@ def redo(self): self.parent._removeComponent(self.selectedRows[0]) def undo(self): - componentList = self.parent.listWidget_componentList for index, comp in zip(self.selectedRows, self.components): self.parent.core.insertComponent(index, comp, self.parent) self.parent.drawPreview() diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index fedae83..6038b08 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -31,7 +31,7 @@ ) -log = logging.getLogger("AVP.Gui.MainWindow") +log = logging.getLogger(__name__) SYSPLATFORM = sys.platform @@ -74,41 +74,35 @@ def setupHotkeys(): # Hotkeys for component list for inskey in ("Ctrl+T", QtCore.Qt.Key.Key_Insert): - QShortcut( - inskey, - self, - activated=lambda: self.pushButton_addComponent.click(), - ) + QShortcut(inskey, self, lambda: self.pushButton_addComponent.click()) for delkey in ("Ctrl+R", QtCore.Qt.Key.Key_Delete): QShortcut(delkey, self.listWidget_componentList, self.removeComponent) QShortcut( - "Ctrl+Space", - self, - activated=lambda: self.listWidget_componentList.setFocus(), + "Ctrl+Space", self, lambda: self.listWidget_componentList.setFocus() ) QShortcut("Ctrl+Shift+S", self, self.presetManager.openSavePresetDialog) QShortcut("Ctrl+Shift+C", self, self.presetManager.clearPreset) - QShortcut("F3", self, lambda: self.openPresetManager) + QShortcut("F3", self, self.openPresetManager) QShortcut( "Ctrl+Up", self.listWidget_componentList, - activated=lambda: self.moveComponent(-1), + lambda: self.moveComponent(-1), ) QShortcut( "Ctrl+Down", self.listWidget_componentList, - activated=lambda: self.moveComponent(1), + lambda: self.moveComponent(1), ) QShortcut( "Ctrl+Home", self.listWidget_componentList, - activated=lambda: self.moveComponent("top"), + lambda: self.moveComponent("top"), ) QShortcut( "Ctrl+End", self.listWidget_componentList, - activated=lambda: self.moveComponent("bottom"), + lambda: self.moveComponent("bottom"), ) QShortcut("F1", self, self.showHelpWindow) @@ -609,7 +603,7 @@ def autosaveExists(self, identical=True): and filecmp.cmp(self.autosavePath, self.currentProject) == identical ): log.debug( - "Autosave found %s to be identical" % "not" if not identical else "" + "Autosave found %s to be identical", "not" if not identical else "" ) return True except FileNotFoundError: @@ -837,7 +831,7 @@ def showHelpWindow(self): log.info(f"FFmpeg command: {command}") log.info(f"MainWindow state: {repr(self)}") self.showMessage( - msg=f"{appName} v{__version__}\n\nCurrent FFmpeg command:\n\n{' '.join(lines)}" + msg=f"{appName} v{__version__}\n\nCurrent FFmpeg command:\n{' '.join(lines)}" ) def addComponent(self, compPos, moduleIndex): @@ -1046,7 +1040,7 @@ def openProject(self, filepath, prompt=True): # actually load the project using core method self.core.openProject(self, filepath) self.drawPreview(autosave=False) - self.updateWindowTitle() + # self.updateWindowTitle() def showMessage(self, **kwargs): parent = kwargs["parent"] if "parent" in kwargs else self diff --git a/src/avp/gui/presetmanager.py b/src/avp/gui/presetmanager.py index bdcff91..007d6f3 100644 --- a/src/avp/gui/presetmanager.py +++ b/src/avp/gui/presetmanager.py @@ -13,7 +13,7 @@ from .actions import * -log = logging.getLogger("AVP.Gui.PresetManager") +log = logging.getLogger(__name__) class PresetManager(QtWidgets.QDialog): diff --git a/src/avp/gui/preview_thread.py b/src/avp/gui/preview_thread.py index ce9ce3b..704b0b6 100644 --- a/src/avp/gui/preview_thread.py +++ b/src/avp/gui/preview_thread.py @@ -15,7 +15,7 @@ from ..toolkit import disableWhenOpeningProject -log = logging.getLogger("AVP.Gui.PreviewThread") +log = logging.getLogger(__name__) class Worker(QtCore.QObject): @@ -29,7 +29,7 @@ def __init__(self, core, settings): self.settings = settings self.queue = Queue() self.newBackground() - self.canceled = False + self.frameNo = 0 def newBackground(self): width = int(self.settings.value("outputWidth")) @@ -104,7 +104,12 @@ def process(self): # or else Qt will garbage-collect it on the C++ side self.frame = ImageQt(frame) timeElapsed = time.time() - timeElapsed - log.info("Generated preview frame in {0:.3f}s".format(timeElapsed)) + self.frameNo += 1 + log.info( + "Generated preview frame #{0} in {1:.3f}s using {2} components".format( + self.frameNo, timeElapsed, len(components) + ) + ) self.imageCreated.emit(QtGui.QImage(self.frame)) except Empty: diff --git a/src/avp/gui/preview_win.py b/src/avp/gui/preview_win.py index f52f8a3..83e4c44 100644 --- a/src/avp/gui/preview_win.py +++ b/src/avp/gui/preview_win.py @@ -1,7 +1,7 @@ from PyQt6 import QtCore, QtGui, QtWidgets import logging -log = logging.getLogger("AVP.Gui.PreviewWindow") +log = logging.getLogger(__name__) class PreviewWindow(QtWidgets.QLabel): @@ -55,4 +55,4 @@ def mousePressEvent(self, event): @QtCore.pyqtSlot(str) def threadError(self, msg): self.parent.showMessage(msg=msg, icon="Critical", parent=self) - log.info("%", repr(self.parent)) + log.info("%s", repr(self.parent)) diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index b6bbcad..b5b4b47 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -7,7 +7,9 @@ from copy import copy import logging -log = logging.getLogger("AVP.ComponentHandler") +from ..toolkit.common import logWidgetValues + +log = logging.getLogger(__name__) class ComponentTrackedWidgetUpdate(QUndoCommand): @@ -50,16 +52,27 @@ def mergeWith(self, other): self.modifiedVals.update(other.modifiedVals) return True + def do(self, widgetValues): + self.parent.setWidgetValues(widgetValues) + self.parent.update(auto=True, origin="tracked widget update") + def redo(self): if self.undone: - log.info("Redoing component update") - self.parent.setWidgetValues(self.modifiedVals) - self.parent.update(auto=True) + log.info( + "Redoing %s #%s tracked widget update", + self.parent.name, + self.parent.compPos, + ) + self.do(self.modifiedVals) def undo(self): - log.info("Undoing component update") - self.parent.setWidgetValues(self.oldWidgetVals) - self.parent.update(auto=True) + log.info( + "Undoing %s #%s tracked widget update", + self.parent.name, + self.parent.compPos, + ) + self.undone = True + self.do(self.oldWidgetVals) class ComponentPreviewClick(QUndoCommand): diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index bd8b792..9026850 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -26,7 +26,7 @@ isVerticalWord, ) -log = logging.getLogger("AVP.BaseComponent") +log = logging.getLogger(__name__) class Component(QtCore.QObject, metaclass=ComponentMetaclass): @@ -44,10 +44,10 @@ class Component(QtCore.QObject, metaclass=ComponentMetaclass): modified = QtCore.pyqtSignal(int, dict) _error = QtCore.pyqtSignal(str, str) - def __init__(self, moduleIndex, compPos, core): + def __init__(self, moduleIndex, core): super().__init__() self.moduleIndex = moduleIndex - self.compPos = compPos + self.compPos = -1 self.core = core self._width = int(core.settings.value("outputWidth")) self._height = int(core.settings.value("outputHeight")) @@ -215,23 +215,29 @@ def loadPreset(self, presetDict, presetName=None): ) currentResolution = (self.width, self.height) - # Fix relative widget values if resolution wasn't saved into preset - # This happens if loading a file from before v2.3.0 - if "resolution" not in presetDict: - log.warning( - "%s #%s's%s resolution was not saved. Using project resolution instead.", - self.name, - str(self.compPos), - "" if self.currentPreset is None else " %s" % self.currentPreset, - ) - presetDict["resolution"] = currentResolution - for attr in self._relativeWidgets: - if getPresetAttrName(attr) not in presetDict: - continue - if type(presetDict[getPresetAttrName(attr)]) == float: - presetDict[getPresetAttrName(attr)] = self.pixelValForAttr( - attr, presetDict[getPresetAttrName(attr)] - ) + def upgradeFromOldVersion(presetDict): + """ + Fix relative widget values if resolution wasn't saved into preset + This happens if loading a file from before v2.3.0 + """ + if "resolution" not in presetDict: + log.warning( + "%s #%s's%s resolution was not saved. Using project resolution instead.", + self.name, + str(self.compPos), + "" if self.currentPreset is None else " %s" % self.currentPreset, + ) + presetDict["resolution"] = currentResolution + for attr in self._relativeWidgets: + if getPresetAttrName(attr) not in presetDict: + continue + if type(presetDict[getPresetAttrName(attr)]) == float: + presetDict[getPresetAttrName(attr)] = self.pixelValForAttr( + attr, presetDict[getPresetAttrName(attr)] + ) + return presetDict + + presetDict = upgradeFromOldVersion(presetDict) self._width, self._height = presetDict["resolution"] for attr, widget in self._trackedWidgets.items(): @@ -253,7 +259,8 @@ def loadPreset(self, presetDict, presetName=None): val = getattr(self, key) if attr in self._colorWidgets: - widget.setText("%s,%s,%s" % val) + with blockSignals(widget): + widget.setText("%s,%s,%s" % val) btnStyle = ( "QPushButton { background-color : %s; outline: none; }" % QColor(*val).name() @@ -262,11 +269,13 @@ def loadPreset(self, presetDict, presetName=None): else: if attr in self._relativeWidgets: self.updateRelativeWidgetFloat(attr, val) - setWidgetValue(widget, val) - - logWidgetValues(self, self._trackedWidgets) + with blockSignals(widget): + setWidgetValue(widget, val) + logWidgetValues(self, self._trackedWidgets, "loadPreset") if presetDict["resolution"] != currentResolution: self.updateResolution() + else: + self.update(auto=True) def savePreset(self): saveValueStore = {} @@ -330,7 +339,7 @@ def _userUpdate(self): action = ComponentTrackedWidgetUpdate(self, oldWidgetVals, modifiedWidgets) self.loader.undoStack.push(action) - def _autoUpdate(self): + def _autoUpdate(self, origin=None): """Happens after subclass update() for an internal component update.""" newWidgetVals = { attr: getWidgetValue(widget) @@ -338,6 +347,11 @@ def _autoUpdate(self): } self.setAttrs(newWidgetVals) self._sendUpdateSignal() + logWidgetValues( + self, + newWidgetVals, + f"{'unknown' if origin is None else origin} through autoupdate", + ) def updateResolution(self): newWidth = int(self.core.settings.value("outputWidth")) @@ -355,8 +369,7 @@ def updateResolution(self): self.updateRelativeWidgetResolution(attr, (newWidth, newHeight)) self._width = newWidth self._height = newHeight - self._preUpdate() - self._autoUpdate() + self.update(auto=True, origin="updateResolution") def setAttrs(self, attrDict): """ @@ -380,7 +393,6 @@ def setAttrs(self, attrDict): else: # Normal tracked widget setattr(self, attr, val) - logWidgetValues(self, attrDict) def setWidgetValues(self, attrDict): """ @@ -396,7 +408,6 @@ def setWidgetValues(self, attrDict): if attr in self._relativeWidgets: self.updateRelativeWidgetFloat(attr, val) setWidgetValue(widget, val) - logWidgetValues(self, attrDict) def _sendUpdateSignal(self): if self.core.openingProject: @@ -482,8 +493,7 @@ def pickColor_(): ) ) - self._preUpdate() - self._autoUpdate() + # self.update(auto=True, origin="trackWidgets") def pickColor(self, textWidget, button): """Use color picker to get color input from the user.""" @@ -533,7 +543,8 @@ def unlockSize(self): def loadUi(self, filename): """Load a Qt Designer ui file to use for this component's widget""" - return uic.loadUi(os.path.join(self.core.componentsPath, filename)) + with blockSignals(self): + return uic.loadUi(os.path.join(self.core.componentsPath, filename)) @property def width(self): diff --git a/src/avp/libcomponent/exceptions.py b/src/avp/libcomponent/exceptions.py index 5498414..33f8471 100644 --- a/src/avp/libcomponent/exceptions.py +++ b/src/avp/libcomponent/exceptions.py @@ -5,7 +5,7 @@ from ..toolkit import formatTraceback -log = logging.getLogger("AVP.ComponentHandler") +log = logging.getLogger(__name__) class ComponentError(RuntimeError): diff --git a/src/avp/libcomponent/metaclass.py b/src/avp/libcomponent/metaclass.py index 5019c50..e56e81a 100644 --- a/src/avp/libcomponent/metaclass.py +++ b/src/avp/libcomponent/metaclass.py @@ -6,7 +6,7 @@ from ..toolkit import connectWidget, hasUndoStack from ..toolkit.frame import BlankFrame -log = logging.getLogger("AVP.ComponentHandler") +log = logging.getLogger(__name__) class ComponentMetaclass(type(QtCore.QObject)): @@ -123,9 +123,10 @@ def updateWrapper(func): """ class wrap: - def __init__(self, comp, auto): + def __init__(self, comp, auto, origin): self.comp = comp self.auto = auto + self.origin = origin def __enter__(self): self.comp._preUpdate() @@ -136,13 +137,15 @@ def __exit__(self, *args): or self.comp.openingPreset or not hasUndoStack(self.comp.loader) ): - self.comp._autoUpdate() + self.comp._autoUpdate(self.origin) else: self.comp._userUpdate() def updateWrapper(self, **kwargs): auto = kwargs.get("auto", False) - with wrap(self, auto): + origin = kwargs.get("origin", "metaclass") + + with wrap(self, auto, origin): try: return func(self) except Exception: diff --git a/src/avp/toolkit/common.py b/src/avp/toolkit/common.py index 9fcc853..e6dd8e3 100644 --- a/src/avp/toolkit/common.py +++ b/src/avp/toolkit/common.py @@ -12,7 +12,7 @@ from collections import OrderedDict -log = logging.getLogger("AVP.Toolkit.Common") +log = logging.getLogger(__name__) class blockSignals: @@ -205,15 +205,15 @@ def getWidgetValue(widget): ) -def logWidgetValues(component, attrDict, origin=""): +def logWidgetValues(component, attrDict, origin=None): log.debug( - "Set %s #%s's settings to %s %s", + "Set %s #%s's settings to %s by %s", component.name, str(component.compPos), ", ".join( ["'%s: %s'" % (key, str(getattr(component, key))) for key in attrDict] ), - origin, + "unknown" if origin is None else str(origin), ) diff --git a/src/avp/toolkit/ffmpeg.py b/src/avp/toolkit/ffmpeg.py index 93aa725..6f93393 100644 --- a/src/avp/toolkit/ffmpeg.py +++ b/src/avp/toolkit/ffmpeg.py @@ -15,7 +15,7 @@ from .common import checkOutput, pipeWrapper -log = logging.getLogger("AVP.Toolkit.Ffmpeg") +log = logging.getLogger(__name__) class FfmpegVideo: diff --git a/src/avp/toolkit/frame.py b/src/avp/toolkit/frame.py index 3a49e13..5b66cd5 100644 --- a/src/avp/toolkit/frame.py +++ b/src/avp/toolkit/frame.py @@ -3,17 +3,16 @@ """ from PyQt6 import QtGui -from PIL import Image, ImageEnhance, ImageChops, ImageFilter +from PIL import Image, ImageEnhance, ImageFilter from PIL.ImageQt import ImageQt from PyQt6 import QtCore -import sys import os import math import logging from .. import core -log = logging.getLogger("AVP.Toolkit.Frame") +log = logging.getLogger(__name__) class FramePainter(QtGui.QPainter): diff --git a/src/avp/video_thread.py b/src/avp/video_thread.py index 192b1cc..ed83c9b 100644 --- a/src/avp/video_thread.py +++ b/src/avp/video_thread.py @@ -32,7 +32,7 @@ ) -log = logging.getLogger("AVP.VideoThread") +log = logging.getLogger(__name__) class Worker(QtCore.QObject): diff --git a/tests/test_toolkit_common.py b/tests/test_toolkit_common.py index 3d14d49..2937e4a 100644 --- a/tests/test_toolkit_common.py +++ b/tests/test_toolkit_common.py @@ -10,28 +10,33 @@ class UnsupportedWidget: @fixture -def gotWarning(): - """Check if a function called log.warning""" +def getLogLevel(): + """Check if a function wrote a log message""" import avp.toolkit.common as tk - warning = False + logLevel = None - def gotWarning(): - nonlocal warning - return warning + def gotLogLevel(): + nonlocal logLevel + return logLevel class log: def warning(self, *args): - nonlocal warning - warning = True + nonlocal logLevel + logLevel = "warning" def info(self, *args): - pass + nonlocal logLevel + logLevel = "info" + + def debug(self, *args): + nonlocal logLevel + logLevel = "debug" oldLog = tk.log tk.log = log() try: - yield gotWarning + yield gotLogLevel finally: tk.log = oldLog @@ -45,27 +50,27 @@ def test_blockSignals(qtbot, command): assert comp.page.spinBox_scale.signalsBlocked() == False -def test_rgbFromString(gotWarning): +def test_rgbFromString(getLogLevel): assert rgbFromString("255,255,255") == (255, 255, 255) - assert not gotWarning() + assert getLogLevel() is None -def test_rgbFromString_error(gotWarning): +def test_rgbFromString_log_warning(getLogLevel): assert rgbFromString("255,255,256") == (255, 255, 255) - assert gotWarning() + assert getLogLevel() == "warning" -def test_connectWidget_unsupportedWidgetInfo(gotWarning): - """A known unsupported widget causes an info message""" +def test_connectWidget_unsupportedWidget_log_debug(getLogLevel): + """A known unsupported widget causes a debug message""" connectWidget( UnsupportedWidget(), lambda: ..., unsupportedWidgets=["UnsupportedWidget"] ) - assert not gotWarning() + assert getLogLevel() == "debug" -def test_connectWidget_unsupportedWidgetWarning(gotWarning): - """An unknown unsupported widget causes a warning message""" +def test_connectWidget_unsupportedWidget_log_info(getLogLevel): + """An unknown unsupported widget causes an info message""" connectWidget(UnsupportedWidget(), lambda: ...) - assert gotWarning() + assert getLogLevel() == "info" From ae85c1ed304694303b73a50e2e79fed94ba330e6 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 18:49:16 -0400 Subject: [PATCH 40/67] test if random color of new components is saved for undo/redo --- tests/test_mainwindow_comp_actions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_mainwindow_comp_actions.py b/tests/test_mainwindow_comp_actions.py index d2b11d3..a176c31 100644 --- a/tests/test_mainwindow_comp_actions.py +++ b/tests/test_mainwindow_comp_actions.py @@ -66,3 +66,15 @@ def test_undo_title_text_not_merged(window, qtbot): comp.page.lineEdit_title.setText("test") window.undoStack.undo() assert comp.title == "avp" + + +def test_undo_randomColor_is_saved(window, qtbot): + window.addComponent(0, window.core.moduleIndexFor("Color")) + comp = window.core.selectedComponents[0] + randomText = comp.page.lineEdit_color1.text() + randomTuple = comp.color1 + window.undoStack.undo() + window.undoStack.redo() + comp = window.core.selectedComponents[0] + assert comp.page.lineEdit_color1.text() == randomText + assert comp.color1 == randomTuple From 4e7def92a205c10096ac22816e8fab71da1586e8 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 18:51:34 -0400 Subject: [PATCH 41/67] add `--size` argument to set resolution from commandline I chose "size" as the name to match FFmpeg, where -s is resolution (and -r should be framerate if we add support for that in future) --- src/avp/command.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/avp/command.py b/src/avp/command.py index 71ce802..22ffe10 100644 --- a/src/avp/command.py +++ b/src/avp/command.py @@ -53,6 +53,13 @@ def parseArgs(self): "--version", "-V", action="version", version=f"%(prog)s {__version__}" ) + parser.add_argument( + "--size", + "-s", + help="set output frame size (resolution)", + choices=Core.resolutions, + ) + # input/output automatic-export commands parser.add_argument( "-i", "--input", metavar="", help="input audio filename" @@ -115,6 +122,11 @@ def parseArgs(self): self.createLogFile() quit(0) + if args.size: + w, h = args.size.split("x") + self.core.settings.setValue("outputWidth", w) + self.core.settings.setValue("outputHeight", h) + if args.projpath: projPath = args.projpath if not os.path.dirname(projPath): From 552e851849110e16902f576d4dacaea6409611cf Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 20:45:54 -0400 Subject: [PATCH 42/67] remove superfluous redraws of the preview window redrawing is handled by the MainWindow when receivin the `modified` signal from components, and doesn't need to be done by the preset manager --- src/avp/gui/presetmanager.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/avp/gui/presetmanager.py b/src/avp/gui/presetmanager.py index 007d6f3..7a1675d 100644 --- a/src/avp/gui/presetmanager.py +++ b/src/avp/gui/presetmanager.py @@ -200,9 +200,7 @@ def _openPreset(self, presetName, index): dirname = os.path.join(self.presetDir, componentName, str(version)) filepath = os.path.join(dirname, presetName) self.core.openPreset(filepath, index, presetName) - - self.parent.updateComponentTitle(index) - self.parent.drawPreview() + self.parent.updateComponentTitle(index, False) def openDeletePresetDialog(self): row = self.getPresetRow() @@ -298,7 +296,6 @@ def renamePreset(self, path, oldName, newName): if self.core.getPresetDir(comp) == path and comp.currentPreset == oldName: self.core.openPreset(newPath, i, newName) self.parent.updateComponentTitle(i, False) - self.parent.drawPreview() def openImportDialog(self): filename, _ = QtWidgets.QFileDialog.getOpenFileName( From c62218314c73cef066678d689766953832e02da4 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 20:47:55 -0400 Subject: [PATCH 43/67] better log messages --- src/avp/libcomponent/component.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index 9026850..4076527 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -176,9 +176,8 @@ def widget(self, loader): """ self.loader = loader log.debug( - "Creating UI for %s #%s's widget", + "Creating UI for %s's page widget", self.__class__.name, - self.compPos, ) self.page = self.loadUi(self.__class__.ui) @@ -271,11 +270,10 @@ def upgradeFromOldVersion(presetDict): self.updateRelativeWidgetFloat(attr, val) with blockSignals(widget): setWidgetValue(widget, val) - logWidgetValues(self, self._trackedWidgets, "loadPreset") if presetDict["resolution"] != currentResolution: self.updateResolution() else: - self.update(auto=True) + self.update(auto=True, origin="loadPreset") def savePreset(self): saveValueStore = {} @@ -543,8 +541,7 @@ def unlockSize(self): def loadUi(self, filename): """Load a Qt Designer ui file to use for this component's widget""" - with blockSignals(self): - return uic.loadUi(os.path.join(self.core.componentsPath, filename)) + return uic.loadUi(os.path.join(self.core.componentsPath, filename)) @property def width(self): @@ -629,7 +626,7 @@ def setRelativeWidget(self, attr, floatVal, axis=None): self._trackedWidgets[attr].setToolTip( "relative value: {0:.3f}".format(self._relativeWidgetFloats[attr]) ) - self.update(auto=True) + self.update(auto=True, origin="setRelativeWidget") def updateRelativeWidgetResolution(self, attr, newResolution): """Called for each relativeWidget when resolution changes""" From 82c032cd28def91b8e1cea132e585d8c12765903 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 17 Jun 2026 23:51:08 -0400 Subject: [PATCH 44/67] fix incorrect positions when undoing center and click actions --- src/avp/components/image.py | 56 ++++++++++++++++++--------- src/avp/components/text.py | 44 +++++++++++++++------ tests/test_comp_text.py | 43 +++++++++++++++++++- tests/test_mainwindow_comp_actions.py | 11 ++++++ 4 files changed, 122 insertions(+), 32 deletions(-) diff --git a/src/avp/components/image.py b/src/avp/components/image.py index a6471f6..79d2416 100644 --- a/src/avp/components/image.py +++ b/src/avp/components/image.py @@ -4,7 +4,7 @@ from ..libcomponent import BaseComponent from ..libcomponent.actions import ComponentPreviewClick, ComponentSettingsUpdate -from ..toolkit import hasUndoStack +from ..toolkit import hasUndoStack, blockSignals from ..toolkit.frame import BlankFrame, addShadow from ..toolkit.visualizer import createSpectrumArray @@ -98,13 +98,14 @@ def addCenterAction(self): self.loader.undoStack.push(action) def centerXY(self): - self.setRelativeWidget( - "xPosition", - 0.5 - - self.floatValForAttr( - "xPosition", self.imageSize[0] / 2, (self.width, self.height) - ), - ) + with blockSignals(self): + self.setRelativeWidget( + "xPosition", + 0.5 + - self.floatValForAttr( + "xPosition", self.imageSize[0] / 2, (self.width, self.height) + ), + ) self.setRelativeWidget( "yPosition", 0.5 @@ -266,33 +267,52 @@ def commandHelp(self): class ClickPreviewAction(ComponentPreviewClick): def __init__(self, *args): super().__init__(*args) - + self.res = (self.comp.width, self.comp.height) self.oldXY = ( - self.comp.floatValForAttr("xPosition"), - self.comp.floatValForAttr("yPosition"), + self.comp.floatValForAttr("xPosition", axis=self.res), + self.comp.floatValForAttr("yPosition", axis=self.res), ) def add(self): for pos in self.pos[:]: - self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) + with blockSignals(self.comp): + self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) self.comp.setRelativeWidget("yPosition", pos[1] / self.size[1]) def remove(self): - self.comp.setRelativeWidget("xPosition", self.oldXY[0]) - self.comp.setRelativeWidget("yPosition", self.oldXY[1]) + self.comp.setWidgetValues( + { + "xPosition": self.comp.pixelValForAttr( + "xPosition", self.oldXY[0], self.res + ), + "yPosition": self.comp.pixelValForAttr( + "yPosition", self.oldXY[1], self.res + ), + } + ) + self.comp.update(auto=True, origin="ClickPreviewAction") class CenterImageAction(ComponentSettingsUpdate): def __init__(self, comp): super().__init__(comp) self.oldXY = ( - self.comp.floatValForAttr("xPosition"), - self.comp.floatValForAttr("yPosition"), + self.comp.floatValForAttr("xPosition", axis=self.res), + self.comp.floatValForAttr("yPosition", axis=self.res), ) def redo(self): self.comp.centerXY() def undo(self): - self.comp.setRelativeWidget("xPosition", self.oldXY[0]) - self.comp.setRelativeWidget("yPosition", self.oldXY[1]) + self.comp.setWidgetValues( + { + "xPosition": self.comp.pixelValForAttr( + "xPosition", self.oldXY[0], self.res + ), + "yPosition": self.comp.pixelValForAttr( + "yPosition", self.oldXY[1], self.res + ), + } + ) + self.comp.update(auto=True, origin="CenterImageAction") diff --git a/src/avp/components/text.py b/src/avp/components/text.py index 5c24f51..3283770 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -4,7 +4,7 @@ from ..libcomponent import BaseComponent from ..libcomponent.actions import ComponentPreviewClick, ComponentSettingsUpdate -from ..toolkit import hasUndoStack +from ..toolkit import hasUndoStack, blockSignals from ..toolkit.frame import FramePainter, addShadow log = logging.getLogger(__name__) @@ -99,7 +99,8 @@ def addCenterAction(self): self.loader.undoStack.push(action) def centerXY(self): - self.setRelativeWidget("xPosition", 0.5) + with blockSignals(self): + self.setRelativeWidget("xPosition", 0.5) self.setRelativeWidget("yPosition", 0.521) def getXY(self): @@ -230,33 +231,52 @@ def command(self, arg): class ClickPreviewAction(ComponentPreviewClick): def __init__(self, *args): super().__init__(*args) - + self.res = (self.comp.width, self.comp.height) self.oldXY = ( - self.comp.floatValForAttr("xPosition"), - self.comp.floatValForAttr("yPosition"), + self.comp.floatValForAttr("xPosition", axis=self.res), + self.comp.floatValForAttr("yPosition", axis=self.res), ) def add(self): for pos in self.pos[:]: - self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) + with blockSignals(self.comp): + self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) self.comp.setRelativeWidget("yPosition", pos[1] / self.size[1]) def remove(self): - self.comp.setRelativeWidget("xPosition", self.oldXY[0]) - self.comp.setRelativeWidget("yPosition", self.oldXY[1]) + self.comp.setWidgetValues( + { + "xPosition": self.comp.pixelValForAttr( + "xPosition", self.oldXY[0], self.res + ), + "yPosition": self.comp.pixelValForAttr( + "yPosition", self.oldXY[1], self.res + ), + } + ) + self.comp.update(auto=True, origin="ClickPreviewAction") class CenterTextAction(ComponentSettingsUpdate): def __init__(self, comp): super().__init__(comp) self.oldXY = ( - self.comp.floatValForAttr("xPosition"), - self.comp.floatValForAttr("yPosition"), + self.comp.floatValForAttr("xPosition", axis=self.res), + self.comp.floatValForAttr("yPosition", axis=self.res), ) def redo(self): self.comp.centerXY() def undo(self): - self.comp.setRelativeWidget("xPosition", self.oldXY[0]) - self.comp.setRelativeWidget("yPosition", self.oldXY[1]) + self.comp.setWidgetValues( + { + "xPosition": self.comp.pixelValForAttr( + "xPosition", self.oldXY[0], self.res + ), + "yPosition": self.comp.pixelValForAttr( + "yPosition", self.oldXY[1], self.res + ), + } + ) + self.comp.update(auto=True, origin="CenterTextAction") diff --git a/tests/test_comp_text.py b/tests/test_comp_text.py index 9e71011..50aa78f 100644 --- a/tests/test_comp_text.py +++ b/tests/test_comp_text.py @@ -79,11 +79,12 @@ def test_comp_text_previewClickEvent_undo_redo(windowWithTextComp): def test_comp_text_centerText_undo_redo(windowWithTextComp): comp = windowWithTextComp.core.selectedComponents[0] comp.page.spinBox_xTextAlign.setValue(0) - comp.page.pushButton_center.click() + comp.addCenterAction() + centeredX = comp.page.spinBox_xTextAlign.value() windowWithTextComp.undoStack.undo() assert comp.xPosition == 0 windowWithTextComp.undoStack.redo() - assert comp.xPosition == comp.pixelValForAttr("xPosition", 0.5) + assert comp.xPosition == centeredX def test_comp_text_fontSize_relative_to_resolution(windowWithTextComp): @@ -116,3 +117,41 @@ def test_comp_text_fontSize_maximum(windowWithTextComp): # set resolution to 854x480 windowWithTextComp.updateResolution(2) assert comp.page.spinBox_fontSize.maximum() == 222 + + +def test_comp_text_undo_center_through_resolution_change_mutates_positions( + window, qtbot +): + """Test if CenterTextAction works properly with changes to resolution""" + window.core.insertComponent(0, window.core.moduleIndexFor("Title Text"), window) + comp = window.core.selectedComponents[0] + comp.page.spinBox_xTextAlign.setValue(450) + window.updateResolution(1) + firstNumber = comp.xPosition + comp.addCenterAction() + centeredX = comp.xPosition + comp.page.spinBox_xTextAlign.setValue(333) + window.undoStack.undo() + assert comp.xPosition == centeredX + # undo centering + window.undoStack.undo() + assert comp.xPosition == firstNumber + # undo change of resolution + window.undoStack.undo() + assert comp.xPosition == 450 + + +def test_comp_text_undo_previewClick_through_resolution_change_mutates_positions( + window, qtbot +): + """Test if PreviewClickAction works properly with changes to resolution""" + window.core.insertComponent(0, window.core.moduleIndexFor("Title Text"), window) + comp = window.core.selectedComponents[0] + comp.page.spinBox_xTextAlign.setValue(450) + window.updateResolution(1) + comp.previewClickEvent((192, 108), (1920, 1080), QtCore.Qt.MouseButton.LeftButton) + comp.page.spinBox_xTextAlign.setValue(333) + window.undoStack.undo() + window.undoStack.undo() + window.undoStack.undo() + assert comp.xPosition == 450 diff --git a/tests/test_mainwindow_comp_actions.py b/tests/test_mainwindow_comp_actions.py index a176c31..a260fe9 100644 --- a/tests/test_mainwindow_comp_actions.py +++ b/tests/test_mainwindow_comp_actions.py @@ -8,6 +8,17 @@ from . import getTestDataPath, window +def test_undo_stack_size_after_3_trackedWidgetUpdates(window, qtbot): + window.core.insertComponent( + 0, window.core.moduleIndexFor("Classic Visualizer"), window + ) + comp = window.core.selectedComponents[0] + comp.page.spinBox_scale.setValue(99) + comp.page.spinBox_y.setValue(100) + comp.page.spinBox_scale.setValue(50) + assert window.undoStack.count() == 3 + + def test_undo_classic_visualizer_sensitivity(window, qtbot): """Undo Classic Visualizer component sensitivity setting should undo multiple merged actions.""" From a89e7c9a54399ea5c23521d25fecffd69df73756 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 18 Jun 2026 15:27:48 -0400 Subject: [PATCH 45/67] change absolute imports to relative consistent with the rest of the codebase --- src/avp/__main__.py | 3 ++- src/avp/cli.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/avp/__main__.py b/src/avp/__main__.py index a27bb88..124b82c 100644 --- a/src/avp/__main__.py +++ b/src/avp/__main__.py @@ -1,5 +1,6 @@ import sys -from avp.cli import main +from .cli import main + if __name__ == "__main__": if sys.argv[0].endswith("-script.pyw"): sys.argv[0] = sys.argv[0][:-11] diff --git a/src/avp/cli.py b/src/avp/cli.py index 44dacbb..ebb795d 100644 --- a/src/avp/cli.py +++ b/src/avp/cli.py @@ -56,7 +56,7 @@ def main() -> int: # Both branches here may occur in one execution: # Commandline parsing could change mode back to GUI if mode == "GUI": - from avp.gui.mainwindow import MainWindow + from .gui.mainwindow import MainWindow main = MainWindow(proj, dpi) log.debug("Finished creating MainWindow") From 87a01dce86d9adeb31c6a4bee21b6e54673f447e Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 18 Jun 2026 15:32:12 -0400 Subject: [PATCH 46/67] improve log messages --- src/avp/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/avp/core.py b/src/avp/core.py index 762cc6e..80e4b17 100644 --- a/src/avp/core.py +++ b/src/avp/core.py @@ -99,7 +99,11 @@ def insertComponent(self, compPos, component, loader): component = self.createComponent(moduleIndex, loader) else: moduleIndex = -1 - log.debug("Inserting previously-created %s component", component.name) + log.debug( + "Inserting previously-created %s component at %s", + component.name, + compPos, + ) component.compPos = compPos component._error.connect(loader.videoThreadError) @@ -128,7 +132,7 @@ def clearComponents(self): def updateComponent(self, i): log.debug("Auto-updating %s #%s", self.selectedComponents[i], str(i)) - self.selectedComponents[i].update(auto=True) + self.selectedComponents[i].update(auto=True, origin="core") def moduleIndexFor(self, compName): index = None From 6eb4205a26bc8cdc28b4aaed75ca9086e64a0934 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 18 Jun 2026 15:35:02 -0400 Subject: [PATCH 47/67] move shared code from Image & Text comps into libcomponent.actions --- src/avp/components/image.py | 74 ++++++--------------------- src/avp/components/text.py | 60 ++-------------------- src/avp/libcomponent/actions.py | 57 ++++++++++++++++++++- tests/test_comp_text.py | 38 -------------- tests/test_mainwindow_comp_actions.py | 66 +++++++++++++++++++++++- 5 files changed, 139 insertions(+), 156 deletions(-) diff --git a/src/avp/components/image.py b/src/avp/components/image.py index 79d2416..ac27e8c 100644 --- a/src/avp/components/image.py +++ b/src/avp/components/image.py @@ -1,9 +1,10 @@ from PIL import Image, ImageOps, ImageEnhance from PyQt6 import QtWidgets, QtCore import os +import math from ..libcomponent import BaseComponent -from ..libcomponent.actions import ComponentPreviewClick, ComponentSettingsUpdate +from ..libcomponent.actions import ComponentCenterXYAction, ComponentPreviewXYClick from ..toolkit import hasUndoStack, blockSignals from ..toolkit.frame import BlankFrame, addShadow from ..toolkit.visualizer import createSpectrumArray @@ -87,14 +88,23 @@ def previewClickEvent(self, pos, size, button): or button != QtCore.Qt.MouseButton.LeftButton ): return - action = ClickPreviewAction(self, pos, size, button) + xSize = math.floor( + self.pixelValForAttr(None, self.imageSize[0] / self.width, axis=size[0]) / 2 + ) + ySize = math.floor( + self.pixelValForAttr(None, self.imageSize[1] / self.height, axis=size[1]) + / 2 + ) + action = ComponentPreviewXYClick( + self, (pos[0] - xSize, pos[1] - ySize), size, button + ) self.loader.undoStack.push(action) def addCenterAction(self): """Triggered when user clicks "center image" button.""" if not hasUndoStack(self.loader) or self.imageSize == (0, 0): return - action = CenterImageAction(self) + action = ComponentCenterXYAction(self) self.loader.undoStack.push(action) def centerXY(self): @@ -184,6 +194,8 @@ def drawFrame(self, width, height, dynamicScale): (newWidth, newHeight), Image.Resampling.LANCZOS ) self.existingImage = image + if self.rotate != 0: + image = image.rotate(self.rotate) self.imageSize = (image.width, image.height) # Shadow-related variables (modified below if "respond to audio") @@ -216,8 +228,6 @@ def drawFrame(self, width, height, dynamicScale): self.yPosition - (0 if not self.respondToAudio else int(scale / 2)), ), ) - if self.rotate != 0: - frame = frame.rotate(self.rotate) if self.shadow: frame = addShadow(frame, shadBlur, shadX, shadY) else: @@ -262,57 +272,3 @@ def fail(): def commandHelp(self): print("Load an image:\n path=/filepath/to/image.png") - - -class ClickPreviewAction(ComponentPreviewClick): - def __init__(self, *args): - super().__init__(*args) - self.res = (self.comp.width, self.comp.height) - self.oldXY = ( - self.comp.floatValForAttr("xPosition", axis=self.res), - self.comp.floatValForAttr("yPosition", axis=self.res), - ) - - def add(self): - for pos in self.pos[:]: - with blockSignals(self.comp): - self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) - self.comp.setRelativeWidget("yPosition", pos[1] / self.size[1]) - - def remove(self): - self.comp.setWidgetValues( - { - "xPosition": self.comp.pixelValForAttr( - "xPosition", self.oldXY[0], self.res - ), - "yPosition": self.comp.pixelValForAttr( - "yPosition", self.oldXY[1], self.res - ), - } - ) - self.comp.update(auto=True, origin="ClickPreviewAction") - - -class CenterImageAction(ComponentSettingsUpdate): - def __init__(self, comp): - super().__init__(comp) - self.oldXY = ( - self.comp.floatValForAttr("xPosition", axis=self.res), - self.comp.floatValForAttr("yPosition", axis=self.res), - ) - - def redo(self): - self.comp.centerXY() - - def undo(self): - self.comp.setWidgetValues( - { - "xPosition": self.comp.pixelValForAttr( - "xPosition", self.oldXY[0], self.res - ), - "yPosition": self.comp.pixelValForAttr( - "yPosition", self.oldXY[1], self.res - ), - } - ) - self.comp.update(auto=True, origin="CenterImageAction") diff --git a/src/avp/components/text.py b/src/avp/components/text.py index 3283770..2e51adf 100644 --- a/src/avp/components/text.py +++ b/src/avp/components/text.py @@ -3,7 +3,7 @@ import logging from ..libcomponent import BaseComponent -from ..libcomponent.actions import ComponentPreviewClick, ComponentSettingsUpdate +from ..libcomponent.actions import ComponentCenterXYAction, ComponentPreviewXYClick from ..toolkit import hasUndoStack, blockSignals from ..toolkit.frame import FramePainter, addShadow @@ -88,14 +88,14 @@ def previewClickEvent(self, pos, size, button): return if button != QtCore.Qt.MouseButton.LeftButton: return - action = ClickPreviewAction(self, pos, size, button) + action = ComponentPreviewXYClick(self, pos, size, button) self.loader.undoStack.push(action) def addCenterAction(self): """Triggered when user clicks "center text" button.""" if not hasUndoStack(self.loader): return - action = CenterTextAction(self) + action = ComponentCenterXYAction(self) self.loader.undoStack.push(action) def centerXY(self): @@ -226,57 +226,3 @@ def command(self, arg): self.page.lineEdit_title.setText(arg) return super().command(arg) - - -class ClickPreviewAction(ComponentPreviewClick): - def __init__(self, *args): - super().__init__(*args) - self.res = (self.comp.width, self.comp.height) - self.oldXY = ( - self.comp.floatValForAttr("xPosition", axis=self.res), - self.comp.floatValForAttr("yPosition", axis=self.res), - ) - - def add(self): - for pos in self.pos[:]: - with blockSignals(self.comp): - self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) - self.comp.setRelativeWidget("yPosition", pos[1] / self.size[1]) - - def remove(self): - self.comp.setWidgetValues( - { - "xPosition": self.comp.pixelValForAttr( - "xPosition", self.oldXY[0], self.res - ), - "yPosition": self.comp.pixelValForAttr( - "yPosition", self.oldXY[1], self.res - ), - } - ) - self.comp.update(auto=True, origin="ClickPreviewAction") - - -class CenterTextAction(ComponentSettingsUpdate): - def __init__(self, comp): - super().__init__(comp) - self.oldXY = ( - self.comp.floatValForAttr("xPosition", axis=self.res), - self.comp.floatValForAttr("yPosition", axis=self.res), - ) - - def redo(self): - self.comp.centerXY() - - def undo(self): - self.comp.setWidgetValues( - { - "xPosition": self.comp.pixelValForAttr( - "xPosition", self.oldXY[0], self.res - ), - "yPosition": self.comp.pixelValForAttr( - "yPosition", self.oldXY[1], self.res - ), - } - ) - self.comp.update(auto=True, origin="CenterTextAction") diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index b5b4b47..d05ca76 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -7,7 +7,7 @@ from copy import copy import logging -from ..toolkit.common import logWidgetValues +from ..toolkit.common import blockSignals log = logging.getLogger(__name__) @@ -140,3 +140,58 @@ def mergeWith(self): def redo(self): ... def undo(self): ... + + +class ComponentPreviewXYClick(ComponentPreviewClick): + def __init__(self, *args): + super().__init__(*args) + self.res = (self.comp.width, self.comp.height) + self.oldXY = ( + self.comp.floatValForAttr("xPosition", axis=self.res), + self.comp.floatValForAttr("yPosition", axis=self.res), + ) + + def add(self): + for pos in self.pos[:]: + with blockSignals(self.comp): + self.comp.setRelativeWidget("xPosition", pos[0] / self.size[0]) + self.comp.setRelativeWidget("yPosition", pos[1] / self.size[1]) + self.comp.update(auto=True, origin="ClickPreviewAction") + + def remove(self): + self.comp.setWidgetValues( + { + "xPosition": self.comp.pixelValForAttr( + "xPosition", self.oldXY[0], self.res + ), + "yPosition": self.comp.pixelValForAttr( + "yPosition", self.oldXY[1], self.res + ), + } + ) + self.comp.update(auto=True, origin="ClickPreviewXYAction") + + +class ComponentCenterXYAction(ComponentSettingsUpdate): + def __init__(self, comp): + super().__init__(comp) + self.oldXY = ( + self.comp.floatValForAttr("xPosition", axis=self.res), + self.comp.floatValForAttr("yPosition", axis=self.res), + ) + + def redo(self): + self.comp.centerXY() + + def undo(self): + self.comp.setWidgetValues( + { + "xPosition": self.comp.pixelValForAttr( + "xPosition", self.oldXY[0], self.res + ), + "yPosition": self.comp.pixelValForAttr( + "yPosition", self.oldXY[1], self.res + ), + } + ) + self.comp.update(auto=True, origin="ComponentCenterXYAction") diff --git a/tests/test_comp_text.py b/tests/test_comp_text.py index 50aa78f..ea6f021 100644 --- a/tests/test_comp_text.py +++ b/tests/test_comp_text.py @@ -117,41 +117,3 @@ def test_comp_text_fontSize_maximum(windowWithTextComp): # set resolution to 854x480 windowWithTextComp.updateResolution(2) assert comp.page.spinBox_fontSize.maximum() == 222 - - -def test_comp_text_undo_center_through_resolution_change_mutates_positions( - window, qtbot -): - """Test if CenterTextAction works properly with changes to resolution""" - window.core.insertComponent(0, window.core.moduleIndexFor("Title Text"), window) - comp = window.core.selectedComponents[0] - comp.page.spinBox_xTextAlign.setValue(450) - window.updateResolution(1) - firstNumber = comp.xPosition - comp.addCenterAction() - centeredX = comp.xPosition - comp.page.spinBox_xTextAlign.setValue(333) - window.undoStack.undo() - assert comp.xPosition == centeredX - # undo centering - window.undoStack.undo() - assert comp.xPosition == firstNumber - # undo change of resolution - window.undoStack.undo() - assert comp.xPosition == 450 - - -def test_comp_text_undo_previewClick_through_resolution_change_mutates_positions( - window, qtbot -): - """Test if PreviewClickAction works properly with changes to resolution""" - window.core.insertComponent(0, window.core.moduleIndexFor("Title Text"), window) - comp = window.core.selectedComponents[0] - comp.page.spinBox_xTextAlign.setValue(450) - window.updateResolution(1) - comp.previewClickEvent((192, 108), (1920, 1080), QtCore.Qt.MouseButton.LeftButton) - comp.page.spinBox_xTextAlign.setValue(333) - window.undoStack.undo() - window.undoStack.undo() - window.undoStack.undo() - assert comp.xPosition == 450 diff --git a/tests/test_mainwindow_comp_actions.py b/tests/test_mainwindow_comp_actions.py index a260fe9..9a4231c 100644 --- a/tests/test_mainwindow_comp_actions.py +++ b/tests/test_mainwindow_comp_actions.py @@ -2,7 +2,9 @@ Tests of MainWindow undoing certain ComponentTrackedWidgetUpdates """ -from pytest import fixture +from PyQt6 import QtCore +from avp.toolkit.common import isVerticalWord +from pytest import fixture, mark from pytestqt import qtbot from avp.gui.mainwindow import MainWindow from . import getTestDataPath, window @@ -89,3 +91,65 @@ def test_undo_randomColor_is_saved(window, qtbot): comp = window.core.selectedComponents[0] assert comp.page.lineEdit_color1.text() == randomText assert comp.color1 == randomTuple + + +@mark.parametrize("compName", ("Title Text", "Image")) +def test_comp_undo_centerXYAction_through_resolution_change(window, qtbot, compName): + """Test if CenterTextAction works properly with changes to resolution""" + window.core.insertComponent(0, window.core.moduleIndexFor(compName), window) + comp = window.core.selectedComponents[0] + if compName == "Image": + comp.imageSize = (1, 1) + widget = comp._trackedWidgets["xPosition"] + widget.setValue(450) + window.updateResolution(1) + resizedX = comp.xPosition + comp.addCenterAction() + centeredX = comp.xPosition + widget.setValue(333) + window.undoStack.undo() + assert comp.xPosition == centeredX + # undo centering + window.undoStack.undo() + assert comp.xPosition == resizedX + # undo change of resolution + window.undoStack.undo() + assert comp.xPosition == 450 + + +@mark.parametrize("compName", ("Title Text", "Image")) +@mark.parametrize("attr", ("xPosition", "yPosition")) +def test_comp_undo_previewXYClick_through_resolution_change( + window, qtbot, compName, attr +): + """Test if PreviewClickAction works properly with changes to resolution""" + window.core.insertComponent(0, window.core.moduleIndexFor(compName), window) + comp = window.core.selectedComponents[0] + widget = comp._trackedWidgets[attr] + valueAt1080 = 450 + + # value from which x, y would be offset (for components not anchored at x, y) + offset = (100, 100) + if compName == "Image": + comp.imageSize = offset + useOffset = compName in ("Image") + + # Set widget value at 1920x1080 + widget.setValue(valueAt1080) + # Change resolution to 1280x720 + window.updateResolution(1) + # Remember resized widget value + valueAt720 = getattr(comp, attr) + # Send previewClickEvent at 1/10th of resolution + comp.previewClickEvent((128, 72), (1280, 720), QtCore.Qt.MouseButton.LeftButton) + assert getattr(comp, attr) == (72 if isVerticalWord(attr) else 128) - ( + (int(offset[1 if isVerticalWord(attr) else 0] / 2) if useOffset else 0) + ) + + # Undo previewClickEvent + window.undoStack.undo() + assert getattr(comp, attr) == valueAt720 + + # Undo resolution change, returning to 1920x1080 + window.undoStack.undo() + assert getattr(comp, attr) == valueAt1080 From 7c6a8cedd9ebf89392b751706e527814681bda01 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 18 Jun 2026 23:29:10 -0400 Subject: [PATCH 48/67] test renaming presets --- tests/test_presetmanager.py | 51 +++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/tests/test_presetmanager.py b/tests/test_presetmanager.py index c0fd770..b457a21 100644 --- a/tests/test_presetmanager.py +++ b/tests/test_presetmanager.py @@ -1,21 +1,33 @@ +import os +import shutil from pytest import fixture from pytestqt import qtbot from avp.gui.presetmanager import PresetManager +from avp.gui.actions import RenamePreset from . import getTestDataPath, window @fixture def presetmanager(window, qtbot): - pm = PresetManager(window) - # ensure presetDir contains test data - # this is needed when settings are stored in /tmp - pm.presetDir = getTestDataPath("config/presets") - pm.findPresets() - qtbot.addWidget(pm) - yield pm + window.core.insertComponent( + 0, window.core.moduleIndexFor("Classic Visualizer"), window + ) + comp = window.core.selectedComponents[0] + saveValueStore = comp.savePreset() + saveValueStore["preset"] = "testPreset" + window.core.createPresetFile(comp.name, comp.version, "testPreset", saveValueStore) + window.presetDir = os.path.join( + os.path.basename(window.core.settings.value("projectDir")), "presets" + ) + window.presetManager.findPresets() + qtbot.addWidget(window.presetManager) + yield window.presetManager -def test_presetmanager_list(presetmanager): +def test_presetmanager_list(presetmanager, qtbot): + # Must use findPresets() because the preset provided by our setup function + # wasn't created using the presetmanager's createNewPreset method + presetmanager.findPresets() assert presetmanager.presets == { "Classic Visualizer": [ ( @@ -24,3 +36,26 @@ def test_presetmanager_list(presetmanager): ), ], } + + +def test_presetmanager_rename_preset(presetmanager, qtbot): + vers = presetmanager.presets["Classic Visualizer"][0][0] + path = os.path.join(presetmanager.presetDir, "Classic Visualizer", str(vers)) + try: + presetmanager.renamePreset(path, "testPreset", "testPresetNew") + assert presetmanager.presets["Classic Visualizer"][0][1] == "testPresetNew" + finally: + os.remove(os.path.join(path, "testPresetNew")) + + +def test_presetmanager_undo_redo_rename_preset(presetmanager, qtbot): + vers = presetmanager.presets["Classic Visualizer"][0][0] + path = os.path.join(presetmanager.presetDir, "Classic Visualizer", str(vers)) + action = RenamePreset(presetmanager, path, "testPreset", "testPresetNew") + presetmanager.parent.undoStack.push(action) + assert presetmanager.presets["Classic Visualizer"][0][1] == "testPresetNew" + presetmanager.parent.undoStack.undo() + assert presetmanager.presets["Classic Visualizer"][0][1] == "testPreset" + presetmanager.parent.undoStack.redo() + assert presetmanager.presets["Classic Visualizer"][0][1] == "testPresetNew" + presetmanager.parent.undoStack.undo() From 4cc13d5772714792aaf3c813ea62334577d5cace Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 18 Jun 2026 23:48:00 -0400 Subject: [PATCH 49/67] merge resolution changes together in undoStack also change how the MainWindow updates resolution to avoid resolution-change spam --- src/avp/gui/actions.py | 18 +++++++++++++++++- src/avp/gui/mainwindow.py | 16 +++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/avp/gui/actions.py b/src/avp/gui/actions.py index 4af7837..380fa6e 100644 --- a/src/avp/gui/actions.py +++ b/src/avp/gui/actions.py @@ -20,6 +20,8 @@ class ChangeResolution(QUndoCommand): + id_ = sum([ord(letter) for letter in "updateResolution"]) + def __init__(self, window, oldResolutionIndex, newResolutionIndex): super().__init__( "change resolution to %s" @@ -35,15 +37,29 @@ def updateResolution(self, resolution, index): log.debug("Updating resolution to %sx%s" % resolution) self.window.settings.setValue("outputWidth", resolution[0]) self.window.settings.setValue("outputHeight", resolution[1]) + self.window.previewWorker.newBackground() with blockSignals( [self.window.comboBox_resolution, *self.window.core.selectedComponents] ): self.window.comboBox_resolution.setCurrentIndex(index) for i in range(len(self.window.core.selectedComponents)): self.window.core.selectedComponents[i].updateResolution() - self.window.previewWorker.newBackground() self.window.drawPreview() + def id(self): + return self.id_ + + def mergeWith(self, other): + if self.oldResolutionIndex == other.newResolutionIndex: + self.setObsolete(True) + self.newResolution = other.newResolution + self.newResolutionIndex = other.newResolutionIndex + self.setText( + "change resolution to %s" + % self.window.comboBox_resolution.itemText(self.newResolutionIndex) + ) + return True + def redo(self): self.updateResolution(self.newResolution, self.newResolutionIndex) diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index 6038b08..cf1030b 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -49,8 +49,9 @@ class MainWindow(QtWidgets.QMainWindow): newTask = QtCore.pyqtSignal(list) # for the preview window processTask = QtCore.pyqtSignal() - def __init__(self, project, dpi): + def __init__(self, project, dpi, testMode=False): super().__init__() + self.testMode = testMode uic.loadUi(os.path.join(Core.wd, "gui", "mainwindow.ui"), self) log.info("Pillow version %s", Image.__version__) log.info( @@ -256,7 +257,7 @@ def setupEncoderSettingsTab(): currentRes = i self.comboBox_resolution.setCurrentIndex(currentRes) self.comboBox_resolution.currentIndexChanged.connect( - self.drawPreview + self.updateResolution ) def setupComponentListWidgets(): @@ -346,6 +347,7 @@ def setupProjectsMenu(): self.autosaveTimes = [] self.autosaveCooldown = 0.2 self.encoding = False + self.updatingResolution = False # Find settings created by Core object self.dataDir = Core.dataDir @@ -370,6 +372,7 @@ def setupProjectsMenu(): int(self.width() * (dpi / 144)), int(self.height() * (dpi / 144)), ) + self.show() # Load project and prompt user to restore unsaved changes if project and project != self.autosavePath: @@ -450,9 +453,6 @@ def setupProjectsMenu(): self.timer.timeout.connect(self.processTask.emit) self.timer.start(500) - # Show the window! - self.show() - def __repr__(self): return ( "%s\n" @@ -789,6 +789,8 @@ def progressBarSetText(self, value): print(f"\r{value}", end="") def updateResolution(self, resIndex=None): + if self.updatingResolution: + return if resIndex is None: resIndex = int(self.comboBox_resolution.currentIndex()) elif resIndex not in tuple(range(len(self.core.resolutions))): @@ -799,8 +801,11 @@ def updateResolution(self, resIndex=None): oldResIndex = Core.resolutions.index("%sx%s" % (w, h)) if oldResIndex == resIndex: return + self.updatingResolution = True action = ChangeResolution(self, oldResIndex, resIndex) self.undoStack.push(action) + if self.testMode: + self.updatingResolution = False def drawPreview(self, force=False, **kwargs): """Use autosave keyword arg to force saving or not saving if needed""" @@ -815,6 +820,7 @@ def drawPreview(self, force=False, **kwargs): @QtCore.pyqtSlot("QImage") def showPreviewImage(self, image): self.previewWindow.changePixmap(image) + self.updatingResolution = False @disableWhenEncoding def showUndoStack(self): From 57e4b8a424f8237abfc9a93d0c3dc2e57d88f7ae Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 18 Jun 2026 23:49:20 -0400 Subject: [PATCH 50/67] Video component: reuse preview frames in same manner as Spectrum comp --- src/avp/components/video.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/avp/components/video.py b/src/avp/components/video.py index bb41bf8..7500f0c 100644 --- a/src/avp/components/video.py +++ b/src/avp/components/video.py @@ -5,6 +5,7 @@ import logging from ..libcomponent import BaseComponent +from ..toolkit import connectWidget from ..toolkit.frame import BlankFrame, scale from ..toolkit.ffmpeg import openPipe, closePipe, testAudioStream, FfmpegVideo @@ -22,6 +23,9 @@ def widget(self, *args): self.x = 0 self.y = 0 self.loopVideo = False + self.chunkSize = 4 * self.width * self.height + self.previewFrame = None + self.changedOptions = True super().widget(*args) self._image = BlankFrame(self.width, self.height) self.page.pushButton_video.clicked.connect(self.pickVideo) @@ -47,6 +51,11 @@ def widget(self, *args): "yPosition", ], ) + for widget in self._trackedWidgets.values(): + connectWidget(widget, lambda: self.changed()) + + def changed(self): + self.changedOptions = True def update(self): if self.page.checkBox_useAudio.isChecked(): @@ -57,12 +66,21 @@ def update(self): self.page.spinBox_volume.setEnabled(False) def previewRender(self): - self.updateChunksize() + changedSize = self.updateChunksize() + if ( + not changedSize + and not self.changedOptions + and self.previewFrame is not None + ): + log.debug("Video #%s is reusing old preview frame" % self.compPos) + return self.previewFrame + frame = self.getPreviewFrame(self.width, self.height) if not frame: return BlankFrame(self.width, self.height) - else: - return frame + self.previewFrame = frame + self.changedOptions = False + return frame def properties(self): props = [] @@ -118,7 +136,7 @@ def frameRender(self, frameNo): return self.finalizeFrame(self.video.frame(frameNo)) def postFrameRender(self): - closePipe(self.video.pipe) + self.video.stop() def pickVideo(self): imgDir = self.core.settings.value("componentDir", os.path.expanduser("~")) @@ -203,7 +221,9 @@ def updateChunksize(self): width, height = scale(self.scale, self.width, self.height, int) else: width, height = self.width, self.height + oldChunkSize = int(self.chunkSize) self.chunkSize = 4 * width * height + return self.chunkSize != oldChunkSize def command(self, arg): if "=" in arg: From 692548106f4c38a3291b4bd924a96c542e169c50 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 18 Jun 2026 23:51:04 -0400 Subject: [PATCH 51/67] add stop method to FfmpegVideo --- src/avp/components/spectrum.py | 2 +- src/avp/components/waveform.py | 2 +- src/avp/toolkit/ffmpeg.py | 21 ++++++++++++--------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/avp/components/spectrum.py b/src/avp/components/spectrum.py index d361a69..a68e480 100644 --- a/src/avp/components/spectrum.py +++ b/src/avp/components/spectrum.py @@ -122,7 +122,7 @@ def frameRender(self, frameNo): return self.finalizeFrame(self.video.frame(frameNo)) def postFrameRender(self): - closePipe(self.video.pipe) + self.video.stop() def getPreviewFrame(self): genericPreview = self.core.settings.value("pref_genericPreview") diff --git a/src/avp/components/waveform.py b/src/avp/components/waveform.py index 1873f1d..397e435 100644 --- a/src/avp/components/waveform.py +++ b/src/avp/components/waveform.py @@ -148,7 +148,7 @@ def frameRender(self, frameNo): return Image.alpha_composite(self._currImage, baseImage) def postFrameRender(self): - closePipe(self.video.pipe) + self.video.stop() def getPreviewFrame(self, width, height): genericPreview = self.core.settings.value("pref_genericPreview") diff --git a/src/avp/toolkit/ffmpeg.py b/src/avp/toolkit/ffmpeg.py index 6f93393..62ca13b 100644 --- a/src/avp/toolkit/ffmpeg.py +++ b/src/avp/toolkit/ffmpeg.py @@ -8,7 +8,7 @@ import subprocess import threading import signal -from queue import PriorityQueue +from queue import PriorityQueue, Empty import logging from ..core import Core @@ -88,14 +88,16 @@ def __init__(self, **kwargs): self.thread.start() def frame(self, num): - while True: + while not self.parent.canceled: if num in self.finishedFrames: image = self.finishedFrames.pop(num) return image - - i, image = self.frameBuffer.get() - self.finishedFrames[i] = image - self.frameBuffer.task_done() + try: + i, image = self.frameBuffer.get(block=False) + self.finishedFrames[i] = image + self.frameBuffer.task_done() + except Empty: + continue def fillBuffer(self): from ..libcomponent import ComponentError @@ -124,9 +126,7 @@ def fillBuffer(self): bufsize=10**8, ) - while True: - if self.parent.canceled: - break + while not self.parent.canceled: self.frameNo += 1 # If we run out of frames, use the last good frame and loop. @@ -157,6 +157,9 @@ def fillBuffer(self): self.frameBuffer.put((self.frameNo, self.currentFrame)) self.lastFrame = self.currentFrame + def stop(self): + closePipe(self.pipe) + @pipeWrapper def openPipe(commandList, **kwargs): From e4186cfc013b6e5fbe9e50ac03d986adcb04388d Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 18 Jun 2026 23:57:45 -0400 Subject: [PATCH 52/67] fix rotate --- src/avp/components/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/avp/components/image.py b/src/avp/components/image.py index ac27e8c..7a2a021 100644 --- a/src/avp/components/image.py +++ b/src/avp/components/image.py @@ -193,9 +193,9 @@ def drawFrame(self, width, height, dynamicScale): image = image.resize( (newWidth, newHeight), Image.Resampling.LANCZOS ) - self.existingImage = image if self.rotate != 0: image = image.rotate(self.rotate) + self.existingImage = image self.imageSize = (image.width, image.height) # Shadow-related variables (modified below if "respond to audio") From d5f24c2f3f5c9262d862575f4195ef1c44ee8adf Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Fri, 19 Jun 2026 00:01:54 -0400 Subject: [PATCH 53/67] rename Component to BaseComponent fix some relativeWidgets issues and add some tests --- src/avp/libcomponent/__init__.py | 2 +- src/avp/libcomponent/component.py | 71 +++++++++++++++++++------------ src/avp/toolkit/common.py | 2 + tests/__init__.py | 2 +- tests/test_libcomponent.py | 60 ++++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 29 deletions(-) create mode 100644 tests/test_libcomponent.py diff --git a/src/avp/libcomponent/__init__.py b/src/avp/libcomponent/__init__.py index 5b04b45..1fcc37b 100644 --- a/src/avp/libcomponent/__init__.py +++ b/src/avp/libcomponent/__init__.py @@ -1,4 +1,4 @@ -from .component import Component as BaseComponent +from .component import BaseComponent from .exceptions import ComponentError __all__ = [BaseComponent, ComponentError] diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index 4076527..4c668fe 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -29,15 +29,17 @@ log = logging.getLogger(__name__) -class Component(QtCore.QObject, metaclass=ComponentMetaclass): +class BaseComponent(QtCore.QObject, metaclass=ComponentMetaclass): """ The base class for components to inherit. """ - name = "Component" - # ui = 'name_Of_Non_Default_Ui_File' + name = "BaseComponent" - version = "1.0.0" + # if `ui` is undefined, AVP assumes it shares a basename with this .py file + ui = "__template__.ui" + + version = "2.0.0" # The major version (before the first dot) is used to determine # preset compatibility; the rest is ignored so it can be non-numeric. @@ -126,7 +128,10 @@ def frameRender(self, frameNo): return image def postFrameRender(self): - """Occurs once when export completes, after final call to frameRender""" + """ + Occurs once after the final call to frameRender, + for cleaning up when export completes or is cancelled. + """ # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # Properties @@ -174,12 +179,16 @@ def widget(self, loader): to self.update(). Then in a subclass connect special actions (e.g., pushButtons to select a file) and initialize """ + if loader.__class__.__name__ not in ("MainWindow", "Command"): + raise ValueError("`loader` must be a MainWindow or Command object") self.loader = loader - log.debug( - "Creating UI for %s's page widget", - self.__class__.name, - ) - self.page = self.loadUi(self.__class__.ui) + + if not hasattr(self, "page"): + log.debug( + "Creating UI for %s's page widget", + self.__class__.name, + ) + self.page = self.loadUi(self.__class__.ui) # Find all normal widgets which will be connected after subclass method self._allWidgets = { @@ -343,6 +352,8 @@ def _autoUpdate(self, origin=None): attr: getWidgetValue(widget) for attr, widget in self._trackedWidgets.items() } + for attr in self._relativeWidgets: + self.updateRelativeWidgetFloat(attr, newWidgetVals[attr]) self.setAttrs(newWidgetVals) self._sendUpdateSignal() logWidgetValues( @@ -354,7 +365,7 @@ def _autoUpdate(self, origin=None): def updateResolution(self): newWidth = int(self.core.settings.value("outputWidth")) newHeight = int(self.core.settings.value("outputHeight")) - log.info( + log.debug( "Updating relative widget values for %s #%s from %sx%s to %sx%s.", self.name, str(self.compPos), @@ -575,16 +586,19 @@ def pixelValForAttr(self, attr, val=None, axis=None): """ if axis is None: axis = self.core.maxResolution - if isVerticalWord(attr): - try: - axis = axis[1] - except IndexError: - if type(axis) != int: - raise - else: - axis = axis[0] if val is None: + if attr is None: + raise ValueError("`attr` must be a string if `val` is None.") val = self._relativeWidgetFloats[attr] + if type(axis) == tuple: + if isVerticalWord(attr): + try: + axis = axis[1] + except IndexError: + if type(axis) != int: + raise + else: + axis = axis[0] result = math.floor(float(axis) * val) return result @@ -593,19 +607,22 @@ def floatValForAttr(self, attr, val=None, axis=None): if axis is None: axis = self.core.maxResolution if val is None: + if attr is None: + raise ValueError("`attr` must be a string if `val` is None.") val = self._trackedWidgets[attr].value() # Convert pixel value to 1080 if needed convert = False if axis != self.core.maxResolution: convert = True - if isVerticalWord(attr): - try: - axis = axis[1] - except IndexError: - if type(axis) != int: - raise - else: - axis = axis[0] + if type(axis) == tuple: + if isVerticalWord(attr): + try: + axis = axis[1] + except IndexError: + if type(axis) != int: + raise + else: + axis = axis[0] if convert: val = self.pixelValForAttr(attr, val / axis) return ( diff --git a/src/avp/toolkit/common.py b/src/avp/toolkit/common.py index e6dd8e3..c38d74e 100644 --- a/src/avp/toolkit/common.py +++ b/src/avp/toolkit/common.py @@ -227,6 +227,8 @@ def hasUndoStack(loader): def isVerticalWord(word): + if not hasattr(word, "lower"): + return False word = word.lower() vertWords = ["height", "ypos"] return any([vertWord in word for vertWord in vertWords]) or word.endswith("y") diff --git a/tests/__init__.py b/tests/__init__.py index 0dfc5fe..608ff03 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -40,7 +40,7 @@ def window(qtbot): initCore() # patch out any modal dialog that might happen MainWindow.showMessage = lambda self, msg, **kwargs: print(msg) - window = MainWindow(None, None) + window = MainWindow(None, None, True) window.clear() qtbot.addWidget(window) window.settings.setValue("outputWidth", 1920) diff --git a/tests/test_libcomponent.py b/tests/test_libcomponent.py new file mode 100644 index 0000000..fd3a0a7 --- /dev/null +++ b/tests/test_libcomponent.py @@ -0,0 +1,60 @@ +from PyQt6 import QtWidgets +from pytestqt import qtbot +from pytest import fixture +from . import command + +from avp.libcomponent import BaseComponent +from avp.toolkit import connectWidget + + +@fixture +def coreWithBaseComp(qtbot, command): + """ + Fixture providing a Command object with BaseComponent component added. + Adding a BaseComponent component is not usually possible, + because it lives outside the `avp.components` module, + but we force it to work by manually instantiating the object. + This allows us to test BaseComponent methods without using a subclass. + """ + baseComp = BaseComponent(-1, command.core) + baseComp.widget(command) + command.core.insertComponent(0, baseComp, command) + yield command.core + + +def addSpinBox(comp, name): + widget = QtWidgets.QSpinBox() + widget.setObjectName(name) + comp.page.horizontalLayout_2.addWidget(widget) + + # Metaclass normally calls connectWidget after a call to widget() + # For some reason this doesn't work with the BaseComponent + # comp.widget(comp.loader) + connectWidget(widget, comp.update) + return widget + + +def test_libcomponent_basecomp_added(coreWithBaseComp): + """Add BaseComponent to core""" + assert len(coreWithBaseComp.selectedComponents) == 1 + + +def test_libcomponent_addWidget_after_widget_method(coreWithBaseComp): + comp = coreWithBaseComp.selectedComponents[0] + name = "spinBox_testValue" + widget = addSpinBox(comp, name) + comp.trackWidgets({"testValue": widget}) + widget.setValue(50) + assert comp.testValue == 50 + + +def test_libcomponent_relativeWidgetFloats(coreWithBaseComp): + comp = coreWithBaseComp.selectedComponents[0] + name = "spinBox_testValue" + widget = addSpinBox(comp, name) + comp.trackWidgets( + {"testValue": widget}, + relativeWidgets=["testValue"], + ) + widget.setValue(50) + assert comp._relativeWidgetFloats["testValue"] == comp.floatValForAttr("testValue") From c3aabe426a83a6bd2769288735123394f98c40ea Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Wed, 29 Jul 2026 12:24:38 -0400 Subject: [PATCH 54/67] test deletePreset and createPresetFile --- tests/test_presetmanager.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/test_presetmanager.py b/tests/test_presetmanager.py index b457a21..d97f10b 100644 --- a/tests/test_presetmanager.py +++ b/tests/test_presetmanager.py @@ -3,7 +3,7 @@ from pytest import fixture from pytestqt import qtbot from avp.gui.presetmanager import PresetManager -from avp.gui.actions import RenamePreset +from avp.gui.actions import RenamePreset, DeletePreset from . import getTestDataPath, window @@ -24,6 +24,10 @@ def presetmanager(window, qtbot): yield window.presetManager +def test_presetmanager_createPresetFile(presetmanager, qtbot): + assert "Classic Visualizer" in presetmanager.presets + + def test_presetmanager_list(presetmanager, qtbot): # Must use findPresets() because the preset provided by our setup function # wasn't created using the presetmanager's createNewPreset method @@ -59,3 +63,22 @@ def test_presetmanager_undo_redo_rename_preset(presetmanager, qtbot): presetmanager.parent.undoStack.redo() assert presetmanager.presets["Classic Visualizer"][0][1] == "testPresetNew" presetmanager.parent.undoStack.undo() + + +def test_presetmanager_delete_preset(presetmanager, qtbot): + comp = presetmanager.core.selectedComponents[0].name + vers = presetmanager.presets["Classic Visualizer"][0][0] + presetmanager.deletePreset(comp, vers, "testPreset") + assert "Classic Visualizer" not in presetmanager.presets + + +def test_presetmanager_undo_redo_delete_preset(presetmanager, qtbot): + comp = presetmanager.core.selectedComponents[0].name + vers = presetmanager.presets["Classic Visualizer"][0][0] + action = DeletePreset(presetmanager, comp, vers, "testPreset") + presetmanager.parent.undoStack.push(action) + assert "Classic Visualizer" not in presetmanager.presets + presetmanager.parent.undoStack.undo() + assert "Classic Visualizer" in presetmanager.presets + presetmanager.parent.undoStack.redo() + assert "Classic Visualizer" not in presetmanager.presets From 04373237df7a06fd508fc3cd92dbbb9830feffc1 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 3 Sep 2026 11:28:45 -0400 Subject: [PATCH 55/67] resize preview frames using pillow because using ffmpeg for singular frames is slow, and the loss of accuracy is negligible compared to faster response to user input --- src/avp/components/spectrum.py | 48 ++++++++++++++++++++++++++-------- src/avp/components/video.py | 45 ++++++++++++++++++++++++------- 2 files changed, 73 insertions(+), 20 deletions(-) diff --git a/src/avp/components/spectrum.py b/src/avp/components/spectrum.py index a68e480..589deba 100644 --- a/src/avp/components/spectrum.py +++ b/src/avp/components/spectrum.py @@ -1,8 +1,9 @@ -from PIL import Image +from PIL import Image, ImageOps import os import subprocess import logging +from ..core import Core from ..libcomponent import BaseComponent from ..toolkit import connectWidget from ..toolkit.frame import BlankFrame, scale @@ -27,6 +28,7 @@ def widget(self, *args): super().widget(*args) self._image = BlankFrame(self.width, self.height) self.chunkSize = 4 * self.width * self.height + self.previewFrame = {resolution: None for resolution in Core.resolutions} self.changedOptions = True self.previewSize = (214, 120) self.previewPipe = None @@ -66,6 +68,8 @@ def widget(self, *args): def changed(self): self.changedOptions = True + for key in self.previewFrame: + self.previewFrame[key] = None def update(self): filterType = self.page.comboBox_filterType.currentIndex() @@ -80,24 +84,46 @@ def update(self): self.page.checkBox_mono.setEnabled(True) def previewRender(self): + def reusePreviewFrame(): + log.debug("Spectrum #%s is reusing old preview frame", self.compPos) + return self.previewFrame[res] + + self.changedOptions = False + res = f"{self.width}x{self.height}" changedSize = self.updateChunksize() + if changedSize and not self.changedOptions: + if self.previewFrame[res] is not None: + return reusePreviewFrame() + if ( not changedSize and not self.changedOptions - and self.previewFrame is not None + and self.previewFrame[res] is not None ): - log.debug("Spectrum #%s is reusing old preview frame" % self.compPos) - return self.previewFrame + return reusePreviewFrame() + + if self.previewFrame[res] is None: + for frame_ in self.previewFrame.values(): + if frame_ is not None: + self.previewFrame[res] = ImageOps.fit( + frame_, + ( + self.width, + self.height, + ), + Image.Resampling.LANCZOS, + ) + log.debug( + "Spectrum #%s resized an existing preview frame instead of using FFmpeg.", + self.compPos, + ) + return self.previewFrame[res] frame = self.getPreviewFrame() - self.changedOptions = False - if not frame: - log.warning("Spectrum #%s failed to create a preview frame" % self.compPos) - self.previewFrame = None + if frame is None: return BlankFrame(self.width, self.height) - else: - self.previewFrame = frame - return frame + self.previewFrame[res] = frame + return frame def preFrameRender(self, **kwargs): super().preFrameRender(**kwargs) diff --git a/src/avp/components/video.py b/src/avp/components/video.py index 7500f0c..797164f 100644 --- a/src/avp/components/video.py +++ b/src/avp/components/video.py @@ -1,9 +1,10 @@ -from PIL import Image +from PIL import Image, ImageOps from PyQt6 import QtWidgets import os import subprocess import logging +from ..core import Core from ..libcomponent import BaseComponent from ..toolkit import connectWidget from ..toolkit.frame import BlankFrame, scale @@ -24,7 +25,7 @@ def widget(self, *args): self.y = 0 self.loopVideo = False self.chunkSize = 4 * self.width * self.height - self.previewFrame = None + self.previewFrame = {resolution: None for resolution in Core.resolutions} self.changedOptions = True super().widget(*args) self._image = BlankFrame(self.width, self.height) @@ -56,6 +57,8 @@ def widget(self, *args): def changed(self): self.changedOptions = True + for key in self.previewFrame: + self.previewFrame[key] = None def update(self): if self.page.checkBox_useAudio.isChecked(): @@ -66,20 +69,44 @@ def update(self): self.page.spinBox_volume.setEnabled(False) def previewRender(self): + def reusePreviewFrame(): + log.debug("Video #%s is reusing old preview frame", self.compPos) + return self.previewFrame[res] + + self.changedOptions = False + res = f"{self.width}x{self.height}" changedSize = self.updateChunksize() + if changedSize and not self.changedOptions: + if self.previewFrame[res] is not None: + return reusePreviewFrame() + if ( not changedSize and not self.changedOptions - and self.previewFrame is not None + and self.previewFrame[res] is not None ): - log.debug("Video #%s is reusing old preview frame" % self.compPos) - return self.previewFrame + return reusePreviewFrame() + + if self.previewFrame[res] is None: + for frame_ in self.previewFrame.values(): + if frame_ is not None: + self.previewFrame[res] = ImageOps.fit( + frame_, + ( + self.width, + self.height, + ), + Image.Resampling.LANCZOS, + ) + log.debug( + "Video #%s resized an existing preview frame instead of using FFmpeg." + ) + return self.previewFrame[res] frame = self.getPreviewFrame(self.width, self.height) - if not frame: + if frame is None: return BlankFrame(self.width, self.height) - self.previewFrame = frame - self.changedOptions = False + self.previewFrame[res] = frame return frame def properties(self): @@ -184,7 +211,7 @@ def getPreviewFrame(self, width, height): logFilename = os.path.join( self.core.logDir, "preview_%s.log" % str(self.compPos) ) - log.debug("Creating ffmpeg process (log at %s)" % logFilename) + log.debug("Creating ffmpeg process (log at %s)", logFilename) with open(logFilename, "w") as logf: logf.write(" ".join(command) + "\n\n") with open(logFilename, "a") as logf: From 1d922f595416e093c657556b39e6519749b2b50e Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 3 Sep 2026 11:32:43 -0400 Subject: [PATCH 56/67] change hotkeys, remove pillow-simd mention, add pytest-xdist info --- README.md | 29 ++++++++++++++--------------- src/avp/gui/mainwindow.py | 36 +++++++++++++++++++++--------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 8efdf5d..fabec2c 100644 --- a/README.md +++ b/README.md @@ -113,19 +113,20 @@ python3 -m avp | Ctrl+A | Save Project As... | | Ctrl+O | Open Project | | Ctrl+N | New Project (prompts to save current project) | +| F2 | Open Projects Menu | +| F3 | Open Preset Manager | +| F4 | Open Undo History | | Ctrl+Z | Undo | | Ctrl+Shift+Z _or_ Ctrl+Y | Redo | | Ctrl+T _or_ Insert | Add Component | -| Ctrl+R _or_ Delete | Remove Component | +| Ctrl+W _or_ Delete | Remove Component | | Ctrl+Space | Focus Component List | -| Ctrl+Shift+S | Save Component Preset | -| Ctrl+Shift+C | Remove Preset from Component | +| Ctrl+Shift+S | Save Preset for Selected Component | +| Ctrl+Shift+C | Remove Preset from Selected Component | | Ctrl+Up | Move Selected Component Up | | Ctrl+Down | Move Selected Component Down | | Ctrl+Home | Move Selected Component to Top | | Ctrl+End | Move Selected Component to Bottom | -| Ctrl+Shift+U | Open Undo History | -| Ctrl+Shift+F | Show FFmpeg Command | ## Using Commandline Interface @@ -147,24 +148,22 @@ Projects can be created with the GUI then loaded from the commandline for easy a - Pillow 12.1.0 - NumPy 2.4.1 +### Developing a New Component + +- Information for developing a component is in our wiki: [How a Component Works](https://github.com/djfun/audio-visualizer-python/wiki/How-a-Component-Works) +- File an issue on GitHub if you need help fitting your visualizer into our component system; we would be happy to collaborate + ### Running Automatic Tests + Run unit and integration tests with `pytest`. - * First you will need to install with `pip install pytest pytest-qt` * You may omit the slowest test with `pytest -k "not commandline_export"` + * You may use [pytest-xdist](https://pypi.org/project/pytest-xdist/) for speedier test execution ### Installing from TestPyPI + Because some dependencies (namely numpy) are not always on TestPyPI, you must specify when installing that these dependencies should come from the real PyPI. * `pip install -i https://test.pypi.org/simple/ audio-visualizer-python==x.x.x --extra-index-url https://pypi.org/simple numpy` -### Getting Faster Export Times - -- [Pillow-SIMD](https://github.com/uploadcare/pillow-simd) may be used as a drop-in replacement for Pillow if you desire faster video export times, but it must be compiled from source. For help installing dependencies to compile Pillow-SIMD, see the [Pillow installation guide](https://pillow.readthedocs.io/en/stable/installation/building-from-source.html). - -### Developing a New Component - -- Information for developing a component is in our wiki: [How a Component Works](https://github.com/djfun/audio-visualizer-python/wiki/How-a-Component-Works) -- File an issue on GitHub if you need help fitting your visualizer into our component system; we would be happy to collaborate - ## License Source code of audio-visualizer-python is licensed under the MIT license. diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py index cf1030b..c3ca872 100644 --- a/src/avp/gui/mainwindow.py +++ b/src/avp/gui/mainwindow.py @@ -70,21 +70,21 @@ def setupHotkeys(): # Hotkeys for undo/redo QShortcut("Ctrl+Z", self, self.undoStack.undo) - QShortcut("Ctrl+Y", self, self.undoStack.redo) - QShortcut("Ctrl+Shift+Z", self, self.undoStack.redo) + for redoKey in ("Ctrl+Y", "Ctrl+Shift+Z"): + QShortcut(redoKey, self, self.undoStack.redo) + for showUndoStackKey in ("Ctrl+Shift+U", "F4"): + QShortcut(showUndoStackKey, self, self.showUndoStack) # Hotkeys for component list - for inskey in ("Ctrl+T", QtCore.Qt.Key.Key_Insert): - QShortcut(inskey, self, lambda: self.pushButton_addComponent.click()) - for delkey in ("Ctrl+R", QtCore.Qt.Key.Key_Delete): - QShortcut(delkey, self.listWidget_componentList, self.removeComponent) + for insertKey in ("Ctrl+T", QtCore.Qt.Key.Key_Insert): + QShortcut(insertKey, self, lambda: self.pushButton_addComponent.click()) + for deleteKey in ("Ctrl+W", QtCore.Qt.Key.Key_Delete): + QShortcut( + deleteKey, self.listWidget_componentList, self.removeComponent + ) QShortcut( "Ctrl+Space", self, lambda: self.listWidget_componentList.setFocus() ) - QShortcut("Ctrl+Shift+S", self, self.presetManager.openSavePresetDialog) - QShortcut("Ctrl+Shift+C", self, self.presetManager.clearPreset) - QShortcut("F3", self, self.openPresetManager) - QShortcut( "Ctrl+Up", self.listWidget_componentList, @@ -106,11 +106,15 @@ def setupHotkeys(): lambda: self.moveComponent("bottom"), ) + # Hotkeys for preset management in component list + QShortcut("Ctrl+Shift+S", self, self.presetManager.openSavePresetDialog) + for clearPresetKey in ("Ctrl+Shift+C", "Ctrl+Shift+Del"): + QShortcut(clearPresetKey, self, self.presetManager.clearPreset) + QShortcut("F3", self, self.openPresetManager) + + # Debug assistance hotkeys QShortcut("F1", self, self.showHelpWindow) - QShortcut("F4", self, self.showUndoStack) QShortcut("F5", self, self.drawPreview) - QShortcut("Ctrl+Shift+F", self, self.showHelpWindow) - QShortcut("Ctrl+Shift+U", self, self.showUndoStack) def setupMainWindowWidgets(): def setupUndoDialog(): @@ -372,6 +376,7 @@ def setupProjectsMenu(): int(self.width() * (dpi / 144)), int(self.height() * (dpi / 144)), ) + self.setWindowTitle(appName) self.show() # Load project and prompt user to restore unsaved changes @@ -419,7 +424,7 @@ def setupProjectsMenu(): ffmpegGoodVersion, ffmpegVersionNum = checkFfmpegVersion() if not ffmpegGoodVersion: self.showMessage( - msg="The version of FFmpeg ({ffmpegVersionNum}) is " + msg=f"The version of FFmpeg ({ffmpegVersionNum}) is " "not recognized. Some features may not work as expected." ) self.settings.setValue("ffmpegMsgShown", True) @@ -653,6 +658,7 @@ def stopVideo(self): log.info("Export cancelled") self.videoWorker.cancel() self.canceled = True + self.core.stopVideoThread() def createAudioVisualization(self): # create output video if mandatory settings are filled in @@ -696,12 +702,12 @@ def videoThreadError(self, msg, detail): except AttributeError as e: if "videoWorker" not in str(e): raise + log.info("MainWindow state: %s", repr(self)) self.showMessage( msg=msg, detail=detail, icon="Critical", ) - log.info("%s", repr(self)) def changeEncodingStatus(self, status): self.encoding = status From 281faf9e4b2bcbeb343624b404c5b245f9dcd377 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 3 Sep 2026 11:33:12 -0400 Subject: [PATCH 57/67] Commandline mode: set output size after loading components --- src/avp/command.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/avp/command.py b/src/avp/command.py index 22ffe10..73365d1 100644 --- a/src/avp/command.py +++ b/src/avp/command.py @@ -122,11 +122,6 @@ def parseArgs(self): self.createLogFile() quit(0) - if args.size: - w, h = args.size.split("x") - self.core.settings.setValue("outputWidth", w) - self.core.settings.setValue("outputHeight", h) - if args.projpath: projPath = args.projpath if not os.path.dirname(projPath): @@ -159,6 +154,14 @@ def parseArgs(self): for arg in compargs: self.core.selectedComponents[i].command(arg) + if args.size: + print("Setting output size to %s" % args.size) + w, h = args.size.split("x") + self.core.settings.setValue("outputWidth", w) + self.core.settings.setValue("outputHeight", h) + for i in range(len(self.core.selectedComponents)): + self.core.selectedComponents[i].updateResolution() + if args.export_project and args.projpath: errcode, data = self.core.parseAvFile(projPath) input_ = None From 02600f86d5428ab6090b97169f66c1e93980e960 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 3 Sep 2026 11:37:34 -0400 Subject: [PATCH 58/67] better error checking during rendering --- src/avp/gui/preview_thread.py | 14 ++++++++++---- src/avp/video_thread.py | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/avp/gui/preview_thread.py b/src/avp/gui/preview_thread.py index 704b0b6..604faa2 100644 --- a/src/avp/gui/preview_thread.py +++ b/src/avp/gui/preview_thread.py @@ -53,7 +53,7 @@ def process(self): try: self.queue.get(block=False) except Empty: - continue + break timeElapsed = time.time() frame = self.background.copy() components = nextPreviewInformation["components"] @@ -96,9 +96,15 @@ def process(self): self.error.emit(errMsg) break except RuntimeError as e: - log.error(str(e)) + log.critical(str(e)) + self.error.emit(str(e)) + break finally: - component.unlockSize() + try: + component.unlockSize() + except RuntimeError: + log.critical(str(e)) + break else: # We must store a reference to this QImage # or else Qt will garbage-collect it on the C++ side @@ -113,4 +119,4 @@ def process(self): self.imageCreated.emit(QtGui.QImage(self.frame)) except Empty: - True + pass diff --git a/src/avp/video_thread.py b/src/avp/video_thread.py index ed83c9b..a47ad6d 100644 --- a/src/avp/video_thread.py +++ b/src/avp/video_thread.py @@ -146,11 +146,13 @@ def preFrameRender(self): compNo, comp, ) + self.cancel() + canceledByComponent = True + break compProps = comp.properties() if "error" in compProps or comp._lockedError is not None: self.cancel() - self.canceled = True canceledByComponent = True compError = ( comp.error() if type(comp.error()) is tuple else (comp.error(), "") From 08cc8a9ed6bfbb3870f255ab3d5eae3f9440a811 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 3 Sep 2026 11:42:40 -0400 Subject: [PATCH 59/67] relative widgets code cleanup, show tooltips in gui when logging is enabled --- src/avp/libcomponent/component.py | 146 ++++++++++++------------------ 1 file changed, 56 insertions(+), 90 deletions(-) diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index 4c668fe..ba36ed0 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -6,7 +6,6 @@ from PyQt6 import uic, QtCore, QtWidgets from PyQt6.QtGui import QColor import os -import math import logging from copy import copy @@ -53,26 +52,29 @@ def __init__(self, moduleIndex, core): self.core = core self._width = int(core.settings.value("outputWidth")) self._height = int(core.settings.value("outputHeight")) - - # STATUS VARIABLES self.currentPreset = None self._allWidgets = {} self._trackedWidgets = {} self._presetNames = {} self._commandArgs = {} + + # Color widgets link a pushbutton and lineedit together + # for components to get a color choice from the user self._colorWidgets = {} self._colorFuncs = {} + + # Relative widgets are relative to the output size (resolution) self._relativeWidgets = {} - # Maximum values of relativeWidget spinBoxes at 1080p (Core.resolutions[0]) self._relativeWidgetMaximums = {} self._relativeWidgetFloats = {} - # LOCKING VARIABLES + # "Locks" self.openingPreset = False self.mergeUndo = True self._lockedProperties = None self._lockedError = None self._lockedSize = None + # Stop lengthy processes in response to this variable self.canceled = False @@ -276,7 +278,7 @@ def upgradeFromOldVersion(presetDict): self._colorWidgets[attr].setStyleSheet(btnStyle) else: if attr in self._relativeWidgets: - self.updateRelativeWidgetFloat(attr, val) + self._updateRelativeWidgetFloat(attr, val) with blockSignals(widget): setWidgetValue(widget, val) if presetDict["resolution"] != currentResolution: @@ -286,7 +288,7 @@ def upgradeFromOldVersion(presetDict): def savePreset(self): saveValueStore = {} - for attr, widget in self._trackedWidgets.items(): + for attr in self._trackedWidgets: presetAttrName = ( attr if attr not in self._presetNames else self._presetNames[attr] ) @@ -337,11 +339,6 @@ def _userUpdate(self): for attr, val in newWidgetVals.items() if val != oldWidgetVals[attr] } - for attr in copy(modifiedWidgets): - if attr in self._relativeWidgets: - changed = self.updateRelativeWidgetFloat(attr, modifiedWidgets[attr]) - if not changed: - del modifiedWidgets[attr] if modifiedWidgets: action = ComponentTrackedWidgetUpdate(self, oldWidgetVals, modifiedWidgets) self.loader.undoStack.push(action) @@ -353,7 +350,7 @@ def _autoUpdate(self, origin=None): for attr, widget in self._trackedWidgets.items() } for attr in self._relativeWidgets: - self.updateRelativeWidgetFloat(attr, newWidgetVals[attr]) + self._updateRelativeWidgetFloat(attr, newWidgetVals[attr]) self.setAttrs(newWidgetVals) self._sendUpdateSignal() logWidgetValues( @@ -365,17 +362,25 @@ def _autoUpdate(self, origin=None): def updateResolution(self): newWidth = int(self.core.settings.value("outputWidth")) newHeight = int(self.core.settings.value("outputHeight")) + newResolution = (newWidth, newHeight) log.debug( "Updating relative widget values for %s #%s from %sx%s to %sx%s.", self.name, str(self.compPos), self.width, self.height, - newWidth, - newHeight, + *newResolution, ) for attr in self._relativeWidgets: - self.updateRelativeWidgetResolution(attr, (newWidth, newHeight)) + newVal = self.pixelValForAttr( + attr, + self._relativeWidgetFloats[attr], + axis=newResolution, + ) + self._updateRelativeWidgetMaximum(attr, newResolution) + self._updateRelativeWidgetFloat(attr, newVal) + with blockSignals(self._trackedWidgets[attr]): + self._trackedWidgets[attr].setValue(newVal) self._width = newWidth self._height = newHeight self.update(auto=True, origin="updateResolution") @@ -415,7 +420,7 @@ def setWidgetValues(self, attrDict): if attr in self._colorWidgets: val = "%s,%s,%s" % val if attr in self._relativeWidgets: - self.updateRelativeWidgetFloat(attr, val) + self._updateRelativeWidgetFloat(attr, val) setWidgetValue(widget, val) def _sendUpdateSignal(self): @@ -489,19 +494,10 @@ def pickColor_(): self._relativeWidgetMaximums[attr] = self._trackedWidgets[ attr ].maximum() - self.updateRelativeWidgetMaximum(attr, (self.width, self.height)) - self._relativeWidgetFloats[attr] = self.floatValForAttr( - attr, - self._trackedWidgets[attr].value(), - (self.width, self.height), + self._updateRelativeWidgetMaximum(attr, (self.width, self.height)) + self._updateRelativeWidgetFloat( + attr, getWidgetValue(self._trackedWidgets[attr]) ) - if log.isEnabledFor(logging.INFO): - self._trackedWidgets[attr].setToolTip( - "relative value: {0:.3f}".format( - self._relativeWidgetFloats[attr] - ) - ) - # self.update(auto=True, origin="trackWidgets") def pickColor(self, textWidget, button): @@ -577,7 +573,7 @@ def reset(self): self.unlockProperties() self.unlockError() - def pixelValForAttr(self, attr, val=None, axis=None): + def pixelValForAttr(self, attr=None, val=None, axis=None): """ Get pixel value from a relativeWidget float. `attr`: string name of relativeWidget @@ -585,95 +581,65 @@ def pixelValForAttr(self, attr, val=None, axis=None): `axis`: optional tuple of (width, height); height used if attr "seems vertical" """ if axis is None: - axis = self.core.maxResolution + axis = (self.width, self.height) + if type(axis) not in (float, int): + axis = axis[1] if isVerticalWord(attr) else axis[0] if val is None: if attr is None: raise ValueError("`attr` must be a string if `val` is None.") - val = self._relativeWidgetFloats[attr] - if type(axis) == tuple: - if isVerticalWord(attr): - try: - axis = axis[1] - except IndexError: - if type(axis) != int: - raise - else: - axis = axis[0] - result = math.floor(float(axis) * val) - return result + val = self._trackedWidgets[attr].value() / axis + return round(val * axis) - def floatValForAttr(self, attr, val=None, axis=None): - """If axis != core.maxResolution, mutates `val`""" + def floatValForAttr(self, attr=None, val=None, axis=None): + """Return a value from 0.0 to 1.0 using the absolute value divided by maxResolution. + If `axis` is not maxResolution, value will be scaled up (mutated) appropriately. + If `axis` is a tuple, we guess whether to divide by width or height based on attr. + """ if axis is None: - axis = self.core.maxResolution + axis = (self.width, self.height) if val is None: if attr is None: raise ValueError("`attr` must be a string if `val` is None.") val = self._trackedWidgets[attr].value() + # Convert pixel value to 1080 if needed convert = False if axis != self.core.maxResolution: convert = True - if type(axis) == tuple: - if isVerticalWord(attr): - try: - axis = axis[1] - except IndexError: - if type(axis) != int: - raise - else: - axis = axis[0] - if convert: - val = self.pixelValForAttr(attr, val / axis) - return ( - val / self.core.maxResolution[1] + if type(axis) not in (int, float): + axis = axis[1] if isVerticalWord(attr) else axis[0] + + maxis = ( + self.core.maxResolution[1] if isVerticalWord(attr) - else val / self.core.maxResolution[0] + else self.core.maxResolution[0] ) + if convert: + val = (val / axis) * maxis + return val / maxis def setRelativeWidget(self, attr, floatVal, axis=None): """Set a relative widget using a float""" if axis is None: axis = (self.width, self.height) - self._relativeWidgetFloats[attr] = floatVal + self._updateRelativeWidgetFloat(attr, floatVal) pixelVal = self.pixelValForAttr(attr, floatVal, axis) with blockSignals(self._trackedWidgets[attr]): self._trackedWidgets[attr].setValue(pixelVal) - if log.isEnabledFor(logging.INFO): - self._trackedWidgets[attr].setToolTip( - "relative value: {0:.3f}".format(self._relativeWidgetFloats[attr]) - ) self.update(auto=True, origin="setRelativeWidget") - def updateRelativeWidgetResolution(self, attr, newResolution): - """Called for each relativeWidget when resolution changes""" - # val = self._trackedWidgets[attr].value() - newVal = self.pixelValForAttr( - attr, - self._relativeWidgetFloats[attr], - axis=newResolution, - ) - with blockSignals(self._trackedWidgets[attr]): - self.updateRelativeWidgetMaximum(attr, newResolution) - self._trackedWidgets[attr].setValue(newVal) - return newVal - - def updateRelativeWidgetMaximum(self, attr, newResolution): + def _updateRelativeWidgetMaximum(self, attr, newResolution): newMaximumValue = newResolution[0] * ( self._relativeWidgetMaximums[attr] / int(self.core.resolutions[0].split("x")[0]) ) self._trackedWidgets[attr].setMaximum(int(newMaximumValue)) - def updateRelativeWidgetFloat(self, attr, newPixelVal): - newFloatVal = self.floatValForAttr(attr, newPixelVal, (self.width, self.height)) - if self._relativeWidgetFloats[attr] != newFloatVal: - self._relativeWidgetFloats[attr] = self.floatValForAttr( - attr, newPixelVal, (self.width, self.height) + def _updateRelativeWidgetFloat(self, attr, newVal): + if type(newVal) != float: + newVal = self.floatValForAttr(attr, newVal) + self._relativeWidgetFloats[attr] = newVal + if log.isEnabledFor(logging.INFO): + self._trackedWidgets[attr].setToolTip( + "relative value: {0:.3f}".format(newVal) ) - if log.isEnabledFor(logging.INFO): - self._trackedWidgets[attr].setToolTip( - "relative value: {0:.3f}".format(self._relativeWidgetFloats[attr]) - ) - return True - return False From aa459c6a844949e84713330dbdd1641edcfb0982 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 3 Sep 2026 11:43:25 -0400 Subject: [PATCH 60/67] test Spectrum reuses preview frames --- tests/test_comp_spectrum.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_comp_spectrum.py b/tests/test_comp_spectrum.py index 3fddd44..32e4c8f 100644 --- a/tests/test_comp_spectrum.py +++ b/tests/test_comp_spectrum.py @@ -22,8 +22,8 @@ def test_comp_spectrum_previewRender(coreWithSpectrumComp): comp = coreWithSpectrumComp.selectedComponents[0] image = comp.previewRender() - accept_range = 719 # Accept images with ±0.001% difference - expected = 71992628 # This value was extracted on amd64 + accept_range = 719 # Accept images with ±0.001% difference + expected = 71992628 # This value was extracted on amd64 assert imageDataSum(image) == approx(expected, abs=accept_range) @@ -33,3 +33,13 @@ def test_comp_spectrum_renderFrame(coreWithSpectrumComp, audioData): image = comp.frameRender(0) comp.postFrameRender() assert imageDataSum(image) == 117 + + +def test_comp_spectrum_reuses_preview_frame(coreWithSpectrumComp): + comp = coreWithSpectrumComp.selectedComponents[0] + comp.previewRender() + assert comp.previewFrame is not None + assert not comp.changedOptions + oldChunkSize = int(comp.chunkSize) + assert not comp.updateChunksize() + assert oldChunkSize == comp.chunkSize From 891f55b12eac9fa8ad88cafec411b2dcabcd0ca6 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 3 Sep 2026 11:44:31 -0400 Subject: [PATCH 61/67] test Title Text comp uses updated rounded value --- tests/test_comp_text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_comp_text.py b/tests/test_comp_text.py index ea6f021..7075c68 100644 --- a/tests/test_comp_text.py +++ b/tests/test_comp_text.py @@ -96,7 +96,7 @@ def test_comp_text_fontSize_relative_to_resolution(windowWithTextComp): assert comp.fontSize == 133 # set resolution to 854x480 windowWithTextComp.updateResolution(2) - assert comp.fontSize == 88 + assert comp.fontSize == 89 def test_comp_text_fontSize_rounding_errors(windowWithTextComp): From 4fa21efcd1bb9a64a34d5da0926bc8ab96bd0222 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 3 Sep 2026 11:53:51 -0400 Subject: [PATCH 62/67] test resizing (changing output resolution) --- tests/test_libcomponent.py | 26 +++++++++++++++++++++++++- tests/test_mainwindow_comp_actions.py | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/tests/test_libcomponent.py b/tests/test_libcomponent.py index fd3a0a7..4cfd1ab 100644 --- a/tests/test_libcomponent.py +++ b/tests/test_libcomponent.py @@ -57,4 +57,28 @@ def test_libcomponent_relativeWidgetFloats(coreWithBaseComp): relativeWidgets=["testValue"], ) widget.setValue(50) - assert comp._relativeWidgetFloats["testValue"] == comp.floatValForAttr("testValue") + assert comp._relativeWidgetFloats["testValue"] == comp.floatValForAttr( + "testValue", 50 + ) + + +def test_libcomponent_relativeWidget_pixelVal_after_repeated_resizes(coreWithBaseComp): + comp = coreWithBaseComp.selectedComponents[0] + name = "spinBox_testValue" + widget = addSpinBox(comp, name) + comp.trackWidgets( + {"testValue": widget}, + relativeWidgets=["testValue"], + ) + widget.setValue(50) + assert comp.testValue == 50 + coreWithBaseComp.settings.setValue("outputWidth", 1280) + coreWithBaseComp.settings.setValue("outputHeight", 720) + comp.updateResolution() + assert comp.testValue == 33 + assert widget.value() == 33 + coreWithBaseComp.settings.setValue("outputWidth", 1920) + coreWithBaseComp.settings.setValue("outputHeight", 1080) + comp.updateResolution() + assert comp.testValue == 50 + assert widget.value() == 50 diff --git a/tests/test_mainwindow_comp_actions.py b/tests/test_mainwindow_comp_actions.py index 9a4231c..d7d10ba 100644 --- a/tests/test_mainwindow_comp_actions.py +++ b/tests/test_mainwindow_comp_actions.py @@ -153,3 +153,24 @@ def test_comp_undo_previewXYClick_through_resolution_change( # Undo resolution change, returning to 1920x1080 window.undoStack.undo() assert getattr(comp, attr) == valueAt1080 + + +def test_undo_merges_resolution_change(window, qtbot): + """Test if ChangeResolution QUndoCommand objects merge and obsolete themselves cleanly""" + window.core.insertComponent(0, window.core.moduleIndexFor("Image"), window) + comp = window.core.selectedComponents[0] + comp.page.spinBox_scale.setValue(50) + comp.page.spinBox_x.setValue(200) + window.updateResolution(1) + assert window.undoStack.count() == 3 + window.updateResolution(2) + assert window.undoStack.count() == 3 + window.updateResolution(0) + assert window.undoStack.count() == 2 + window.updateResolution(1) + comp.page.spinBox_y.setValue(100) + assert window.undoStack.count() == 4 + window.undoStack.undo() + assert window.undoStack.count() == 4 + window.undoStack.redo() + assert window.undoStack.count() == 4 From 92be176012003ce1435d75cdb30b10e359548301 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 17 Sep 2026 14:16:48 -0400 Subject: [PATCH 63/67] Waveform: fix incorrect frame size when using scale/x/y options with speed < 100 --- src/avp/components/waveform.py | 4 +++- tests/test_comp_waveform.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/avp/components/waveform.py b/src/avp/components/waveform.py index 397e435..ea93f97 100644 --- a/src/avp/components/waveform.py +++ b/src/avp/components/waveform.py @@ -119,7 +119,9 @@ def frameRender(self, frameNo): if frameDiff == 0 or isValidPeak: self._lastUpdatedFrame = frameNo self._fadingImage = self._prevImage - self._prevImage = self._image + self._prevImage = ( + BlankFrame() if self._currImage is None else self._currImage.copy() + ) self._currImage = newFrame usualAlpha = 0.0 + (1 / self.updateInterval) * frameDiff alpha = max( diff --git a/tests/test_comp_waveform.py b/tests/test_comp_waveform.py index d295dbe..44c6dae 100644 --- a/tests/test_comp_waveform.py +++ b/tests/test_comp_waveform.py @@ -37,4 +37,4 @@ def test_comp_waveform_renderFrame(coreWithWaveformComp, audioData): preFrameRender(audioData, comp) image = comp.frameRender(0) comp.postFrameRender() - assert imageDataSum(image) == 8331360 + assert imageDataSum(image) == 8288016 From edf95967363229b9ee397126a4b9a83dea3ac9a3 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 17 Sep 2026 17:02:41 -0400 Subject: [PATCH 64/67] merge undo actions better also includes a hacky fix to resolution changes sometimes causing changes to relativeWidgets to be registered as user actions --- src/avp/libcomponent/actions.py | 16 ++++++---------- src/avp/libcomponent/component.py | 13 ++++++++++++- tests/test_mainwindow_comp_actions.py | 5 +---- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index d05ca76..c320d92 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -33,16 +33,9 @@ def __init__(self, parent, oldWidgetVals, modifiedVals): # Determine if this update is mergeable self.id_ = -1 if self.parent.mergeUndo: - if len(self.modifiedVals) == 1: - attr, val = self.modifiedVals.popitem() - self.id_ = sum([ord(letter) for letter in attr[-14:]]) - self.modifiedVals[attr] = val - return - log.warning( - "%s component settings changed at once. (%s)", - len(self.modifiedVals), - repr(self.modifiedVals), - ) + attr, val = self.modifiedVals.popitem() + self.id_ = sum([ord(letter) for letter in attr[-14:]]) + self.modifiedVals[attr] = val def id(self): """If 2 consecutive updates have same id, Qt will call mergeWith()""" @@ -50,6 +43,9 @@ def id(self): def mergeWith(self, other): self.modifiedVals.update(other.modifiedVals) + for attr, val in self.modifiedVals.items(): + if self.oldWidgetVals[attr] == val: + self.setObsolete(True) return True def do(self, widgetValues): diff --git a/src/avp/libcomponent/component.py b/src/avp/libcomponent/component.py index ba36ed0..a18f22b 100644 --- a/src/avp/libcomponent/component.py +++ b/src/avp/libcomponent/component.py @@ -339,6 +339,18 @@ def _userUpdate(self): for attr, val in newWidgetVals.items() if val != oldWidgetVals[attr] } + if modifiedWidgets: + if len(modifiedWidgets) > 1: + for attr in self._relativeWidgets: + if attr in modifiedWidgets: + del modifiedWidgets[attr] + if len(modifiedWidgets) > 1: + log.warning( + "%s component settings changed at once. (%s)", + len(modifiedWidgets), + repr(modifiedWidgets), + ) + return if modifiedWidgets: action = ComponentTrackedWidgetUpdate(self, oldWidgetVals, modifiedWidgets) self.loader.undoStack.push(action) @@ -378,7 +390,6 @@ def updateResolution(self): axis=newResolution, ) self._updateRelativeWidgetMaximum(attr, newResolution) - self._updateRelativeWidgetFloat(attr, newVal) with blockSignals(self._trackedWidgets[attr]): self._trackedWidgets[attr].setValue(newVal) self._width = newWidth diff --git a/tests/test_mainwindow_comp_actions.py b/tests/test_mainwindow_comp_actions.py index d7d10ba..1b2a9b2 100644 --- a/tests/test_mainwindow_comp_actions.py +++ b/tests/test_mainwindow_comp_actions.py @@ -41,14 +41,11 @@ def test_undo_image_scale(window, qtbot): window.core.insertComponent(0, window.core.moduleIndexFor("Image"), window) comp = window.core.selectedComponents[0] comp.imagePath = getTestDataPath("inputfiles/test.jpg") - comp.page.spinBox_scale.setValue(100) for i in range(10, 401): comp.page.spinBox_scale.setValue(i) assert comp.scale == 400 window.undoStack.undo() assert comp.scale == 10 - window.undoStack.undo() - assert comp.scale == 100 def test_undo_image_resizeMode(window, qtbot): @@ -155,7 +152,7 @@ def test_comp_undo_previewXYClick_through_resolution_change( assert getattr(comp, attr) == valueAt1080 -def test_undo_merges_resolution_change(window, qtbot): +def test_undo_merges_resolution_change_image(window, qtbot): """Test if ChangeResolution QUndoCommand objects merge and obsolete themselves cleanly""" window.core.insertComponent(0, window.core.moduleIndexFor("Image"), window) comp = window.core.selectedComponents[0] From bb1bd21ecf52e3d2cf020f3177267a2ada3feb69 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 17 Sep 2026 17:03:56 -0400 Subject: [PATCH 65/67] more informative names for QUndoCommands --- src/avp/components/life.py | 6 +++++- src/avp/libcomponent/actions.py | 15 +++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/avp/components/life.py b/src/avp/components/life.py index 77084a8..60cf9d3 100644 --- a/src/avp/components/life.py +++ b/src/avp/components/life.py @@ -583,7 +583,11 @@ def remove(self): class ShiftGrid(QUndoCommand): def __init__(self, comp, direction): - super().__init__("change %s component #%s" % (comp.name, comp.compPos)) + dirName = {0: "up", 1: "down", 2: "left", 3: "right"} + super().__init__( + "shift %s component #%s grid %s" + % (comp.name, comp.compPos, dirName[direction]) + ) self.comp = comp self.direction = direction self.distance = 1 diff --git a/src/avp/libcomponent/actions.py b/src/avp/libcomponent/actions.py index c320d92..5027e34 100644 --- a/src/avp/libcomponent/actions.py +++ b/src/avp/libcomponent/actions.py @@ -19,7 +19,14 @@ class ComponentTrackedWidgetUpdate(QUndoCommand): """ def __init__(self, parent, oldWidgetVals, modifiedVals): - super().__init__("change %s component #%s" % (parent.name, parent.compPos)) + super().__init__( + "change %s component #%s %s" + % ( + parent.name, + parent.compPos, + list(modifiedVals.keys())[0], + ) + ) self.undone = False self.res = (int(parent.width), int(parent.height)) self.parent = parent @@ -122,8 +129,8 @@ class ComponentSettingsUpdate(QUndoCommand): manually create instances, and add them to the undoStack when needed. """ - def __init__(self, comp): - super().__init__("change %s component #%s" % (comp.name, comp.compPos)) + def __init__(self, comp, title=""): + super().__init__("bring %s component #%s %s" % (comp.name, comp.compPos, title)) self.comp = comp self.res = (int(comp.width), int(comp.height)) @@ -170,7 +177,7 @@ def remove(self): class ComponentCenterXYAction(ComponentSettingsUpdate): def __init__(self, comp): - super().__init__(comp) + super().__init__(comp, "to center") self.oldXY = ( self.comp.floatValForAttr("xPosition", axis=self.res), self.comp.floatValForAttr("yPosition", axis=self.res), From e46cd5f4df7bae44cbf4320550951fcd9ee565c8 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Mon, 26 Oct 2026 10:54:02 -0400 Subject: [PATCH 66/67] fix Conway Life comp: update grid scale after loading a preset --- src/avp/components/life.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/avp/components/life.py b/src/avp/components/life.py index 60cf9d3..d065608 100644 --- a/src/avp/components/life.py +++ b/src/avp/components/life.py @@ -557,6 +557,7 @@ def loadPreset(self, pr, *args): for widget in self.shiftButtons: widget.setEnabled(True) super().loadPreset(pr, *args) + self.updateGridSize() def nearbyCoords(self, x, y): yield x + 1, y + 1 From a15a79db6fcaffc7cdb08246d1ecd922acf485a1 Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Mon, 26 Oct 2026 11:02:38 -0400 Subject: [PATCH 67/67] update pillow to v13.0.0 --- pyproject.toml | 2 +- uv.lock | 135 ++++++++++++++++++++++++++----------------------- 2 files changed, 72 insertions(+), 65 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0eb6e7e..862f355 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ maintainers = [ ] dependencies = [ "numpy>=2.4.1", - "pillow>=12.2.0", + "pillow>=13.0.0", "pyqt6>=6.10.2", ] diff --git a/uv.lock b/uv.lock index 8082463..ffcb979 100644 --- a/uv.lock +++ b/uv.lock @@ -21,7 +21,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "numpy", specifier = ">=2.4.1" }, - { name = "pillow", specifier = ">=12.2.0" }, + { name = "pillow", specifier = ">=13.0.0" }, { name = "pyqt6", specifier = ">=6.10.2" }, ] @@ -121,71 +121,78 @@ wheels = [ [[package]] name = "pillow" -version = "12.2.0" +version = "13.0.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8c/21/c2bcdd5906101a30244eaffc1b6e6ce71a31bd0742a01eb89e660ebfac2d/pillow-12.2.0.tar.gz", hash = "sha256:a830b1a40919539d07806aa58e1b114df53ddd43213d9c8b75847eee6c0182b5", size = 46987819, upload-time = "2026-04-01T14:46:17.687Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ce/a4/9cc30690a394a8305e8be4c9036aa16d0dfddadd09079860b582f562496d/pillow-13.0.0.tar.gz", hash = "sha256:cdcd1ba258178f7356d74170c9a81ba4eab6a5d55748bc402a5a2a6fe6be3510", size = 47058631, upload-time = "2026-10-16T22:18:09.718Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/58/be/7482c8a5ebebbc6470b3eb791812fff7d5e0216c2be3827b30b8bb6603ed/pillow-12.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2d192a155bbcec180f8564f693e6fd9bccff5a7af9b32e2e4bf8c9c69dbad6b5", size = 5308279, upload-time = "2026-04-01T14:43:13.246Z" }, - { url = "https://files.pythonhosted.org/packages/d8/95/0a351b9289c2b5cbde0bacd4a83ebc44023e835490a727b2a3bd60ddc0f4/pillow-12.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f3f40b3c5a968281fd507d519e444c35f0ff171237f4fdde090dd60699458421", size = 4695490, upload-time = "2026-04-01T14:43:15.584Z" }, - { url = "https://files.pythonhosted.org/packages/de/af/4e8e6869cbed569d43c416fad3dc4ecb944cb5d9492defaed89ddd6fe871/pillow-12.2.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:03e7e372d5240cc23e9f07deca4d775c0817bffc641b01e9c3af208dbd300987", size = 6284462, upload-time = "2026-04-01T14:43:18.268Z" }, - { url = "https://files.pythonhosted.org/packages/e9/9e/c05e19657fd57841e476be1ab46c4d501bffbadbafdc31a6d665f8b737b6/pillow-12.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b86024e52a1b269467a802258c25521e6d742349d760728092e1bc2d135b4d76", size = 8094744, upload-time = "2026-04-01T14:43:20.716Z" }, - { url = "https://files.pythonhosted.org/packages/2b/54/1789c455ed10176066b6e7e6da1b01e50e36f94ba584dc68d9eebfe9156d/pillow-12.2.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7371b48c4fa448d20d2714c9a1f775a81155050d383333e0a6c15b1123dda005", size = 6398371, upload-time = "2026-04-01T14:43:23.443Z" }, - { url = "https://files.pythonhosted.org/packages/43/e3/fdc657359e919462369869f1c9f0e973f353f9a9ee295a39b1fea8ee1a77/pillow-12.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62f5409336adb0663b7caa0da5c7d9e7bdbaae9ce761d34669420c2a801b2780", size = 7087215, upload-time = "2026-04-01T14:43:26.758Z" }, - { url = "https://files.pythonhosted.org/packages/8b/f8/2f6825e441d5b1959d2ca5adec984210f1ec086435b0ed5f52c19b3b8a6e/pillow-12.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:01afa7cf67f74f09523699b4e88c73fb55c13346d212a59a2db1f86b0a63e8c5", size = 6509783, upload-time = "2026-04-01T14:43:29.56Z" }, - { url = "https://files.pythonhosted.org/packages/67/f9/029a27095ad20f854f9dba026b3ea6428548316e057e6fc3545409e86651/pillow-12.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc3d34d4a8fbec3e88a79b92e5465e0f9b842b628675850d860b8bd300b159f5", size = 7212112, upload-time = "2026-04-01T14:43:32.091Z" }, - { url = "https://files.pythonhosted.org/packages/be/42/025cfe05d1be22dbfdb4f264fe9de1ccda83f66e4fc3aac94748e784af04/pillow-12.2.0-cp312-cp312-win32.whl", hash = "sha256:58f62cc0f00fd29e64b29f4fd923ffdb3859c9f9e6105bfc37ba1d08994e8940", size = 6378489, upload-time = "2026-04-01T14:43:34.601Z" }, - { url = "https://files.pythonhosted.org/packages/5d/7b/25a221d2c761c6a8ae21bfa3874988ff2583e19cf8a27bf2fee358df7942/pillow-12.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:7f84204dee22a783350679a0333981df803dac21a0190d706a50475e361c93f5", size = 7084129, upload-time = "2026-04-01T14:43:37.213Z" }, - { url = "https://files.pythonhosted.org/packages/10/e1/542a474affab20fd4a0f1836cb234e8493519da6b76899e30bcc5d990b8b/pillow-12.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:af73337013e0b3b46f175e79492d96845b16126ddf79c438d7ea7ff27783a414", size = 2463612, upload-time = "2026-04-01T14:43:39.421Z" }, - { url = "https://files.pythonhosted.org/packages/4a/01/53d10cf0dbad820a8db274d259a37ba50b88b24768ddccec07355382d5ad/pillow-12.2.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:8297651f5b5679c19968abefd6bb84d95fe30ef712eb1b2d9b2d31ca61267f4c", size = 4100837, upload-time = "2026-04-01T14:43:41.506Z" }, - { url = "https://files.pythonhosted.org/packages/0f/98/f3a6657ecb698c937f6c76ee564882945f29b79bad496abcba0e84659ec5/pillow-12.2.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:50d8520da2a6ce0af445fa6d648c4273c3eeefbc32d7ce049f22e8b5c3daecc2", size = 4176528, upload-time = "2026-04-01T14:43:43.773Z" }, - { url = "https://files.pythonhosted.org/packages/69/bc/8986948f05e3ea490b8442ea1c1d4d990b24a7e43d8a51b2c7d8b1dced36/pillow-12.2.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:766cef22385fa1091258ad7e6216792b156dc16d8d3fa607e7545b2b72061f1c", size = 3640401, upload-time = "2026-04-01T14:43:45.87Z" }, - { url = "https://files.pythonhosted.org/packages/34/46/6c717baadcd62bc8ed51d238d521ab651eaa74838291bda1f86fe1f864c9/pillow-12.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5d2fd0fa6b5d9d1de415060363433f28da8b1526c1c129020435e186794b3795", size = 5308094, upload-time = "2026-04-01T14:43:48.438Z" }, - { url = "https://files.pythonhosted.org/packages/71/43/905a14a8b17fdb1ccb58d282454490662d2cb89a6bfec26af6d3520da5ec/pillow-12.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:56b25336f502b6ed02e889f4ece894a72612fe885889a6e8c4c80239ff6e5f5f", size = 4695402, upload-time = "2026-04-01T14:43:51.292Z" }, - { url = "https://files.pythonhosted.org/packages/73/dd/42107efcb777b16fa0393317eac58f5b5cf30e8392e266e76e51cff28c3d/pillow-12.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f1c943e96e85df3d3478f7b691f229887e143f81fedab9b20205349ab04d73ed", size = 6280005, upload-time = "2026-04-01T14:43:54.242Z" }, - { url = "https://files.pythonhosted.org/packages/a8/68/b93e09e5e8549019e61acf49f65b1a8530765a7f812c77a7461bca7e4494/pillow-12.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:03f6fab9219220f041c74aeaa2939ff0062bd5c364ba9ce037197f4c6d498cd9", size = 8090669, upload-time = "2026-04-01T14:43:57.335Z" }, - { url = "https://files.pythonhosted.org/packages/4b/6e/3ccb54ce8ec4ddd1accd2d89004308b7b0b21c4ac3d20fa70af4760a4330/pillow-12.2.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5cdfebd752ec52bf5bb4e35d9c64b40826bc5b40a13df7c3cda20a2c03a0f5ed", size = 6395194, upload-time = "2026-04-01T14:43:59.864Z" }, - { url = "https://files.pythonhosted.org/packages/67/ee/21d4e8536afd1a328f01b359b4d3997b291ffd35a237c877b331c1c3b71c/pillow-12.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eedf4b74eda2b5a4b2b2fb4c006d6295df3bf29e459e198c90ea48e130dc75c3", size = 7082423, upload-time = "2026-04-01T14:44:02.74Z" }, - { url = "https://files.pythonhosted.org/packages/78/5f/e9f86ab0146464e8c133fe85df987ed9e77e08b29d8d35f9f9f4d6f917ba/pillow-12.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:00a2865911330191c0b818c59103b58a5e697cae67042366970a6b6f1b20b7f9", size = 6505667, upload-time = "2026-04-01T14:44:05.381Z" }, - { url = "https://files.pythonhosted.org/packages/ed/1e/409007f56a2fdce61584fd3acbc2bbc259857d555196cedcadc68c015c82/pillow-12.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1e1757442ed87f4912397c6d35a0db6a7b52592156014706f17658ff58bbf795", size = 7208580, upload-time = "2026-04-01T14:44:08.39Z" }, - { url = "https://files.pythonhosted.org/packages/23/c4/7349421080b12fb35414607b8871e9534546c128a11965fd4a7002ccfbee/pillow-12.2.0-cp313-cp313-win32.whl", hash = "sha256:144748b3af2d1b358d41286056d0003f47cb339b8c43a9ea42f5fea4d8c66b6e", size = 6375896, upload-time = "2026-04-01T14:44:11.197Z" }, - { url = "https://files.pythonhosted.org/packages/3f/82/8a3739a5e470b3c6cbb1d21d315800d8e16bff503d1f16b03a4ec3212786/pillow-12.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:390ede346628ccc626e5730107cde16c42d3836b89662a115a921f28440e6a3b", size = 7081266, upload-time = "2026-04-01T14:44:13.947Z" }, - { url = "https://files.pythonhosted.org/packages/c3/25/f968f618a062574294592f668218f8af564830ccebdd1fa6200f598e65c5/pillow-12.2.0-cp313-cp313-win_arm64.whl", hash = "sha256:8023abc91fba39036dbce14a7d6535632f99c0b857807cbbbf21ecc9f4717f06", size = 2463508, upload-time = "2026-04-01T14:44:16.312Z" }, - { url = "https://files.pythonhosted.org/packages/4d/a4/b342930964e3cb4dce5038ae34b0eab4653334995336cd486c5a8c25a00c/pillow-12.2.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:042db20a421b9bafecc4b84a8b6e444686bd9d836c7fd24542db3e7df7baad9b", size = 5309927, upload-time = "2026-04-01T14:44:18.89Z" }, - { url = "https://files.pythonhosted.org/packages/9f/de/23198e0a65a9cf06123f5435a5d95cea62a635697f8f03d134d3f3a96151/pillow-12.2.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:dd025009355c926a84a612fecf58bb315a3f6814b17ead51a8e48d3823d9087f", size = 4698624, upload-time = "2026-04-01T14:44:21.115Z" }, - { url = "https://files.pythonhosted.org/packages/01/a6/1265e977f17d93ea37aa28aa81bad4fa597933879fac2520d24e021c8da3/pillow-12.2.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:88ddbc66737e277852913bd1e07c150cc7bb124539f94c4e2df5344494e0a612", size = 6321252, upload-time = "2026-04-01T14:44:23.663Z" }, - { url = "https://files.pythonhosted.org/packages/3c/83/5982eb4a285967baa70340320be9f88e57665a387e3a53a7f0db8231a0cd/pillow-12.2.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d362d1878f00c142b7e1a16e6e5e780f02be8195123f164edf7eddd911eefe7c", size = 8126550, upload-time = "2026-04-01T14:44:26.772Z" }, - { url = "https://files.pythonhosted.org/packages/4e/48/6ffc514adce69f6050d0753b1a18fd920fce8cac87620d5a31231b04bfc5/pillow-12.2.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2c727a6d53cb0018aadd8018c2b938376af27914a68a492f59dfcaca650d5eea", size = 6433114, upload-time = "2026-04-01T14:44:29.615Z" }, - { url = "https://files.pythonhosted.org/packages/36/a3/f9a77144231fb8d40ee27107b4463e205fa4677e2ca2548e14da5cf18dce/pillow-12.2.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:efd8c21c98c5cc60653bcb311bef2ce0401642b7ce9d09e03a7da87c878289d4", size = 7115667, upload-time = "2026-04-01T14:44:32.773Z" }, - { url = "https://files.pythonhosted.org/packages/c1/fc/ac4ee3041e7d5a565e1c4fd72a113f03b6394cc72ab7089d27608f8aaccb/pillow-12.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9f08483a632889536b8139663db60f6724bfcb443c96f1b18855860d7d5c0fd4", size = 6538966, upload-time = "2026-04-01T14:44:35.252Z" }, - { url = "https://files.pythonhosted.org/packages/c0/a8/27fb307055087f3668f6d0a8ccb636e7431d56ed0750e07a60547b1e083e/pillow-12.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dac8d77255a37e81a2efcbd1fc05f1c15ee82200e6c240d7e127e25e365c39ea", size = 7238241, upload-time = "2026-04-01T14:44:37.875Z" }, - { url = "https://files.pythonhosted.org/packages/ad/4b/926ab182c07fccae9fcb120043464e1ff1564775ec8864f21a0ebce6ac25/pillow-12.2.0-cp313-cp313t-win32.whl", hash = "sha256:ee3120ae9dff32f121610bb08e4313be87e03efeadfc6c0d18f89127e24d0c24", size = 6379592, upload-time = "2026-04-01T14:44:40.336Z" }, - { url = "https://files.pythonhosted.org/packages/c2/c4/f9e476451a098181b30050cc4c9a3556b64c02cf6497ea421ac047e89e4b/pillow-12.2.0-cp313-cp313t-win_amd64.whl", hash = "sha256:325ca0528c6788d2a6c3d40e3568639398137346c3d6e66bb61db96b96511c98", size = 7085542, upload-time = "2026-04-01T14:44:43.251Z" }, - { url = "https://files.pythonhosted.org/packages/00/a4/285f12aeacbe2d6dc36c407dfbbe9e96d4a80b0fb710a337f6d2ad978c75/pillow-12.2.0-cp313-cp313t-win_arm64.whl", hash = "sha256:2e5a76d03a6c6dcef67edabda7a52494afa4035021a79c8558e14af25313d453", size = 2465765, upload-time = "2026-04-01T14:44:45.996Z" }, - { url = "https://files.pythonhosted.org/packages/bf/98/4595daa2365416a86cb0d495248a393dfc84e96d62ad080c8546256cb9c0/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:3adc9215e8be0448ed6e814966ecf3d9952f0ea40eb14e89a102b87f450660d8", size = 4100848, upload-time = "2026-04-01T14:44:48.48Z" }, - { url = "https://files.pythonhosted.org/packages/0b/79/40184d464cf89f6663e18dfcf7ca21aae2491fff1a16127681bf1fa9b8cf/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:6a9adfc6d24b10f89588096364cc726174118c62130c817c2837c60cf08a392b", size = 4176515, upload-time = "2026-04-01T14:44:51.353Z" }, - { url = "https://files.pythonhosted.org/packages/b0/63/703f86fd4c422a9cf722833670f4f71418fb116b2853ff7da722ea43f184/pillow-12.2.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:6a6e67ea2e6feda684ed370f9a1c52e7a243631c025ba42149a2cc5934dec295", size = 3640159, upload-time = "2026-04-01T14:44:53.588Z" }, - { url = "https://files.pythonhosted.org/packages/71/e0/fb22f797187d0be2270f83500aab851536101b254bfa1eae10795709d283/pillow-12.2.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2bb4a8d594eacdfc59d9e5ad972aa8afdd48d584ffd5f13a937a664c3e7db0ed", size = 5312185, upload-time = "2026-04-01T14:44:56.039Z" }, - { url = "https://files.pythonhosted.org/packages/ba/8c/1a9e46228571de18f8e28f16fabdfc20212a5d019f3e3303452b3f0a580d/pillow-12.2.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:80b2da48193b2f33ed0c32c38140f9d3186583ce7d516526d462645fd98660ae", size = 4695386, upload-time = "2026-04-01T14:44:58.663Z" }, - { url = "https://files.pythonhosted.org/packages/70/62/98f6b7f0c88b9addd0e87c217ded307b36be024d4ff8869a812b241d1345/pillow-12.2.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22db17c68434de69d8ecfc2fe821569195c0c373b25cccb9cbdacf2c6e53c601", size = 6280384, upload-time = "2026-04-01T14:45:01.5Z" }, - { url = "https://files.pythonhosted.org/packages/5e/03/688747d2e91cfbe0e64f316cd2e8005698f76ada3130d0194664174fa5de/pillow-12.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7b14cc0106cd9aecda615dd6903840a058b4700fcb817687d0ee4fc8b6e389be", size = 8091599, upload-time = "2026-04-01T14:45:04.5Z" }, - { url = "https://files.pythonhosted.org/packages/f6/35/577e22b936fcdd66537329b33af0b4ccfefaeabd8aec04b266528cddb33c/pillow-12.2.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cbeb542b2ebc6fcdacabf8aca8c1a97c9b3ad3927d46b8723f9d4f033288a0f", size = 6396021, upload-time = "2026-04-01T14:45:07.117Z" }, - { url = "https://files.pythonhosted.org/packages/11/8d/d2532ad2a603ca2b93ad9f5135732124e57811d0168155852f37fbce2458/pillow-12.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4bfd07bc812fbd20395212969e41931001fd59eb55a60658b0e5710872e95286", size = 7083360, upload-time = "2026-04-01T14:45:09.763Z" }, - { url = "https://files.pythonhosted.org/packages/5e/26/d325f9f56c7e039034897e7380e9cc202b1e368bfd04d4cbe6a441f02885/pillow-12.2.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9aba9a17b623ef750a4d11b742cbafffeb48a869821252b30ee21b5e91392c50", size = 6507628, upload-time = "2026-04-01T14:45:12.378Z" }, - { url = "https://files.pythonhosted.org/packages/5f/f7/769d5632ffb0988f1c5e7660b3e731e30f7f8ec4318e94d0a5d674eb65a4/pillow-12.2.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:deede7c263feb25dba4e82ea23058a235dcc2fe1f6021025dc71f2b618e26104", size = 7209321, upload-time = "2026-04-01T14:45:15.122Z" }, - { url = "https://files.pythonhosted.org/packages/6a/7a/c253e3c645cd47f1aceea6a8bacdba9991bf45bb7dfe927f7c893e89c93c/pillow-12.2.0-cp314-cp314-win32.whl", hash = "sha256:632ff19b2778e43162304d50da0181ce24ac5bb8180122cbe1bf4673428328c7", size = 6479723, upload-time = "2026-04-01T14:45:17.797Z" }, - { url = "https://files.pythonhosted.org/packages/cd/8b/601e6566b957ca50e28725cb6c355c59c2c8609751efbecd980db44e0349/pillow-12.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:4e6c62e9d237e9b65fac06857d511e90d8461a32adcc1b9065ea0c0fa3a28150", size = 7217400, upload-time = "2026-04-01T14:45:20.529Z" }, - { url = "https://files.pythonhosted.org/packages/d6/94/220e46c73065c3e2951bb91c11a1fb636c8c9ad427ac3ce7d7f3359b9b2f/pillow-12.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:b1c1fbd8a5a1af3412a0810d060a78b5136ec0836c8a4ef9aa11807f2a22f4e1", size = 2554835, upload-time = "2026-04-01T14:45:23.162Z" }, - { url = "https://files.pythonhosted.org/packages/b6/ab/1b426a3974cb0e7da5c29ccff4807871d48110933a57207b5a676cccc155/pillow-12.2.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:57850958fe9c751670e49b2cecf6294acc99e562531f4bd317fa5ddee2068463", size = 5314225, upload-time = "2026-04-01T14:45:25.637Z" }, - { url = "https://files.pythonhosted.org/packages/19/1e/dce46f371be2438eecfee2a1960ee2a243bbe5e961890146d2dee1ff0f12/pillow-12.2.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d5d38f1411c0ed9f97bcb49b7bd59b6b7c314e0e27420e34d99d844b9ce3b6f3", size = 4698541, upload-time = "2026-04-01T14:45:28.355Z" }, - { url = "https://files.pythonhosted.org/packages/55/c3/7fbecf70adb3a0c33b77a300dc52e424dc22ad8cdc06557a2e49523b703d/pillow-12.2.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5c0a9f29ca8e79f09de89293f82fc9b0270bb4af1d58bc98f540cc4aedf03166", size = 6322251, upload-time = "2026-04-01T14:45:30.924Z" }, - { url = "https://files.pythonhosted.org/packages/1c/3c/7fbc17cfb7e4fe0ef1642e0abc17fc6c94c9f7a16be41498e12e2ba60408/pillow-12.2.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1610dd6c61621ae1cf811bef44d77e149ce3f7b95afe66a4512f8c59f25d9ebe", size = 8127807, upload-time = "2026-04-01T14:45:33.908Z" }, - { url = "https://files.pythonhosted.org/packages/ff/c3/a8ae14d6defd2e448493ff512fae903b1e9bd40b72efb6ec55ce0048c8ce/pillow-12.2.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a34329707af4f73cf1782a36cd2289c0368880654a2c11f027bcee9052d35dd", size = 6433935, upload-time = "2026-04-01T14:45:36.623Z" }, - { url = "https://files.pythonhosted.org/packages/6e/32/2880fb3a074847ac159d8f902cb43278a61e85f681661e7419e6596803ed/pillow-12.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e9c4f5b3c546fa3458a29ab22646c1c6c787ea8f5ef51300e5a60300736905e", size = 7116720, upload-time = "2026-04-01T14:45:39.258Z" }, - { url = "https://files.pythonhosted.org/packages/46/87/495cc9c30e0129501643f24d320076f4cc54f718341df18cc70ec94c44e1/pillow-12.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fb043ee2f06b41473269765c2feae53fc2e2fbf96e5e22ca94fb5ad677856f06", size = 6540498, upload-time = "2026-04-01T14:45:41.879Z" }, - { url = "https://files.pythonhosted.org/packages/18/53/773f5edca692009d883a72211b60fdaf8871cbef075eaa9d577f0a2f989e/pillow-12.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f278f034eb75b4e8a13a54a876cc4a5ab39173d2cdd93a638e1b467fc545ac43", size = 7239413, upload-time = "2026-04-01T14:45:44.705Z" }, - { url = "https://files.pythonhosted.org/packages/c9/e4/4b64a97d71b2a83158134abbb2f5bd3f8a2ea691361282f010998f339ec7/pillow-12.2.0-cp314-cp314t-win32.whl", hash = "sha256:6bb77b2dcb06b20f9f4b4a8454caa581cd4dd0643a08bacf821216a16d9c8354", size = 6482084, upload-time = "2026-04-01T14:45:47.568Z" }, - { url = "https://files.pythonhosted.org/packages/ba/13/306d275efd3a3453f72114b7431c877d10b1154014c1ebbedd067770d629/pillow-12.2.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6562ace0d3fb5f20ed7290f1f929cae41b25ae29528f2af1722966a0a02e2aa1", size = 7225152, upload-time = "2026-04-01T14:45:50.032Z" }, - { url = "https://files.pythonhosted.org/packages/ff/6e/cf826fae916b8658848d7b9f38d88da6396895c676e8086fc0988073aaf8/pillow-12.2.0-cp314-cp314t-win_arm64.whl", hash = "sha256:aa88ccfe4e32d362816319ed727a004423aab09c5cea43c01a4b435643fa34eb", size = 2556579, upload-time = "2026-04-01T14:45:52.529Z" }, + { url = "https://files.pythonhosted.org/packages/7a/b8/58d79332229482eb0d27c82973850808c19d37e5bdc14443d3417bd373f5/pillow-13.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:67c8d44ad89fa7eb88de5d6ef6199b1e03dd24974f85a67639fc8badb801fe79", size = 5568643, upload-time = "2026-10-16T22:15:44.474Z" }, + { url = "https://files.pythonhosted.org/packages/39/4b/f2ed53d83aa44ac19599ac0a54897f867fafb95f406980d1e24083f8cbe3/pillow-13.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc481f742ccda20e9ed760b8f978dff50f2a4e9bc253ac167fb0a05b0783ef52", size = 4852329, upload-time = "2026-10-16T22:15:46.284Z" }, + { url = "https://files.pythonhosted.org/packages/3b/bb/9e30e8ed18c20800ee327a12107d5249ad8dc444867b3adfcc21654e3c71/pillow-13.0.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8bf295fe459343bc6093c8e5e0df60bfa189e0fcb775a22e2c2488fdeccc6c0d", size = 6519309, upload-time = "2026-10-16T22:15:48.14Z" }, + { url = "https://files.pythonhosted.org/packages/e6/99/fdf65cc539e266ab93546c261bdf98411fe165c6e4e13f9dbf597097192b/pillow-13.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:42d63be3af4f9b951b199b0a9d23365d37ab14687e6d77b74940432c8515c4ca", size = 7144542, upload-time = "2026-10-16T22:15:50.093Z" }, + { url = "https://files.pythonhosted.org/packages/26/9b/f38b7c4d8f599537e2d1a6d546cec9beef7536ff8f5c49a3f9c78179d8ac/pillow-13.0.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4bd024d567eca931b668978d672dba914d4b8e2628e2c3073a2ad178de8a2620", size = 6618042, upload-time = "2026-10-16T22:15:52.054Z" }, + { url = "https://files.pythonhosted.org/packages/a8/7c/45ee28531f89ee4582967d8a17f7a26d71ca64cd902b93c269590cd60a00/pillow-13.0.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:23edf4ec4b6f4f240e8df6e4985e9ee2ced86474632433e55fb1e2548744bf40", size = 7228137, upload-time = "2026-10-16T22:15:54.009Z" }, + { url = "https://files.pythonhosted.org/packages/01/bc/9c2a969cb1b70201d04fa17fd5aedf02a732870b8da86bceaaa30b0ca385/pillow-13.0.0-cp312-cp312-win32.whl", hash = "sha256:02464da86f561f410e13b061ec37c3068a9cb557a095494157742d07b3c24a27", size = 6515423, upload-time = "2026-10-16T22:15:56.25Z" }, + { url = "https://files.pythonhosted.org/packages/ff/cd/73a79ecdc822076002eb24b5e1e4a530b0bb5310fcb6d239abbec877110b/pillow-13.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:ff3fe9eb621fbb9db4c4be33ab946f6bac5f98ab50ca8d3260503653656c961b", size = 7272166, upload-time = "2026-10-16T22:15:58.597Z" }, + { url = "https://files.pythonhosted.org/packages/4a/a3/be5a1236efd085b3984e4305da8f179ae9dab80c991d2ad78f2bd5c4c843/pillow-13.0.0-cp312-cp312-win_arm64.whl", hash = "sha256:c3bc8ee0271387e0b1e3ad0ff893645990a656e79bf9c42f4f734a3642b11d51", size = 2698943, upload-time = "2026-10-16T22:16:00.637Z" }, + { url = "https://files.pythonhosted.org/packages/82/e2/9132d38df320e8099e2642d9fa538f18a7dfebf68a875a31725dc2a115aa/pillow-13.0.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:e98b4f91f99b24b1da72e10621ba181f7281922384a7403094debb4199de6c00", size = 4190620, upload-time = "2026-10-16T22:16:02.527Z" }, + { url = "https://files.pythonhosted.org/packages/cb/be/436dac0996876f65ef1916ffb711c5ef4af2ebc57414b6f16642e07f6b47/pillow-13.0.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:34fb3db1149c879343861831728c243c432d4a5afc8f1878ca7612ef8de2a033", size = 4290286, upload-time = "2026-10-16T22:16:04.861Z" }, + { url = "https://files.pythonhosted.org/packages/60/16/7c1007162e4169ea0d5bec47e2e0b2174f56c50cf5b8c02a1dc23e41037e/pillow-13.0.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:2d50500a4a3bc6469adcdb319cf05d688b08ca3bf0f22a05339f3b25b433a599", size = 3723169, upload-time = "2026-10-16T22:16:06.956Z" }, + { url = "https://files.pythonhosted.org/packages/08/bc/578ab2eaa04705a8978bd9be0fe15c3d43a8fc95097c4f7e39540e79e4fa/pillow-13.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ef5fe6b7db3f501c56000ba8fe7c7e1a35ca1d45824fbeb95a67daa85cff4dbe", size = 5568469, upload-time = "2026-10-16T22:16:08.664Z" }, + { url = "https://files.pythonhosted.org/packages/98/c8/ccede3dcc4f274b80fb49199eed1ef34ba05566c8b71976b9d1f111da2e3/pillow-13.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f11a3c1358bb3c68012a7b1f41b223c3db9f7bfde90b481df028cfe1c3363313", size = 4852187, upload-time = "2026-10-16T22:16:10.693Z" }, + { url = "https://files.pythonhosted.org/packages/fb/3c/cd0770e96d20bfd990db024bcbd43897ff3e88da1f4782cf90ea231b1d4f/pillow-13.0.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:19b66ca0a4d25cc0200b381ce824c7ea090db61427315e73cfb05dbf1b35c369", size = 6515908, upload-time = "2026-10-16T22:16:12.896Z" }, + { url = "https://files.pythonhosted.org/packages/ef/fe/f5cdaa2d1c4086e757430f368c271a58ee29cfe7378e7ae7b9d964015c25/pillow-13.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5f56499c1a74d2b862beb0c33b8016f99d095858455df9d21583bbbc1c15b582", size = 7142544, upload-time = "2026-10-16T22:16:14.844Z" }, + { url = "https://files.pythonhosted.org/packages/fb/b5/a54f6d44adbcd23737c8c12953f42be107e4cca64e247c0ca3a5b563061c/pillow-13.0.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a2a14cd73d5e6c927f644b0110ee81f59c4ef506259ec9183904747f2caacc81", size = 6613097, upload-time = "2026-10-16T22:16:16.893Z" }, + { url = "https://files.pythonhosted.org/packages/e6/b4/9e6c1207c21b2e91db0d15c16d30f3701ce5add1bd4da0e787761e66cb6e/pillow-13.0.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:08b826a9bf1265c76de04a42061d61ea6b109418b7826f28ff1ecdfaa26c5502", size = 7224846, upload-time = "2026-10-16T22:16:19.195Z" }, + { url = "https://files.pythonhosted.org/packages/78/9f/d3c3cb0518f3dd1eee0ef501535f53d15597a53c5c4118d178086143397a/pillow-13.0.0-cp313-cp313-win32.whl", hash = "sha256:12b0fa15879fe5a9d9eebe66e4e2d74128a773b1a4448010c9c714f45e04b9d8", size = 6516013, upload-time = "2026-10-16T22:16:21.389Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ed/1b16fb66a37e1b9e41370b93b2c614c7da761a5b2a41dc333f7af4639962/pillow-13.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:9dda0788a9932776a75d8bcc020076edc308ce2508b51f6739a45e3158b3fc42", size = 7284777, upload-time = "2026-10-16T22:16:23.393Z" }, + { url = "https://files.pythonhosted.org/packages/87/7d/8d02eba9f7ecc87f8e90f731e032cc4773802f2a843763afd0c66a535ff4/pillow-13.0.0-cp313-cp313-win_arm64.whl", hash = "sha256:40a266371ece581e5de13b6635ef78d7487824af80561b6ca27694a88c19bc0f", size = 2698826, upload-time = "2026-10-16T22:16:25.382Z" }, + { url = "https://files.pythonhosted.org/packages/8e/45/fbad9c7f5e2f1745c373a434d46072bc84eddfefaa28b852425ac957fda6/pillow-13.0.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:44629d4498c9cb6b2051806155f22141df0d8a929c56134b166655232dfb2f8c", size = 4190721, upload-time = "2026-10-16T22:16:27.524Z" }, + { url = "https://files.pythonhosted.org/packages/a2/bf/2074902a259a90692c5dbf132885d21671644cbbd3f690047516243a55db/pillow-13.0.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:bf97ba1b5542050e9b0c74e632323b6d8136cc99d64e193abebee22fe6013c76", size = 4290236, upload-time = "2026-10-16T22:16:29.562Z" }, + { url = "https://files.pythonhosted.org/packages/ff/a5/3d1bb93b8ea38d15d21356c1b8e9f50971ac592aaa248f7fb71739094c0e/pillow-13.0.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:aa694c49787040943570d61c9b8fc01271bd2a2cfdd55f0d896f8aecdce1a981", size = 3723093, upload-time = "2026-10-16T22:16:31.249Z" }, + { url = "https://files.pythonhosted.org/packages/84/a1/be060135d85187b25fa8b2573786c0e45c62ae27527fff5257675eb97f4a/pillow-13.0.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:49c12af515073e9bf511e4ef736743bf70d531a643668722279314b937742ba4", size = 5572253, upload-time = "2026-10-16T22:16:33.103Z" }, + { url = "https://files.pythonhosted.org/packages/b5/f4/0bf6f1ac9ba7ee2ffe9914aeb410a1035a0c1a3c42f122388d7fc950bc4b/pillow-13.0.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:d9b0a2bee3f3e03e9f29057aedb807dbf1e1d96ee1b9d0f422d9db6c8583271d", size = 4852269, upload-time = "2026-10-16T22:16:35.102Z" }, + { url = "https://files.pythonhosted.org/packages/83/16/b603274617b3e6728da3a0133d4fba1ea8d7fbe0c4ea5fef9cbffa398b8b/pillow-13.0.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5933fcea5a5ba64c686f55c886a115cbfd92f2900460784a1e79909fdbafd7b6", size = 6516058, upload-time = "2026-10-16T22:16:37.228Z" }, + { url = "https://files.pythonhosted.org/packages/1d/f2/1371707ce438ba9a43f9d24089828494ec6f9396e28cd7903aa704dd6306/pillow-13.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e91c2b1cbeae768c98752e67e717e283d68dae45717b41f2d91eaee648e37b7d", size = 7142574, upload-time = "2026-10-16T22:16:39.172Z" }, + { url = "https://files.pythonhosted.org/packages/b9/a9/62cf68587f910bc87c5951bcb6e9430c7643a65076adf5f18b4bf350e2bd/pillow-13.0.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7f6299e494e46253d40c34653cac369412f44ca53b5f85d848d3f95b1ed0546c", size = 6614295, upload-time = "2026-10-16T22:16:41.117Z" }, + { url = "https://files.pythonhosted.org/packages/6c/c9/9e9b48178649730299be0bafbf5f810a5b6977538f5a92d47e4ba5f5d608/pillow-13.0.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f9bd7d260d986f3553518c5d723544346fa48031f8aef3265d786aeb59845bc0", size = 7224841, upload-time = "2026-10-16T22:16:43.118Z" }, + { url = "https://files.pythonhosted.org/packages/8f/48/c44e91384b1b6c072a714a63d00608acc16a6a968735e478e4be4384e5ac/pillow-13.0.0-cp314-cp314-win32.whl", hash = "sha256:2e31c4e68cffd7b1f116127626813b82fcba19edf6b940a7b0c266d6484d0055", size = 6508694, upload-time = "2026-10-16T22:16:45.883Z" }, + { url = "https://files.pythonhosted.org/packages/50/e2/7ad17747517e4c813dca78257d6bb593466f8231baf1384bc98d92745edb/pillow-13.0.0-cp314-cp314-win_amd64.whl", hash = "sha256:f7cbb7a64e7ec664775195e4f81923bc8a93d9451b963f844e59118f63147a7a", size = 7281830, upload-time = "2026-10-16T22:16:47.725Z" }, + { url = "https://files.pythonhosted.org/packages/41/9f/e5b51f2ce8ef4563215334035403ce61a244f93a2e65c24a940131618f87/pillow-13.0.0-cp314-cp314-win_arm64.whl", hash = "sha256:a6aaa7871aebca081eb5c45f83e845bbd9712ae99fa9286dbfdcee835e63f4b4", size = 2695468, upload-time = "2026-10-16T22:16:49.515Z" }, + { url = "https://files.pythonhosted.org/packages/97/73/a53502f731f6c84805a4ce87a8881e86d07a65aee64728b900d112dc703e/pillow-13.0.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7b999816b5850a35ada08443e6e03945f1f6488144a83afe2d37b240a552aafa", size = 5578196, upload-time = "2026-10-16T22:16:51.291Z" }, + { url = "https://files.pythonhosted.org/packages/21/50/7e949959a56b5559c78ef172b70fc6025706acb289f3f648a15329e4fa6f/pillow-13.0.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:67871a13cf47275201553b536c025da777f997fa562a19eb798af4ad4b97c18f", size = 4857276, upload-time = "2026-10-16T22:16:53.399Z" }, + { url = "https://files.pythonhosted.org/packages/c9/52/43ded0ac08e77e39d17bd6d894162572201b5e8fdc4a022b14c55a1960a4/pillow-13.0.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e8ca8f69b7c77fa96dad99f8638c1fc4f1c0bed4acaa1baf7a3c31bdb80a0ab1", size = 6607008, upload-time = "2026-10-16T22:16:55.525Z" }, + { url = "https://files.pythonhosted.org/packages/0d/2e/4a57ed216d5bf877387cba4d44c02aa87abe51ad2e06404aa6b597c4da39/pillow-13.0.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6bce6a29c3898191f4c9998e4d4e8f69790caeabde46e54da4bc235ce5bde683", size = 7224281, upload-time = "2026-10-16T22:16:57.738Z" }, + { url = "https://files.pythonhosted.org/packages/5c/3d/2929b248e135752d63aaeabf53f6de797e905b7b6263f9c1e2adade20aba/pillow-13.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:816752a5ef76a80484c8c441c85593b7ea9304f6231fc5776ad1fbff7e773058", size = 6695600, upload-time = "2026-10-16T22:16:59.842Z" }, + { url = "https://files.pythonhosted.org/packages/bc/33/fb0da992cf084ed1ee6ee05e96b6191e35c351eb707ca2df874feb24ce47/pillow-13.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5bdb38ba220b61b4ec31dd1046dea6b016d3c6850a23f43ed8b58332b2fc668e", size = 7300589, upload-time = "2026-10-16T22:17:01.686Z" }, + { url = "https://files.pythonhosted.org/packages/bb/af/c30dd9ef6a3dce84ecb1b2393cac629047a32e66279056c6cb46c3ffd65c/pillow-13.0.0-cp314-cp314t-win32.whl", hash = "sha256:06903aac074d00c988e77a1fc435286dc498506d4ca8d6f69df9babddf4ecc15", size = 6517204, upload-time = "2026-10-16T22:17:03.722Z" }, + { url = "https://files.pythonhosted.org/packages/85/d5/ef3a8ae7609c8ab26570abf18194882534b480d245a9148b895a2262c004/pillow-13.0.0-cp314-cp314t-win_amd64.whl", hash = "sha256:9a635068d9793c7f0d929f39f18b58f1bd86c236e8e7b64167b86af9232ebca0", size = 7286695, upload-time = "2026-10-16T22:17:05.543Z" }, + { url = "https://files.pythonhosted.org/packages/84/3c/0861db0c69a03689ebe3e7599d35668a414deb5aaafd8255215e4e62e3d3/pillow-13.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:0d1a9cf7bc6917538b20f8d06b9ab2147e542f68849e96fc58eb66bdf6acc692", size = 2698098, upload-time = "2026-10-16T22:17:07.674Z" }, + { url = "https://files.pythonhosted.org/packages/6e/eb/e86a41962a3a31ad495a3d6a912d9002b01bba4a6fa71c28703abdca7f69/pillow-13.0.0-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7d5e097eabd5d4915c27ac9f6e9325bb1e01a7c94d7348b5c4451d3fc30e8521", size = 4191213, upload-time = "2026-10-16T22:17:09.449Z" }, + { url = "https://files.pythonhosted.org/packages/dd/04/7e7445e706afec84ef06dc25b2c77f9cecff242c23730c62928ad1089d4a/pillow-13.0.0-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:51ebb529fc5e8abdd55302f6c3f8943037348ec2384329a3e55677f69ae2fdfc", size = 4290650, upload-time = "2026-10-16T22:17:11.196Z" }, + { url = "https://files.pythonhosted.org/packages/46/85/d534089068ac40c0f61f650389a296c812eab745a8a733f81feec39ae955/pillow-13.0.0-cp315-cp315-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:c87a04e7f152ee4db5dbe15f0bfa3fe628a1aeedbe66b81c43b87f52c813f9ac", size = 3723078, upload-time = "2026-10-16T22:17:12.772Z" }, + { url = "https://files.pythonhosted.org/packages/ce/2b/00b5c3b401df538b5dbe311d3899730fae5ba1e21cb8b80a128887ac6747/pillow-13.0.0-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:20722cd5375533ad754053363a80b8fb30c79d37930a6f7228030e237ce3bd5d", size = 5572292, upload-time = "2026-10-16T22:17:14.539Z" }, + { url = "https://files.pythonhosted.org/packages/72/f5/a6b0610f946e9b54ae888ba7ad29d6e2f8d9b11f69e212d70416b7186c09/pillow-13.0.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:04a63720f79e22fd54d897c233a68314c50ca0603360f54ce2bd5db8f0f43782", size = 4852222, upload-time = "2026-10-16T22:17:16.521Z" }, + { url = "https://files.pythonhosted.org/packages/1e/d0/c0ff25bb0427ec70f32aac995453321fc3c4494a46c7292ff02d9d260b04/pillow-13.0.0-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4f8db54177035a2b5f717f94475b74907e12a96dc74f6d487f3966b0a4694071", size = 6527349, upload-time = "2026-10-16T22:17:18.534Z" }, + { url = "https://files.pythonhosted.org/packages/85/11/e46fa0bcc0fc117f1eacc206b3d51f04d583fab328b4b740672d0438d83f/pillow-13.0.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f36aa77f74b14a2103622b196402c71330e4e7cf4122ee45c854e9a01e0eecf", size = 7152873, upload-time = "2026-10-16T22:17:20.415Z" }, + { url = "https://files.pythonhosted.org/packages/7c/53/2bdeca705f3a58679fa9201233193c86a30238340ca29b3a152c3fcc719b/pillow-13.0.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:149a1c323ba366f90b48e6f1a6db6582eb50512df374588de56fc909abc0f0f3", size = 6626871, upload-time = "2026-10-16T22:17:22.361Z" }, + { url = "https://files.pythonhosted.org/packages/14/de/3829030f209722ade3753bb456b805a0e7f885cf885b483407365c82e9ca/pillow-13.0.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:e892354a424b1e82a78ba16785822bdd40de06f19446a3d4a28047df1a4f8932", size = 7236439, upload-time = "2026-10-16T22:17:24.352Z" }, + { url = "https://files.pythonhosted.org/packages/44/b1/67fc37388382bc036a74f04da5bb6fcbf90ec3ac1f45893e06176c373fd3/pillow-13.0.0-cp315-cp315-win32.whl", hash = "sha256:8e459b613cf31f8980f584387b4fe47bf08e076e288d61aa8eba1f7fd4ddbb81", size = 6508688, upload-time = "2026-10-16T22:17:26.314Z" }, + { url = "https://files.pythonhosted.org/packages/44/05/fdb6a79aee10861165526b41b7b440e36ee1ff58613b2fbefe3acbf06d4f/pillow-13.0.0-cp315-cp315-win_amd64.whl", hash = "sha256:d4737f50d23ddd11d6685faacbb9252887dde0bc7997127757247983d74399d6", size = 7281107, upload-time = "2026-10-16T22:17:28.198Z" }, + { url = "https://files.pythonhosted.org/packages/e6/9c/6c6f7dc2a566467baf121394e83de25ac287cffe34cc030726beb4be0224/pillow-13.0.0-cp315-cp315-win_arm64.whl", hash = "sha256:2310e2adfc13c6d457d7d0f2ffdd5c56a74a317650cf765887df8d515a647ac0", size = 2695513, upload-time = "2026-10-16T22:17:30.013Z" }, + { url = "https://files.pythonhosted.org/packages/23/16/e9120defdb8bff693b582d035312acc6f530cdc2bc5238a87f410efccd82/pillow-13.0.0-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:21c32061a5512dc13f87cc7303e120e4d77c2f70df89a35af0e3ce246e5ac57f", size = 5578129, upload-time = "2026-10-16T22:17:31.642Z" }, + { url = "https://files.pythonhosted.org/packages/47/22/76faf2bb2448f48a84cf894c1e2bb1090d7d2b1aa521ece131cb2f05d631/pillow-13.0.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:1c774b9c0ba0d0b356f71530677b39028878a2cae5a93e0a13779cfd17120f88", size = 4857428, upload-time = "2026-10-16T22:17:33.43Z" }, + { url = "https://files.pythonhosted.org/packages/b3/64/0861ea4e03c50b14af9ed9dd8b9f388ab42f445c623a9fcbab19aef7aa55/pillow-13.0.0-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:20822140c9a2ba9c5e42df342b0a892ab2e102fc0e3db967a133bb9ce3f898bb", size = 6612582, upload-time = "2026-10-16T22:17:35.415Z" }, + { url = "https://files.pythonhosted.org/packages/5c/20/cd1e9b3f60a9f3d5ebe46da36955c26004092a501f7f2c42f9fcc26611bc/pillow-13.0.0-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ffea6b2986a797c84b6d1d27d4f43e0b83c73fc16281a930891cd237cf0d08fe", size = 7230176, upload-time = "2026-10-16T22:17:37.362Z" }, + { url = "https://files.pythonhosted.org/packages/b6/ef/ffb0a2fc85690714fb7ac662956949645d57f15bf4426f520da361e7b6e3/pillow-13.0.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:05cd2cd39055d0b9650060e4513ef4a9a0aea870083950bd046a0d6490f93a22", size = 6703640, upload-time = "2026-10-16T22:17:39.313Z" }, + { url = "https://files.pythonhosted.org/packages/e0/c2/6402ee3ccb3363aeed8fdb3f9fe56703ac5377a539f0b81b53999d7e121f/pillow-13.0.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:c6fd031333dedcad7ce3e03d244093f43504f209e86925ebdb2b868fa4037630", size = 7309231, upload-time = "2026-10-16T22:17:41.021Z" }, + { url = "https://files.pythonhosted.org/packages/fc/96/d6b82e8b8c06ad143b66b12e0b31051e4bf489b4fabca1f390a14fe1ebde/pillow-13.0.0-cp315-cp315t-win32.whl", hash = "sha256:c50c80e3591e5cf9a8dfa6007d4f10732f02e32263850999286e56ccd650cfb2", size = 6517200, upload-time = "2026-10-16T22:17:42.886Z" }, + { url = "https://files.pythonhosted.org/packages/60/d4/0062e6005e9b270b165015aafd343364ac378ec5a685431ea42baad33357/pillow-13.0.0-cp315-cp315t-win_amd64.whl", hash = "sha256:adb3c2124c68e480f4632d06cb7caa3b48a51678475f483b4edb1c6dee29ea43", size = 7287488, upload-time = "2026-10-16T22:17:45.56Z" }, + { url = "https://files.pythonhosted.org/packages/e4/81/b8eb349746be7bce47dd95337c6634e84910af91b59aaa9159c034c614fa/pillow-13.0.0-cp315-cp315t-win_arm64.whl", hash = "sha256:4a25756244bdcce3b50580baadf320fa48297f0eeb8e114ba64139a40d4d0fc8", size = 2698073, upload-time = "2026-10-16T22:17:47.556Z" }, + { url = "https://files.pythonhosted.org/packages/60/da/f6d644e631c5b370c5d0b899f3ccadd2780aab070b29a110527cf4e1fd2c/pillow-13.0.0-pp312-pypy312_pp80-macosx_10_15_x86_64.whl", hash = "sha256:8619685cad8efc4c38c66d3b36aad854523297c43d748b3b6f0cc03c90ba3463", size = 5523188, upload-time = "2026-10-16T22:17:59.334Z" }, + { url = "https://files.pythonhosted.org/packages/e4/b0/2594f202d743a35d4fe80682bfd96f277e5ca7aecb27cf64ef5bfc1d000b/pillow-13.0.0-pp312-pypy312_pp80-macosx_11_0_arm64.whl", hash = "sha256:7e91e97a929232cdb828889ee6ad0e48d7f40f4ec38818f4e4a8968b2b1af22e", size = 4806808, upload-time = "2026-10-16T22:18:01.188Z" }, + { url = "https://files.pythonhosted.org/packages/8e/ed/d504165ef79af6fafe25c76726cf30f544cc236002f7ed054f1d51adc4ff/pillow-13.0.0-pp312-pypy312_pp80-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:93ff9c9c3663ce23aaa5d0b6b6abac55359e2a0c06c7e30f3771829af816be63", size = 5464358, upload-time = "2026-10-16T22:18:02.779Z" }, + { url = "https://files.pythonhosted.org/packages/7b/fe/a10aba5503ca13e9e009b8bd0a1a4ce5584bdce246245fd6f3a83701369c/pillow-13.0.0-pp312-pypy312_pp80-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e65dd6e75de67b2362a4fa3e16aa627595f65054dc4ec73d64680c84d592fa61", size = 6043514, upload-time = "2026-10-16T22:18:04.538Z" }, + { url = "https://files.pythonhosted.org/packages/c0/37/66b12dc476041fe523bca29c9d58fbf1ea92a4eaf73acfb9e993948f1191/pillow-13.0.0-pp312-pypy312_pp80-win_amd64.whl", hash = "sha256:567f20f1c75897d7663830da6ea8af719e03d712b1d9ee7f813319f9ece42e5a", size = 7366030, upload-time = "2026-10-16T22:18:06.638Z" }, ] [[package]]