From 71a22c6a121d1294a05ef35020c525fa70cae2fd Mon Sep 17 00:00:00 2001 From: Brianna Rainey Date: Thu, 29 Jan 2026 14:50:29 -0500 Subject: v2.2.2 - fix flaky tests, fix UnboundLocalError in MainWindow.createNewProject (#94) * search more than one filename for compName * remove extra QVBoxLayout * insert default components using name instead of index * bump version 2.2.1 to 2.2.2 * tests do not use `.config` for settings Core.storeSettings() is no longer called as a side effect any time avp.core is imported. Thus the tests use a new `initCore` method and the normal user path now relies on entering via `cli.py`. This means certain toolkit functions (e.g., ones using `FFMPEG_BIN`) no longer work if imported from a different python script, unless they call Core.storeSettings() themselves to initialize the settings.ini file * fix UnboundLocalError in createNewProject--- src/avp/core.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/avp/core.py') diff --git a/src/avp/core.py b/src/avp/core.py index 099b0b4..1e9a9c3 100644 --- a/src/avp/core.py +++ b/src/avp/core.py @@ -420,14 +420,18 @@ class Core: Core.canceled = False @classmethod - def storeSettings(cls): + def storeSettings(cls, dataDir=None): """Store settings/paths to directories as class variables""" from .__init__ import wd from .toolkit.ffmpeg import findFfmpeg cls.wd = wd - dataDir = QtCore.QStandardPaths.writableLocation( - QtCore.QStandardPaths.StandardLocation.AppConfigLocation + dataDir = ( + QtCore.QStandardPaths.writableLocation( + QtCore.QStandardPaths.StandardLocation.AppConfigLocation + ) + if dataDir is None + else dataDir ) # Windows: C:/Users//AppData/Local/audio-visualizer # macOS: ~/Library/Preferences/audio-visualizer @@ -589,7 +593,3 @@ class Core: libLog.addHandler(libLogFile) # lowest level must be explicitly set on the root Logger libLog.setLevel(0) - - -# always store settings in class variables even if a Core object is not created -Core.storeSettings() -- cgit v1.2.3