From ba7f9bba8626b595cff914828dfa70e7f912cae4 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 12 Jul 2019 12:14:02 +0200 Subject: [PATCH] Convert python static lists into tuples Signed-off-by: falkTX --- source/frontend/carla_database.py | 8 ++++---- source/frontend/ladspa_rdf.py | 2 +- source/frontend/patchcanvas.py | 4 ++-- source/frontend/patchcanvas/scene.py | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/frontend/carla_database.py b/source/frontend/carla_database.py index c11ff4673..639fe6c54 100755 --- a/source/frontend/carla_database.py +++ b/source/frontend/carla_database.py @@ -81,7 +81,7 @@ def findBinaries(binPath, pluginType, OS): extensions = (".so",) for root, dirs, files in os.walk(binPath): - for name in [name for name in files if name.lower().endswith(extensions)]: + for name in tuple(name for name in files if name.lower().endswith(extensions)): binaries.append(os.path.join(root, name)) return binaries @@ -90,7 +90,7 @@ def findVST3Binaries(binPath): binaries = [] for root, dirs, files in os.walk(binPath): - for name in [name for name in files if name.lower().endswith(".vst3")]: + for name in tuple(name for name in files if name.lower().endswith(".vst3")): binaries.append(os.path.join(root, name)) return binaries @@ -111,7 +111,7 @@ def findMacVSTBundles(bundlePath, isVST3): for root, dirs, files in os.walk(bundlePath, followlinks=True): #if root == bundlePath: continue # FIXME - for name in [name for name in dirs if name.lower().endswith(extension)]: + for name in tuple(name for name in dirs if name.lower().endswith(extension)): bundles.append(os.path.join(root, name)) return bundles @@ -125,7 +125,7 @@ def findFilenames(filePath, stype): return [] for root, dirs, files in os.walk(filePath): - for name in [name for name in files if name.lower().endswith(extensions)]: + for name in tuple(name for name in files if name.lower().endswith(extensions)): filenames.append(os.path.join(root, name)) return filenames diff --git a/source/frontend/ladspa_rdf.py b/source/frontend/ladspa_rdf.py index c10cc5ce6..94a144d04 100644 --- a/source/frontend/ladspa_rdf.py +++ b/source/frontend/ladspa_rdf.py @@ -697,7 +697,7 @@ def recheck_all_plugins(qobject, startValue, percentValue, curValue): # Get all RDF files for PATH in LADSPA_RDF_PATH: for root, dirs, files in os.walk(PATH): - for filename in [filename for filename in files if filename.lower().endswith(rdfExtensions)]: + for filename in tuple(filename for filename in files if filename.lower().endswith(rdfExtensions)): rdfFiles.append(os.path.join(root, filename)) # Parse all RDF files diff --git a/source/frontend/patchcanvas.py b/source/frontend/patchcanvas.py index e9bc1a81d..810279924 100644 --- a/source/frontend/patchcanvas.py +++ b/source/frontend/patchcanvas.py @@ -1362,7 +1362,7 @@ class PatchScene(QGraphicsScene): items = self.items(self.m_pointer_border) for item in items: - if item and item.type() in [CanvasLineType, CanvasBezierLineType]: + if item and item.type() in (CanvasLineType, CanvasBezierLineType): item.triggerDisconnect() QGraphicsScene.mousePressEvent(self, event) @@ -1392,7 +1392,7 @@ class PatchScene(QGraphicsScene): trail = QPolygonF([event.scenePos(), event.lastScenePos(), event.scenePos()]) items = self.items(trail) for item in items: - if item and item.type() in [CanvasLineType, CanvasBezierLineType]: + if item and item.type() in (CanvasLineType, CanvasBezierLineType): item.triggerDisconnect() QGraphicsScene.mouseMoveEvent(self, event) diff --git a/source/frontend/patchcanvas/scene.py b/source/frontend/patchcanvas/scene.py index 658e3ad74..84ba27971 100644 --- a/source/frontend/patchcanvas/scene.py +++ b/source/frontend/patchcanvas/scene.py @@ -287,7 +287,7 @@ class PatchScene(QGraphicsScene): items = self.items(self.m_pointer_border) for item in items: - if item and item.type() in [CanvasLineType, CanvasBezierLineType, CanvasPortType]: + if item and item.type() in (CanvasLineType, CanvasBezierLineType, CanvasPortType): item.triggerDisconnect() QGraphicsScene.mousePressEvent(self, event) @@ -296,9 +296,9 @@ class PatchScene(QGraphicsScene): if self.m_mouse_down_init: self.m_mouse_down_init = False topmost = self.itemAt(event.scenePos(), self.m_view.transform()) - self.m_mouse_rubberband = not (topmost and topmost.type() in [CanvasBoxType, + self.m_mouse_rubberband = not (topmost and topmost.type() in (CanvasBoxType, CanvasIconType, - CanvasPortType]) + CanvasPortType)) if self.m_mouse_rubberband: event.accept() @@ -325,7 +325,7 @@ class PatchScene(QGraphicsScene): trail = QPolygonF([event.scenePos(), event.lastScenePos(), event.scenePos()]) items = self.items(trail) for item in items: - if item and item.type() in [CanvasLineType, CanvasBezierLineType]: + if item and item.type() in (CanvasLineType, CanvasBezierLineType): item.triggerDisconnect() QGraphicsScene.mouseMoveEvent(self, event)