From 08b5eb8d26ab9af1fbf744718acbf7ae155e842f Mon Sep 17 00:00:00 2001 From: John Haddon Date: Fri, 6 Sep 2024 15:40:30 +0100 Subject: [PATCH] Remove redundant `scoped = False` arguments to `Signal.connect[Front]()` --- apps/execute/execute-1.py | 2 +- .../TutorialStartupConfig1/index.md | 4 +- .../ClassVectorParameterValueWidget.py | 6 +- .../CompoundVectorParameterValueWidget.py | 6 +- python/GafferCortexUI/OpPathPreview.py | 2 +- python/GafferCortexUI/ParameterPresets.py | 2 +- python/GafferCortexUI/ParameterValueWidget.py | 2 +- .../GafferCortexUI/ParameterisedHolderUI.py | 2 +- python/GafferCyclesUI/CyclesOptionsUI.py | 2 +- python/GafferDispatch/LocalDispatcher.py | 2 +- python/GafferDispatchTest/DispatcherTest.py | 8 +-- .../GafferDispatchTest/LocalDispatcherTest.py | 4 +- python/GafferDispatchUI/DispatchDialogue.py | 6 +- python/GafferDispatchUI/DispatcherUI.py | 4 +- python/GafferDispatchUI/LocalJobs.py | 14 ++--- python/GafferDispatchUI/PythonCommandUI.py | 4 +- python/GafferDispatchUI/WedgeUI.py | 2 +- python/GafferImageTest/DisplayTest.py | 4 +- python/GafferImageUI/CatalogueUI.py | 34 +++++------ python/GafferImageUI/CreateViewsUI.py | 2 +- python/GafferImageUI/FormatPlugValueWidget.py | 2 +- python/GafferImageUI/ImageViewUI.py | 61 +++++++++---------- .../GafferImageUI/OpenColorIOConfigPlugUI.py | 2 +- python/GafferImageUI/OpenColorIOContextUI.py | 2 +- .../GafferImageUI/OpenColorIOTransformUI.py | 2 +- python/GafferOSLUI/OSLCodeUI.py | 12 ++-- python/GafferOSLUI/OSLExpressionEngineUI.py | 2 +- .../GafferSceneTest/InteractiveRenderTest.py | 2 +- python/GafferSceneUI/AttributeQueryUI.py | 6 +- python/GafferSceneUI/CameraUI.py | 2 +- python/GafferSceneUI/CropWindowToolUI.py | 4 +- python/GafferSceneUI/CryptomatteUI.py | 14 ++--- python/GafferSceneUI/CustomAttributesUI.py | 2 +- python/GafferSceneUI/DeleteGlobalsUI.py | 2 +- python/GafferSceneUI/DeleteRenderPassesUI.py | 2 +- python/GafferSceneUI/EditScopeUI.py | 6 +- python/GafferSceneUI/HierarchyView.py | 10 +-- python/GafferSceneUI/InstancerUI.py | 2 +- python/GafferSceneUI/InteractiveRenderUI.py | 12 ++-- python/GafferSceneUI/LightEditor.py | 6 +- python/GafferSceneUI/OptionQueryUI.py | 5 +- python/GafferSceneUI/OutputsUI.py | 8 +-- python/GafferSceneUI/PathFilterUI.py | 12 ++-- .../GafferSceneUI/PrimitiveVariableQueryUI.py | 5 +- python/GafferSceneUI/RenderPassEditor.py | 32 +++++----- python/GafferSceneUI/RenderPassesUI.py | 4 +- python/GafferSceneUI/SceneHistoryUI.py | 6 +- python/GafferSceneUI/SceneInspector.py | 45 +++++++------- .../GafferSceneUI/ScenePathPlugValueWidget.py | 2 +- python/GafferSceneUI/SceneReaderUI.py | 2 +- python/GafferSceneUI/SceneViewUI.py | 14 ++--- python/GafferSceneUI/SetEditor.py | 14 ++--- .../SetExpressionPlugValueWidget.py | 2 +- python/GafferSceneUI/SetFilterUI.py | 8 +-- python/GafferSceneUI/SetUI.py | 2 +- python/GafferSceneUI/SetVisualiserUI.py | 6 +- python/GafferSceneUI/ShaderQueryUI.py | 7 +-- python/GafferSceneUI/ShaderTweakProxyUI.py | 2 +- python/GafferSceneUI/ShaderTweaksUI.py | 4 +- python/GafferSceneUI/ShaderUI.py | 14 ++--- python/GafferSceneUI/ShaderViewUI.py | 2 +- python/GafferSceneUI/TransformToolUI.py | 6 +- python/GafferSceneUI/UVInspector.py | 12 ++-- python/GafferSceneUI/_HistoryWindow.py | 12 ++-- python/GafferSceneUI/_InspectorColumn.py | 8 +-- python/GafferSceneUI/_SceneViewInspector.py | 18 +++--- python/GafferTest/BlockedConnectionTest.py | 4 +- python/GafferTest/ChildSetTest.py | 4 +- python/GafferTest/CompoundPathFilterTest.py | 4 +- python/GafferTest/ContextTest.py | 4 +- python/GafferTest/DependencyNodeTest.py | 4 +- python/GafferTest/ExpressionTest.py | 4 +- python/GafferTest/GraphComponentTest.py | 22 +++---- python/GafferTest/LoopTest.py | 4 +- python/GafferTest/MetadataTest.py | 2 +- python/GafferTest/NodeTest.py | 2 +- python/GafferTest/NumericBookmarkSetTest.py | 4 +- python/GafferTest/PathFilterTest.py | 2 +- python/GafferTest/PathTest.py | 4 +- python/GafferTest/PlugTest.py | 8 +-- python/GafferTest/ReferenceTest.py | 2 +- python/GafferTest/ScriptNodeTest.py | 6 +- python/GafferTest/SplinePlugTest.py | 2 +- python/GafferTest/SpreadsheetTest.py | 4 +- python/GafferTest/StandardSetTest.py | 8 +-- python/GafferTest/ValuePlugTest.py | 6 +- python/GafferUI/AboutWindow.py | 2 +- python/GafferUI/AnimationEditor.py | 42 ++++++------- python/GafferUI/AnimationUI.py | 2 +- python/GafferUI/AnnotationsUI.py | 8 +-- python/GafferUI/ApplicationMenu.py | 4 +- python/GafferUI/BackgroundTaskDialogue.py | 4 +- python/GafferUI/Backups.py | 2 +- python/GafferUI/BoolPlugValueWidget.py | 2 +- python/GafferUI/BoxUI.py | 4 +- python/GafferUI/BrowserEditor.py | 2 +- python/GafferUI/Button.py | 4 +- python/GafferUI/ButtonPlugValueWidget.py | 2 +- python/GafferUI/CodeWidget.py | 6 +- python/GafferUI/CollectUI.py | 12 ++-- python/GafferUI/ColorChooser.py | 27 ++++---- .../GafferUI/ColorChooserPlugValueWidget.py | 2 +- python/GafferUI/ColorPlugValueWidget.py | 4 +- python/GafferUI/ColorSwatchPlugValueWidget.py | 18 +++--- python/GafferUI/CompoundEditor.py | 27 ++++---- python/GafferUI/CompoundNumericNoduleUI.py | 2 +- .../CompoundNumericPlugValueWidget.py | 4 +- python/GafferUI/CompoundPathPreview.py | 2 +- python/GafferUI/ConnectionPlugValueWidget.py | 8 +-- python/GafferUI/ContextQueryUI.py | 5 +- python/GafferUI/DotUI.py | 4 +- python/GafferUI/EditScopeUI.py | 20 +++--- python/GafferUI/Editor.py | 6 +- python/GafferUI/EventLoop.py | 2 +- python/GafferUI/ExpressionUI.py | 12 ++-- .../GafferUI/FileSequencePathFilterWidget.py | 2 +- python/GafferUI/GLWidget.py | 2 +- python/GafferUI/GadgetWidget.py | 38 ++++++------ python/GafferUI/GraphBookmarksUI.py | 2 +- python/GafferUI/GraphEditor.py | 18 +++--- python/GafferUI/InfoPathFilterWidget.py | 6 +- python/GafferUI/LabelPlugValueWidget.py | 6 +- python/GafferUI/LoopUI.py | 2 +- .../GafferUI/MatchPatternPathFilterWidget.py | 8 +-- python/GafferUI/MenuBar.py | 4 +- python/GafferUI/MessageWidget.py | 32 +++++----- python/GafferUI/MetadataWidget.py | 14 ++--- .../MultiLineStringPlugValueWidget.py | 2 +- python/GafferUI/MultiLineTextWidget.py | 14 ++--- python/GafferUI/NameLabel.py | 6 +- python/GafferUI/NameSwitchUI.py | 18 +++--- python/GafferUI/NameValuePlugValueWidget.py | 2 +- python/GafferUI/NameWidget.py | 2 +- python/GafferUI/NodeEditor.py | 2 +- python/GafferUI/NodeFinderDialogue.py | 16 ++--- python/GafferUI/NodeSetEditor.py | 4 +- python/GafferUI/NotificationMessageHandler.py | 2 +- python/GafferUI/NumericPlugValueWidget.py | 4 +- python/GafferUI/NumericWidget.py | 14 ++--- python/GafferUI/PathChooserDialogue.py | 8 +-- python/GafferUI/PathChooserWidget.py | 20 +++--- python/GafferUI/PathFilterWidget.py | 4 +- python/GafferUI/PathListingWidget.py | 16 ++--- python/GafferUI/PathPlugValueWidget.py | 4 +- .../GafferUI/PathVectorDataPlugValueWidget.py | 2 +- python/GafferUI/PathVectorDataWidget.py | 6 +- python/GafferUI/PathWidget.py | 6 +- python/GafferUI/PlugLayout.py | 16 +++-- python/GafferUI/PlugPopup.py | 4 +- python/GafferUI/PlugValueWidget.py | 13 ++-- python/GafferUI/PlugWidget.py | 6 +- python/GafferUI/PopupWindow.py | 2 +- python/GafferUI/PythonEditor.py | 8 +-- python/GafferUI/RampPlugValueWidget.py | 8 +-- python/GafferUI/RandomChoiceUI.py | 2 +- python/GafferUI/RandomUI.py | 2 +- python/GafferUI/ReferenceUI.py | 8 +-- python/GafferUI/RefreshPlugValueWidget.py | 2 +- python/GafferUI/ScriptWindow.py | 6 +- python/GafferUI/ShufflePlugValueWidget.py | 2 +- python/GafferUI/Slider.py | 16 ++--- python/GafferUI/SplinePlugValueWidget.py | 6 +- python/GafferUI/SpreadsheetUI/_Menus.py | 4 +- .../GafferUI/SpreadsheetUI/_PlugTableView.py | 20 +++--- .../SpreadsheetUI/_RowsPlugValueWidget.py | 32 +++++----- .../GafferUI/SpreadsheetUI/_SectionChooser.py | 7 +-- python/GafferUI/SpreadsheetUI/__init__.py | 2 +- python/GafferUI/StringPlugValueWidget.py | 6 +- python/GafferUI/TabbedContainer.py | 6 +- python/GafferUI/TextInputDialogue.py | 2 +- python/GafferUI/TextWidget.py | 8 +-- python/GafferUI/Timeline.py | 22 +++---- python/GafferUI/UIEditor.py | 38 ++++++------ python/GafferUI/UserPlugs.py | 4 +- python/GafferUI/VectorDataPlugValueWidget.py | 2 +- python/GafferUI/VectorDataWidget.py | 34 +++++------ python/GafferUI/ViewUI.py | 2 +- python/GafferUI/Viewer.py | 10 +-- python/GafferUI/Window.py | 4 +- python/GafferUI/_PlugAdder.py | 4 +- python/GafferUI/_Pointer.py | 2 +- python/GafferUITest/AnnotationsGadgetTest.py | 2 +- python/GafferUITest/BoolWidgetTest.py | 2 +- python/GafferUITest/CollapsibleTest.py | 2 +- python/GafferUITest/ContextTrackerTest.py | 2 +- .../GafferUITest/EventSignalCombinerTest.py | 12 ++-- python/GafferUITest/GadgetTest.py | 8 +-- python/GafferUITest/GraphEditorTest.py | 2 +- python/GafferUITest/GraphGadgetTest.py | 2 +- python/GafferUITest/NodeSetEditorTest.py | 4 +- python/GafferUITest/ScriptWindowTest.py | 2 +- python/GafferUITest/SelectionMenuTest.py | 2 +- python/GafferUITest/TextWidgetTest.py | 2 +- python/GafferUITest/WidgetSignalTest.py | 2 +- python/GafferUITest/WidgetTest.py | 4 +- python/GafferUITest/WindowTest.py | 8 +-- .../GafferImage/createViewsCompatibility.py | 4 +- startup/gui/editor.py | 4 +- startup/gui/graphEditor.py | 20 +++--- startup/gui/localDispatcher.py | 4 +- startup/gui/nodeEditor.py | 4 +- startup/gui/ocio.py | 2 +- startup/gui/outputs.py | 2 +- startup/gui/performanceMonitor.py | 2 +- startup/gui/project.py | 2 +- startup/gui/pythonEditor.py | 2 +- startup/gui/viewer.py | 8 +-- 207 files changed, 771 insertions(+), 791 deletions(-) diff --git a/apps/execute/execute-1.py b/apps/execute/execute-1.py index 56701fea504..41a6d45f728 100644 --- a/apps/execute/execute-1.py +++ b/apps/execute/execute-1.py @@ -171,7 +171,7 @@ def _run( self, args ) : with context : for node in nodes : - node.errorSignal().connect( Gaffer.WeakMethod( self.__error ), scoped = False ) + node.errorSignal().connect( Gaffer.WeakMethod( self.__error ) ) try : node["task"].executeSequence( frames ) except Exception as exception : diff --git a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig1/index.md b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig1/index.md index bdee6a5eb5a..ca2fd5f62b8 100644 --- a/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig1/index.md +++ b/doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig1/index.md @@ -64,7 +64,7 @@ Copy this code to a new a `customVariables.py` file in `~/gaffer/startup/gui`: Gaffer.MetadataAlgo.setReadOnly( variables["projectResources"]["name"], True ) - application.root()["scripts"].childAddedSignal().connect( __scriptAdded, scoped = False ) + application.root()["scripts"].childAddedSignal().connect( __scriptAdded ) ``` Let's break down what's going on here. @@ -125,7 +125,7 @@ We wrap up the config by adding our function to an event signal that fires when .. code-block:: python :lineno-start: 17 - application.root()["scripts"].childAddedSignal().connect( __scriptAdded, scoped = False ) + application.root()["scripts"].childAddedSignal().connect( __scriptAdded ) ``` Notice the use of the `application` variable. This is a special variable that refers to the startup config's parent application. diff --git a/python/GafferCortexUI/ClassVectorParameterValueWidget.py b/python/GafferCortexUI/ClassVectorParameterValueWidget.py index 90d6e4afcaa..3967a123fcd 100644 --- a/python/GafferCortexUI/ClassVectorParameterValueWidget.py +++ b/python/GafferCortexUI/ClassVectorParameterValueWidget.py @@ -240,7 +240,7 @@ def _headerWidget( self ) : with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal ) as result : collapseButton = GafferUI.Button( image = "collapsibleArrowRight.png", hasFrame=False ) - collapseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__collapseButtonClicked ), scoped = False ) + collapseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__collapseButtonClicked ) ) GafferUI.Spacer( imath.V2i( 2 ) ) @@ -293,8 +293,8 @@ def _headerWidget( self ) : self.__parameterHandler.childParameterHandler( self.__parameterHandler.parameter()["label"] ), ), ) - self.__label.buttonPressSignal().connect( Gaffer.WeakMethod( self.__labelButtonPress ), scoped = False ) - self.getPlug().node().plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ), scoped = False ) + self.__label.buttonPressSignal().connect( Gaffer.WeakMethod( self.__labelButtonPress ) ) + self.getPlug().node().plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ) ) # parameters after the label for parameter in headerParameters : diff --git a/python/GafferCortexUI/CompoundVectorParameterValueWidget.py b/python/GafferCortexUI/CompoundVectorParameterValueWidget.py index b58e6f7a672..ebb506a55bf 100644 --- a/python/GafferCortexUI/CompoundVectorParameterValueWidget.py +++ b/python/GafferCortexUI/CompoundVectorParameterValueWidget.py @@ -97,8 +97,8 @@ def _headerWidget( self ) : sizeEditable = sizeEditable, ) - self.__vectorDataWidget.editSignal().connect( Gaffer.WeakMethod( self.__edit ), scoped = False ) - self.__vectorDataWidget.dataChangedSignal().connect( Gaffer.WeakMethod( self.__dataChanged ), scoped = False ) + self.__vectorDataWidget.editSignal().connect( Gaffer.WeakMethod( self.__edit ) ) + self.__vectorDataWidget.dataChangedSignal().connect( Gaffer.WeakMethod( self.__dataChanged ) ) self._requestUpdateFromValues() @@ -302,4 +302,4 @@ def __parameterPopupMenu( menuDefinition, parameterValueWidget ) : }, ) -GafferCortexUI.ParameterValueWidget.popupMenuSignal().connect( __parameterPopupMenu, scoped = False ) +GafferCortexUI.ParameterValueWidget.popupMenuSignal().connect( __parameterPopupMenu ) diff --git a/python/GafferCortexUI/OpPathPreview.py b/python/GafferCortexUI/OpPathPreview.py index 13301f977ff..e70a34dedc8 100644 --- a/python/GafferCortexUI/OpPathPreview.py +++ b/python/GafferCortexUI/OpPathPreview.py @@ -55,7 +55,7 @@ def __init__( self, path ) : # we'll replace this with the op in _deferredUpdate() GafferUI.Spacer( imath.V2i( 1 ) ) button = GafferUI.Button( "Launch" ) - button.clickedSignal().connect( Gaffer.WeakMethod( self.__executeClicked ), scoped = False ) + button.clickedSignal().connect( Gaffer.WeakMethod( self.__executeClicked ) ) self._updateFromPath() diff --git a/python/GafferCortexUI/ParameterPresets.py b/python/GafferCortexUI/ParameterPresets.py index 47ff1c9c803..2233f3926a1 100644 --- a/python/GafferCortexUI/ParameterPresets.py +++ b/python/GafferCortexUI/ParameterPresets.py @@ -502,4 +502,4 @@ def __parameterPopupMenu( menuDefinition, parameterValueWidget ) : menuDefinition.append( "/Load Preset...", { "command" : IECore.curry( __loadPreset, parameterHandler ), "active" : editable } ) menuDefinition.append( "/Delete Presets...", { "command" : IECore.curry( __deletePresets, parameterHandler ) } ) -GafferCortexUI.ParameterValueWidget.popupMenuSignal().connect( __parameterPopupMenu, scoped = False ) +GafferCortexUI.ParameterValueWidget.popupMenuSignal().connect( __parameterPopupMenu ) diff --git a/python/GafferCortexUI/ParameterValueWidget.py b/python/GafferCortexUI/ParameterValueWidget.py index 3a5c5a716de..c9812b25f68 100644 --- a/python/GafferCortexUI/ParameterValueWidget.py +++ b/python/GafferCortexUI/ParameterValueWidget.py @@ -142,7 +142,7 @@ def __plugPopupMenu( menuDefinition, plugValueWidget ) : ParameterValueWidget.popupMenuSignal()( menuDefinition, parameterValueWidget ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) # add menu items for presets diff --git a/python/GafferCortexUI/ParameterisedHolderUI.py b/python/GafferCortexUI/ParameterisedHolderUI.py index d02d8e5c120..a65d22a55b3 100644 --- a/python/GafferCortexUI/ParameterisedHolderUI.py +++ b/python/GafferCortexUI/ParameterisedHolderUI.py @@ -103,7 +103,7 @@ def __init__( self, node ) : self.__node = node self.__window = None - self.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ), scoped = False ) + self.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ) ) def getToolTip( self ) : diff --git a/python/GafferCyclesUI/CyclesOptionsUI.py b/python/GafferCyclesUI/CyclesOptionsUI.py index 1dfd883a0ff..d10a7d21d5d 100644 --- a/python/GafferCyclesUI/CyclesOptionsUI.py +++ b/python/GafferCyclesUI/CyclesOptionsUI.py @@ -1489,7 +1489,7 @@ def __init__( self, plugs, **kw ) : GafferUI.PresetsPlugValueWidget.__init__( self, plugs, **kw ) - self.getPlug().node().plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ), scoped = False ) + self.getPlug().node().plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ) ) def __plugSet( self, plug ) : diff --git a/python/GafferDispatch/LocalDispatcher.py b/python/GafferDispatch/LocalDispatcher.py index a58e508042a..388a731beeb 100644 --- a/python/GafferDispatch/LocalDispatcher.py +++ b/python/GafferDispatch/LocalDispatcher.py @@ -108,7 +108,7 @@ def __init__( self, batch, dispatcher ) : self.__messageHandler = _MessageHandler() self.__messagesChangedSignal = Gaffer.Signal1() - self.__messageHandler.messagesChangedSignal().connect( Gaffer.WeakMethod( self.__messagesChanged, fallbackResult = None ), scoped = False ) + self.__messageHandler.messagesChangedSignal().connect( Gaffer.WeakMethod( self.__messagesChanged, fallbackResult = None ) ) self.__initBatchWalk( batch ) diff --git a/python/GafferDispatchTest/DispatcherTest.py b/python/GafferDispatchTest/DispatcherTest.py index 14ff232d734..dc17a9d1df7 100644 --- a/python/GafferDispatchTest/DispatcherTest.py +++ b/python/GafferDispatchTest/DispatcherTest.py @@ -2274,7 +2274,7 @@ def testPostDispatchSignalSuccess( self ) : self.assertEqual( postDispatchSlot[0], ( script["dispatcher"], True ) ) preDispatchConnection = GafferDispatch.Dispatcher.preDispatchSignal().connect( - lambda dispatcher : True, scoped = False + lambda dispatcher : True ) script["dispatcher"]["task"].execute() @@ -2300,17 +2300,17 @@ def testDispatchSignalShutdownCrash( self ) : subprocess.check_call( [ Gaffer.executablePath(), "env", "python", "-c", - """import GafferDispatch; GafferDispatch.Dispatcher.preDispatchSignal().connect( lambda d : True, scoped = False )""" + """import GafferDispatch; GafferDispatch.Dispatcher.preDispatchSignal().connect( lambda d : True )""" ] ) subprocess.check_call( [ Gaffer.executablePath(), "env", "python", "-c", - """import GafferDispatch; GafferDispatch.Dispatcher.dispatchSignal().connect( lambda d : None, scoped = False )""" + """import GafferDispatch; GafferDispatch.Dispatcher.dispatchSignal().connect( lambda d : None )""" ] ) subprocess.check_call( [ Gaffer.executablePath(), "env", "python", "-c", - """import GafferDispatch; GafferDispatch.Dispatcher.postDispatchSignal().connect( lambda d, s : None, scoped = False )""" + """import GafferDispatch; GafferDispatch.Dispatcher.postDispatchSignal().connect( lambda d, s : None )""" ] ) def testAccessTaskNodeInSetupPlugs( self ) : diff --git a/python/GafferDispatchTest/LocalDispatcherTest.py b/python/GafferDispatchTest/LocalDispatcherTest.py index 29aa64196fd..38b85b70ed6 100644 --- a/python/GafferDispatchTest/LocalDispatcherTest.py +++ b/python/GafferDispatchTest/LocalDispatcherTest.py @@ -1069,9 +1069,9 @@ def statusChanged( job ) : def jobAdded( job ) : - job.statusChangedSignal().connect( statusChanged, scoped = False ) + job.statusChangedSignal().connect( statusChanged ) - script["dispatcher"].jobPool().jobAddedSignal().connect( jobAdded, scoped = False ) + script["dispatcher"].jobPool().jobAddedSignal().connect( jobAdded ) # Test foreground dispatch diff --git a/python/GafferDispatchUI/DispatchDialogue.py b/python/GafferDispatchUI/DispatchDialogue.py index 327b25f06d8..854bcfe1cef 100644 --- a/python/GafferDispatchUI/DispatchDialogue.py +++ b/python/GafferDispatchUI/DispatchDialogue.py @@ -104,7 +104,7 @@ def __init__( self, tasks, dispatchers, nodesToShow, postDispatchBehaviour=PostD self.__dispatchersMenu = GafferUI.MultiSelectionMenu( allowMultipleSelection = False, allowEmptySelection = False ) self.__dispatchersMenu.append( [ x.getName() for x in self.__dispatchers ] ) self.__dispatchersMenu.setSelection( [ self.__dispatchers[0].getName() ] ) - self.__dispatchersMenu.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__dispatcherChanged ), scoped = False ) + self.__dispatchersMenu.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__dispatcherChanged ) ) dispatcherMenuColumn.setVisible( len(self.__dispatchers) > 1 ) self.__dispatcherFrame = GafferUI.Frame( borderStyle=GafferUI.Frame.BorderStyle.None_, borderWidth=0 ) @@ -125,10 +125,10 @@ def __init__( self, tasks, dispatchers, nodesToShow, postDispatchBehaviour=PostD self.__messageWidget = GafferUI.MessageWidget( toolbars = True ) # connect to the collapsible state change so we can increase the window # size when the details pane is first shown. - self.__messageCollapsibleConnection = self.__messageCollapsible.stateChangedSignal().connect( Gaffer.WeakMethod( self.__messageCollapsibleChanged ), scoped = False ) + self.__messageCollapsibleConnection = self.__messageCollapsible.stateChangedSignal().connect( Gaffer.WeakMethod( self.__messageCollapsibleChanged ) ) self.__backButton = self._addButton( "Back" ) - self.__backButton.clickedSignal().connectFront( Gaffer.WeakMethod( self.__initiateSettings ), scoped = False ) + self.__backButton.clickedSignal().connectFront( Gaffer.WeakMethod( self.__initiateSettings ) ) self.__primaryButton = self._addButton( "Dispatch" ) diff --git a/python/GafferDispatchUI/DispatcherUI.py b/python/GafferDispatchUI/DispatcherUI.py index e0245564167..4854f6c1a41 100644 --- a/python/GafferDispatchUI/DispatcherUI.py +++ b/python/GafferDispatchUI/DispatcherUI.py @@ -203,7 +203,7 @@ def __init__( self, node, **kw ) : GafferUI.Button.__init__( self, "Dispatch", **kw ) self.__node = node - self.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ), scoped = False ) + self.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ) ) def __clicked( self, button ) : @@ -283,7 +283,7 @@ def __init__( self, node, **kw ) : # Dummy `gaffer://...` URL is sufficient to trigger `linkActivatedSignal`, which is all we need. f'Create a dispatcher to execute this node', ) - label.linkActivatedSignal().connect( Gaffer.WeakMethod( self.__linkActivated ), scoped = False ) + label.linkActivatedSignal().connect( Gaffer.WeakMethod( self.__linkActivated ) ) GafferUI.Spacer( size = imath.V2i( 0 ), parenting = { "expand" : True } ) diff --git a/python/GafferDispatchUI/LocalJobs.py b/python/GafferDispatchUI/LocalJobs.py index 514dd1eb5a4..0310c53f29a 100644 --- a/python/GafferDispatchUI/LocalJobs.py +++ b/python/GafferDispatchUI/LocalJobs.py @@ -222,14 +222,14 @@ def __init__( self, scriptNode, **kw ) : selectionMode = GafferUI.PathListingWidget.SelectionMode.Rows, ) self.__jobListingWidget._qtWidget().header().setSortIndicator( 1, QtCore.Qt.AscendingOrder ) - self.__jobListingWidget.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__jobSelectionChanged ), scoped = False ) + self.__jobListingWidget.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__jobSelectionChanged ) ) with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing=5 ) : GafferUI.Spacer( imath.V2i( 0 ), parenting = { "expand" : True } ) self.__killButton = GafferUI.Button( "Kill Selected Jobs" ) - self.__killButton.clickedSignal().connect( Gaffer.WeakMethod( self.__killClicked ), scoped = False ) + self.__killButton.clickedSignal().connect( Gaffer.WeakMethod( self.__killClicked ) ) self.__removeButton = GafferUI.Button( "Remove Selected Jobs" ) - self.__removeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__removeClicked ), scoped = False ) + self.__removeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__removeClicked ) ) with GafferUI.TabbedContainer() : @@ -255,14 +255,14 @@ def __init__( self, scriptNode, **kw ) : # Connecting to the JobPool and Job signals allows us to update our PathListingWidget # immediately when jobs are added and removed or their status changes. - jobPool.jobAddedSignal().connect( Gaffer.WeakMethod( self.__jobAdded ), scoped = False ) - jobPool.jobRemovedSignal().connect( Gaffer.WeakMethod( self.__jobRemoved ), scoped = False ) + jobPool.jobAddedSignal().connect( Gaffer.WeakMethod( self.__jobAdded ) ) + jobPool.jobRemovedSignal().connect( Gaffer.WeakMethod( self.__jobRemoved ) ) # But we also want to perform periodic updates to sample CPU/memory statistics, which # we do using this timer. self.__statisticsTimer = QtCore.QTimer() self.__statisticsTimer.timeout.connect( Gaffer.WeakMethod( self.__statisticsTimeout ) ) - self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ), scoped = False ) + self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ) ) self.__updateButtons() @@ -280,7 +280,7 @@ def __visibilityChanged( self, widget ) : def __jobAdded( self, job ) : assert( threading.current_thread() is threading.main_thread() ) - job.statusChangedSignal().connect( Gaffer.WeakMethod( self.__jobStatusChanged ), scoped = False ) + job.statusChangedSignal().connect( Gaffer.WeakMethod( self.__jobStatusChanged ) ) self.__jobListingWidget.getPath()._emitPathChanged() def __jobRemoved( self, job ) : diff --git a/python/GafferDispatchUI/PythonCommandUI.py b/python/GafferDispatchUI/PythonCommandUI.py index a19f32e3a0e..a444c2e4c45 100644 --- a/python/GafferDispatchUI/PythonCommandUI.py +++ b/python/GafferDispatchUI/PythonCommandUI.py @@ -141,13 +141,13 @@ def __init__( self, plug, **kw ) : self.__codeWidget.setHighlighter( GafferUI.CodeWidget.PythonHighlighter() ) self.__codeWidget.setCommentPrefix( "#" ) - self.__codeWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValue ), scoped = False ) + self.__codeWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValue ) ) self._addPopupMenu( self.__codeWidget ) node = self.__pythonCommandNode() if node is not None : - node.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__pythonCommandPlugDirtied ), scoped = False ) + node.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__pythonCommandPlugDirtied ) ) self.__updateCompleter() def _updateFromValues( self, values, exception ) : diff --git a/python/GafferDispatchUI/WedgeUI.py b/python/GafferDispatchUI/WedgeUI.py index f3edcb676bd..db3ba039c09 100644 --- a/python/GafferDispatchUI/WedgeUI.py +++ b/python/GafferDispatchUI/WedgeUI.py @@ -309,7 +309,7 @@ def __init__( self, previewWidget, node, **kw ) : previewWidget.setToolTip( "The values generated by the wedge" ) self.__node = node - node.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__plugDirtied ), scoped = False ) + node.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__plugDirtied ) ) def node( self ) : diff --git a/python/GafferImageTest/DisplayTest.py b/python/GafferImageTest/DisplayTest.py index f4ab0d99097..ffa70dd8b3c 100644 --- a/python/GafferImageTest/DisplayTest.py +++ b/python/GafferImageTest/DisplayTest.py @@ -323,12 +323,12 @@ def testSignalShutdownCrash( self ) : subprocess.check_call( [ Gaffer.executablePath(), "env", "python", "-c", - """import GafferImage; GafferImage.Display.driverCreatedSignal().connect( lambda d, p : None, scoped = False )""" + """import GafferImage; GafferImage.Display.driverCreatedSignal().connect( lambda d, p : None )""" ] ) subprocess.check_call( [ Gaffer.executablePath(), "env", "python", "-c", - """import GafferImage; GafferImage.Display.imageReceivedSignal().connect( lambda p : None, scoped = False )""" + """import GafferImage; GafferImage.Display.imageReceivedSignal().connect( lambda p : None )""" ] ) def __testTransferImage( self, fileName ) : diff --git a/python/GafferImageUI/CatalogueUI.py b/python/GafferImageUI/CatalogueUI.py index b2d70025c6b..66cb9077960 100644 --- a/python/GafferImageUI/CatalogueUI.py +++ b/python/GafferImageUI/CatalogueUI.py @@ -316,8 +316,8 @@ def __init__( self, title ) : Column.__init__( self, title ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) def headerData( self, canceller = None ) : @@ -492,7 +492,7 @@ def addCatalogueHotkeys( editor ) : if not isinstance( editor, GafferUI.Viewer ) : return - editor.keyPressSignal().connect( __viewerKeyPress, scoped = False ) + editor.keyPressSignal().connect( __viewerKeyPress ) def __viewerKeyPress( viewer, event ) : @@ -739,47 +739,47 @@ def __init__( self, plug, **kw ) : self.__pathListing.setDragPointer( "" ) self.__pathListing.setHeaderVisible( True ) self.__pathListing.selectionChangedSignal().connect( - Gaffer.WeakMethod( self.__pathListingSelectionChanged ), scoped = False + Gaffer.WeakMethod( self.__pathListingSelectionChanged ) ) self.__pathListing.dragEnterSignal().connect( - Gaffer.WeakMethod( self.__pathListingDragEnter ), scoped = False + Gaffer.WeakMethod( self.__pathListingDragEnter ) ) self.__pathListing.dragLeaveSignal().connect( - Gaffer.WeakMethod( self.__pathListingDragLeave ), scoped = False + Gaffer.WeakMethod( self.__pathListingDragLeave ) ) self.__pathListing.dragMoveSignal().connect( - Gaffer.WeakMethod( self.__pathListingDragMove ), scoped = False + Gaffer.WeakMethod( self.__pathListingDragMove ) ) self.__pathListing.dropSignal().connect( - Gaffer.WeakMethod( self.__pathListingDrop ), scoped = False + Gaffer.WeakMethod( self.__pathListingDrop ) ) self.__pathListing.getPath().pathChangedSignal().connect( - Gaffer.WeakMethod( self.__pathChanged ), scoped = False + Gaffer.WeakMethod( self.__pathChanged ) ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) as self.__buttonRow : addButton = GafferUI.Button( image = "pathChooser.png", hasFrame = False, toolTip = "Load image" ) - addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addClicked ), scoped = False ) + addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addClicked ) ) self.__duplicateButton = GafferUI.Button( image = "duplicate.png", hasFrame = False, toolTip = "Duplicate selected image, hold alt to view copy. [Ctrl-D]" ) self.__duplicateButton.setEnabled( False ) - self.__duplicateButton.clickedSignal().connect( Gaffer.WeakMethod( self.__duplicateClicked ), scoped = False ) + self.__duplicateButton.clickedSignal().connect( Gaffer.WeakMethod( self.__duplicateClicked ) ) self.__exportButton = GafferUI.Button( image = "export.png", hasFrame = False, toolTip = "Export selected image" ) self.__exportButton.setEnabled( False ) - self.__exportButton.clickedSignal().connect( Gaffer.WeakMethod( self.__exportClicked ), scoped = False ) + self.__exportButton.clickedSignal().connect( Gaffer.WeakMethod( self.__exportClicked ) ) self.__extractButton = GafferUI.Button( image = "extract.png", hasFrame = False, toolTip = "Create CatalogueSelect node for selected image" ) self.__extractButton.setEnabled( False ) - self.__extractButton.clickedSignal().connect( Gaffer.WeakMethod( self.__extractClicked ), scoped = False ) + self.__extractButton.clickedSignal().connect( Gaffer.WeakMethod( self.__extractClicked ) ) GafferUI.Spacer( imath.V2i( 0 ), parenting = { "expand" : True } ) self.__removeButton = GafferUI.Button( image = "delete.png", hasFrame = False, toolTip = "Remove selected image [Delete]" ) self.__removeButton.setEnabled( False ) - self.__removeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__removeClicked ), scoped = False ) + self.__removeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__removeClicked ) ) GafferUI.Spacer( size = imath.V2i( 2 ) ) @@ -800,9 +800,9 @@ def __init__( self, plug, **kw ) : self.__mergeGroupId = 0 - Gaffer.Metadata.plugValueChangedSignal( plug.node() ).connect( Gaffer.WeakMethod( self.__plugMetadataValueChanged ), scoped = False ) + Gaffer.Metadata.plugValueChangedSignal( plug.node() ).connect( Gaffer.WeakMethod( self.__plugMetadataValueChanged ) ) - self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ), scoped = False ) + self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ) ) def buttonRow( self ): diff --git a/python/GafferImageUI/CreateViewsUI.py b/python/GafferImageUI/CreateViewsUI.py index 96b53d309db..180b41ce06b 100644 --- a/python/GafferImageUI/CreateViewsUI.py +++ b/python/GafferImageUI/CreateViewsUI.py @@ -130,7 +130,7 @@ def __init__( self, plug ) : GafferUI.Spacer( imath.V2i( GafferUI.PlugWidget.labelWidth(), 1 ) ) self.__button = GafferUI.Button( image = "plus.png", hasFrame = False ) - self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand" : True } ) diff --git a/python/GafferImageUI/FormatPlugValueWidget.py b/python/GafferImageUI/FormatPlugValueWidget.py index 74f2b3d8652..e7927fecebe 100644 --- a/python/GafferImageUI/FormatPlugValueWidget.py +++ b/python/GafferImageUI/FormatPlugValueWidget.py @@ -76,7 +76,7 @@ def __init__( self, plugs, **kw ) : # sensitive to context changes and omits calls to `_updateFromValues()`. But the default # format mechanism uses the context, so we must arrange to do updates ourselves when # necessary. - self.context().changedSignal().connect( Gaffer.WeakMethod( self.__contextChanged ), scoped = False ) + self.context().changedSignal().connect( Gaffer.WeakMethod( self.__contextChanged ) ) self._addPopupMenu( self.__menuButton ) diff --git a/python/GafferImageUI/ImageViewUI.py b/python/GafferImageUI/ImageViewUI.py index e9ba67cedd8..8660071329a 100644 --- a/python/GafferImageUI/ImageViewUI.py +++ b/python/GafferImageUI/ImageViewUI.py @@ -275,9 +275,9 @@ def __init__( self, label, **kw ) : GafferUI.Spacer( size = imath.V2i( 0 ) ) - self.__swatch.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.__swatch.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.__swatch.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + self.__swatch.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.__swatch.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.__swatch.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) self.setColor( imath.Color4f( 0, 0, 0, 1 ) ) @@ -367,7 +367,7 @@ def __init__( self, plug, **kw ) : button = GafferUI.MenuButton( "", "plus.png", hasFrame=False, menu = GafferUI.Menu( m, title = "Add Color Inspector" ) ) else: button = GafferUI.Button( "", "delete.png", hasFrame=False ) - button.clickedSignal().connect( Gaffer.WeakMethod( self.__deleteClick ), scoped = False ) + button.clickedSignal().connect( Gaffer.WeakMethod( self.__deleteClick ) ) self.__pixel = imath.V2f( 0 ) @@ -376,19 +376,19 @@ def __init__( self, plug, **kw ) : if plug.getName() == "ColorInspectorPlug": viewportGadget = plug.node().viewportGadget() - viewportGadget.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ), scoped = False ) - viewportGadget.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - viewportGadget.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) - viewportGadget.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - viewportGadget.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - viewportGadget.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - viewportGadget.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + viewportGadget.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ) ) + viewportGadget.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + viewportGadget.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) + viewportGadget.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + viewportGadget.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + viewportGadget.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + viewportGadget.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) - plug.node()["colorInspector"]["evaluator"]["pixelColor"].getInput().node().plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__updateFromImageNode ), scoped = False ) + plug.node()["colorInspector"]["evaluator"]["pixelColor"].getInput().node().plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__updateFromImageNode ) ) - plug.node().plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__plugDirtied ), scoped = False ) - plug.node()["in"].getInput().node().scriptNode().context().changedSignal().connect( Gaffer.WeakMethod( self.__updateFromContext ), scoped = False ) - Gaffer.Metadata.plugValueChangedSignal( self.getPlug().node() ).connect( Gaffer.WeakMethod( self.__plugMetadataChanged ), scoped = False ) + plug.node().plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__plugDirtied ) ) + plug.node()["in"].getInput().node().scriptNode().context().changedSignal().connect( Gaffer.WeakMethod( self.__updateFromContext ) ) + Gaffer.Metadata.plugValueChangedSignal( self.getPlug().node() ).connect( Gaffer.WeakMethod( self.__plugMetadataChanged ) ) self.__updateLabels( [ imath.V2i( 0 ) ] * 2 , [ imath.Color4f( 0, 0, 0, 1 ) ] * 2 ) @@ -784,8 +784,7 @@ def __init__( self, plug, **kw ) : GafferImageUI.ViewPlugValueWidget.__init__( self, plug, **kw ) plug.node().viewportGadget().keyPressSignal().connect( - Gaffer.WeakMethod( self.__keyPress ), - scoped = False + Gaffer.WeakMethod( self.__keyPress ) ) self.__ctrlModifier = Gaffer.Metadata.value( plug, "imageViewViewPlugWidget:ctrlModifier" ) or False @@ -870,8 +869,7 @@ def __init__( self, plug, **kw ) : GafferImageUI.RGBAChannelsPlugValueWidget.__init__( self, plug, **kw ) plug.node().viewportGadget().keyPressSignal().connect( - Gaffer.WeakMethod( self.__keyPress ), - scoped = False + Gaffer.WeakMethod( self.__keyPress ) ) def _image( self ): @@ -1014,10 +1012,10 @@ def __init__( self, imageView, **kw ) : # Put the primary ImageGadget first in the list self.__imageGadgets.sort( key = lambda i : i != imageView.viewportGadget().getPrimaryChild() ) - self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClick ), scoped = False ) + self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClick ) ) # We use the paused state of the primary ImageGadget to drive our UI - self.__imageGadgets[0].stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ), scoped = False ) + self.__imageGadgets[0].stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ) ) self.__update() @@ -1071,9 +1069,9 @@ def __init__( self, plug, **kw ) : # We connect to the front, and unconditionally return True from all these methods, to # ensure that we never run any of the default signal handlers from PlugValueWidget - self.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragLeaveSignal().connectFront( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragLeaveSignal().connectFront( Gaffer.WeakMethod( self.__dragLeave ) ) + self.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ) ) @staticmethod def _valuesForUpdate( plugs, auxiliaryPlugs ) : @@ -1149,8 +1147,7 @@ def __init__( self, plug, **kw ) : } plug.node().viewportGadget().keyPressSignal().connect( - Gaffer.WeakMethod( self.__keyPress ), - scoped = False + Gaffer.WeakMethod( self.__keyPress ) ) def _updateFromValues( self, values, exception ) : @@ -1236,8 +1233,8 @@ def __init__( self, plug, **kw ) : GafferUI.PlugValueWidget.__init__( self, self.__button, plug, **kw ) - self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__toggle ), scoped = False) - plug.node().viewportGadget().keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__toggle ) ) + plug.node().viewportGadget().keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) def _updateFromValues( self, values, exception ) : @@ -1280,20 +1277,20 @@ def __init__( self, plug ) : with row : self.__bookmarkNumber = GafferUI.Label( horizontalAlignment=GafferUI.Label.HorizontalAlignment.Right ) - self.__bookmarkNumber.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ), scoped=False ) + self.__bookmarkNumber.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ) ) self.__icon = GafferUI.Button( hasFrame=False, highlightOnOver=False ) self.__icon._qtWidget().setFixedHeight( 13 ) self.__icon._qtWidget().setFixedWidth( 13 ) - self.__icon.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ), scoped=False ) + self.__icon.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ) ) self.__menuButton = GafferUI.Button( image="menuIndicator.png", hasFrame=False, highlightOnOver=False ) self.__menuButton._qtWidget().setObjectName( "menuDownArrow" ) - self.__menuButton.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ), scoped=False ) + self.__menuButton.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ) ) self.addChild( row ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ), scoped=False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ) ) self._setState( self.__defaultNodeSet, Gaffer.NodeAlgo.presets( self.__node["compare"]["catalogueOutput"] )[0] ) diff --git a/python/GafferImageUI/OpenColorIOConfigPlugUI.py b/python/GafferImageUI/OpenColorIOConfigPlugUI.py index 09e74db3ce5..c3a1d37ab87 100644 --- a/python/GafferImageUI/OpenColorIOConfigPlugUI.py +++ b/python/GafferImageUI/OpenColorIOConfigPlugUI.py @@ -270,7 +270,7 @@ def connect( script ) : if not hadPlug : Gaffer.NodeAlgo.applyUserDefaults( plug ) - script.plugDirtiedSignal().connect( __scriptPlugDirtied, scoped = False ) + script.plugDirtiedSignal().connect( __scriptPlugDirtied ) __scriptPlugDirtied( plug ) def __displayTransformProcessor( config, context, workingSpace, display, view ) : diff --git a/python/GafferImageUI/OpenColorIOContextUI.py b/python/GafferImageUI/OpenColorIOContextUI.py index 6f58461ad33..dd620d62648 100644 --- a/python/GafferImageUI/OpenColorIOContextUI.py +++ b/python/GafferImageUI/OpenColorIOContextUI.py @@ -229,7 +229,7 @@ def __init__( self, plug ) : GafferUI.Spacer( imath.V2i( GafferUI.PlugWidget.labelWidth(), 1 ) ) self.__addButton = GafferUI.Button( image = "plus.png", hasFrame = False ) - self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addVariable ), scoped = False ) + self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addVariable ) ) GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand": True } ) diff --git a/python/GafferImageUI/OpenColorIOTransformUI.py b/python/GafferImageUI/OpenColorIOTransformUI.py index 00b29bdb8c6..907428ab129 100644 --- a/python/GafferImageUI/OpenColorIOTransformUI.py +++ b/python/GafferImageUI/OpenColorIOTransformUI.py @@ -150,7 +150,7 @@ def __init__( self, plug, **kw ) : toolTip = "Click to add variables", ) - button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ), scoped = False ) + button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ) ) GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand" : True } ) diff --git a/python/GafferOSLUI/OSLCodeUI.py b/python/GafferOSLUI/OSLCodeUI.py index 5e7b424a632..073c21d59c6 100644 --- a/python/GafferOSLUI/OSLCodeUI.py +++ b/python/GafferOSLUI/OSLCodeUI.py @@ -268,8 +268,8 @@ def __init__( self, plug, **kw ) : self._addPopupMenu( self.__codeWidget ) - self.__codeWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValue ), scoped = False ) - self.__codeWidget.dropTextSignal().connect( Gaffer.WeakMethod( self.__dropText ), scoped = False ) + self.__codeWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValue ) ) + self.__codeWidget.dropTextSignal().connect( Gaffer.WeakMethod( self.__dropText ) ) def codeWidget( self ) : @@ -321,8 +321,8 @@ def __init__( self, node, **kw ) : self.__messageWidget = GafferUI.MessageWidget() GafferUI.Widget.__init__( self, self.__messageWidget, **kw ) - node.errorSignal().connect( Gaffer.WeakMethod( self.__error ), scoped = False ) - node.shaderCompiledSignal().connect( Gaffer.WeakMethod( self.__shaderCompiled ), scoped = False ) + node.errorSignal().connect( Gaffer.WeakMethod( self.__error ) ) + node.shaderCompiledSignal().connect( Gaffer.WeakMethod( self.__shaderCompiled ) ) self.__messageWidget.setVisible( False ) @@ -363,7 +363,7 @@ def __plugPopupMenu( menuDefinition, plugValueWidget ) : }, ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) ########################################################################## # NodeEditor tool menu @@ -399,4 +399,4 @@ def __exportOSLShader( nodeEditor, node ) : with nodeEditor.context() : f.write( node.source( os.path.splitext( os.path.basename( path ) )[0] ) ) -GafferUI.NodeEditor.toolMenuSignal().connect( __toolMenu, scoped = False ) +GafferUI.NodeEditor.toolMenuSignal().connect( __toolMenu ) diff --git a/python/GafferOSLUI/OSLExpressionEngineUI.py b/python/GafferOSLUI/OSLExpressionEngineUI.py index 03ed5c4425c..c08bad2e9af 100644 --- a/python/GafferOSLUI/OSLExpressionEngineUI.py +++ b/python/GafferOSLUI/OSLExpressionEngineUI.py @@ -62,7 +62,7 @@ def __oslPopupMenu( menuDefinition, widget ) : }, ) -GafferUI.ExpressionUI.ExpressionWidget.expressionContextMenuSignal().connect( __oslPopupMenu, scoped = False ) +GafferUI.ExpressionUI.ExpressionWidget.expressionContextMenuSignal().connect( __oslPopupMenu ) GafferUI.ExpressionUI.ExpressionWidget.registerHighlighter( "OSL", lambda node : _CodeWidget._Highlighter() ) GafferUI.ExpressionUI.ExpressionWidget.registerCommentPrefix( "OSL", "//" ) diff --git a/python/GafferSceneTest/InteractiveRenderTest.py b/python/GafferSceneTest/InteractiveRenderTest.py index e07e47da191..424204604b7 100644 --- a/python/GafferSceneTest/InteractiveRenderTest.py +++ b/python/GafferSceneTest/InteractiveRenderTest.py @@ -2326,7 +2326,7 @@ def fail( plug, source, message ) : message ) ) - node.errorSignal().connect( fail, scoped = False ) + node.errorSignal().connect( fail ) return node diff --git a/python/GafferSceneUI/AttributeQueryUI.py b/python/GafferSceneUI/AttributeQueryUI.py index e2419554724..b0d775a708c 100644 --- a/python/GafferSceneUI/AttributeQueryUI.py +++ b/python/GafferSceneUI/AttributeQueryUI.py @@ -55,12 +55,12 @@ def __init__( self, node ) : GafferUI.Spacer( imath.V2i( GafferUI.PlugWidget.labelWidth(), 1 ) ) menuButton = GafferUI.Button( image = "plus.png", hasFrame = False ) - menuButton.clickedSignal().connect( Gaffer.WeakMethod( self.__showMenu ), scoped = False ) + menuButton.clickedSignal().connect( Gaffer.WeakMethod( self.__showMenu ) ) GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand" : True } ) - node.childAddedSignal().connect( Gaffer.WeakMethod( self.__updateVisibility ), scoped = False ) - node.childRemovedSignal().connect( Gaffer.WeakMethod( self.__updateVisibility ), scoped = False ) + node.childAddedSignal().connect( Gaffer.WeakMethod( self.__updateVisibility ) ) + node.childRemovedSignal().connect( Gaffer.WeakMethod( self.__updateVisibility ) ) self.__updateVisibility() diff --git a/python/GafferSceneUI/CameraUI.py b/python/GafferSceneUI/CameraUI.py index ca8ea8d655c..d41ca959048 100644 --- a/python/GafferSceneUI/CameraUI.py +++ b/python/GafferSceneUI/CameraUI.py @@ -493,4 +493,4 @@ def __nodeEditorToolMenu( nodeEditor, node, menuDefinition ) : ) -GafferUI.NodeEditor.toolMenuSignal().connect( __nodeEditorToolMenu, scoped = False ) +GafferUI.NodeEditor.toolMenuSignal().connect( __nodeEditorToolMenu ) diff --git a/python/GafferSceneUI/CropWindowToolUI.py b/python/GafferSceneUI/CropWindowToolUI.py index bfd73d0bbb7..f4d152534c8 100644 --- a/python/GafferSceneUI/CropWindowToolUI.py +++ b/python/GafferSceneUI/CropWindowToolUI.py @@ -107,9 +107,9 @@ def __init__( self, tool, **kw ) : button = GafferUI.Button( "Reset" ) button._qtWidget().setFixedWidth( 50 ) - button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) - self.__tool.statusChangedSignal().connect( Gaffer.WeakMethod( self.__update, fallbackResult = None ), scoped = False ) + self.__tool.statusChangedSignal().connect( Gaffer.WeakMethod( self.__update, fallbackResult = None ) ) self.__update() diff --git a/python/GafferSceneUI/CryptomatteUI.py b/python/GafferSceneUI/CryptomatteUI.py index da6590dafd4..516378aa55b 100644 --- a/python/GafferSceneUI/CryptomatteUI.py +++ b/python/GafferSceneUI/CryptomatteUI.py @@ -69,9 +69,9 @@ def __init__( self, plug, **kw ) : removeButton = self.vectorDataWidget().removeButton() # Connect at front so we get called before the default handlers - addButton.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__convertEvent ), scoped = False ) - removeButton.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__convertEvent ), scoped = False ) - self.vectorDataWidget().dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__convertEvent ), scoped = False ) + addButton.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__convertEvent ) ) + removeButton.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__convertEvent ) ) + self.vectorDataWidget().dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__convertEvent ) ) def __getManifest( self ) : @@ -396,10 +396,10 @@ def __drop( nodeGadget, event ) : def __addNamesDropTarget( nodeGadget ) : - nodeGadget.dragEnterSignal().connect( __dragEnter, scoped = False ) - nodeGadget.dragLeaveSignal().connect( __dragLeave, scoped = False ) - nodeGadget.dragMoveSignal().connect( __dragMove, scoped = False ) - nodeGadget.dropSignal().connect( __drop, scoped = False ) + nodeGadget.dragEnterSignal().connect( __dragEnter ) + nodeGadget.dragLeaveSignal().connect( __dragLeave ) + nodeGadget.dragMoveSignal().connect( __dragMove ) + nodeGadget.dropSignal().connect( __drop ) def __nodeGadget( pathFilter ) : diff --git a/python/GafferSceneUI/CustomAttributesUI.py b/python/GafferSceneUI/CustomAttributesUI.py index aee48867dc5..bdadf6c4f4a 100644 --- a/python/GafferSceneUI/CustomAttributesUI.py +++ b/python/GafferSceneUI/CustomAttributesUI.py @@ -154,4 +154,4 @@ def __attributePopupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __attributePopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __attributePopupMenu ) diff --git a/python/GafferSceneUI/DeleteGlobalsUI.py b/python/GafferSceneUI/DeleteGlobalsUI.py index 6d35e3a72c8..ca72b649cce 100644 --- a/python/GafferSceneUI/DeleteGlobalsUI.py +++ b/python/GafferSceneUI/DeleteGlobalsUI.py @@ -130,4 +130,4 @@ def __namesPopupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __namesPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __namesPopupMenu ) diff --git a/python/GafferSceneUI/DeleteRenderPassesUI.py b/python/GafferSceneUI/DeleteRenderPassesUI.py index 32a6e038dd7..f14e5936052 100644 --- a/python/GafferSceneUI/DeleteRenderPassesUI.py +++ b/python/GafferSceneUI/DeleteRenderPassesUI.py @@ -135,4 +135,4 @@ def __passPopupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __passPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __passPopupMenu ) diff --git a/python/GafferSceneUI/EditScopeUI.py b/python/GafferSceneUI/EditScopeUI.py index 5f3f9346c83..965a3402f6b 100644 --- a/python/GafferSceneUI/EditScopeUI.py +++ b/python/GafferSceneUI/EditScopeUI.py @@ -47,12 +47,12 @@ def addPruningActions( editor ) : if isinstance( editor, GafferUI.Viewer ) : - editor.keyPressSignal().connect( __pruningKeyPress, scoped = False ) + editor.keyPressSignal().connect( __pruningKeyPress ) def addVisibilityActions( editor ) : if isinstance( editor, GafferUI.Viewer ) : - editor.keyPressSignal().connect( __visibilityKeyPress, scoped = False ) + editor.keyPressSignal().connect( __visibilityKeyPress ) def __pruningKeyPress( viewer, event ) : @@ -330,4 +330,4 @@ def _summary( processor, linkCreator ) : summaries[0] = summaries[0][0].upper() + summaries[0][1:] return " and ".join( summaries ) -GafferUI.EditScopeUI.ProcessorWidget.registerProcessorWidget( "SetMembershipEdits", __SetMembershipEditsWidget ) \ No newline at end of file +GafferUI.EditScopeUI.ProcessorWidget.registerProcessorWidget( "SetMembershipEdits", __SetMembershipEditsWidget ) diff --git a/python/GafferSceneUI/HierarchyView.py b/python/GafferSceneUI/HierarchyView.py index ffdc96905ea..774ee37119e 100644 --- a/python/GafferSceneUI/HierarchyView.py +++ b/python/GafferSceneUI/HierarchyView.py @@ -88,11 +88,11 @@ def __init__( self, scriptNode, **kw ) : self.__pathListing.setDragPointer( "objects" ) self.__pathListing.setSortable( False ) - self.__selectionChangedConnection = self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ), scoped = False ) - self.__expansionChangedConnection = self.__pathListing.expansionChangedSignal().connect( Gaffer.WeakMethod( self.__expansionChanged ), scoped = False ) + self.__selectionChangedConnection = self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ) ) + self.__expansionChangedConnection = self.__pathListing.expansionChangedSignal().connect( Gaffer.WeakMethod( self.__expansionChanged ) ) - self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ), scoped = False ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPressSignal ), scoped = False ) + self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ) ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPressSignal ) ) self._updateFromSet() self.__setPathListingPath() @@ -336,7 +336,7 @@ def __init__( self, pathFilter ) : GafferUI.PathFilterWidget.__init__( self, self.__patternWidget, pathFilter ) self.__patternWidget.setPlaceholderText( "Filter..." ) - self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ), scoped = False ) + self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ) ) self._updateFromPathFilter() diff --git a/python/GafferSceneUI/InstancerUI.py b/python/GafferSceneUI/InstancerUI.py index c9eca11fa74..2e89a97dec3 100644 --- a/python/GafferSceneUI/InstancerUI.py +++ b/python/GafferSceneUI/InstancerUI.py @@ -59,7 +59,7 @@ def __init__( self, plug, **kw ) : GafferUI.Spacer( imath.V2i( GafferUI.PlugWidget.labelWidth(), 1 ) ) - GafferUI.Button( image = "plus.png", hasFrame = False ).clickedSignal().connect( Gaffer.WeakMethod( self.__addItem ), scoped = False ) + GafferUI.Button( image = "plus.png", hasFrame = False ).clickedSignal().connect( Gaffer.WeakMethod( self.__addItem ) ) GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand" : True } ) diff --git a/python/GafferSceneUI/InteractiveRenderUI.py b/python/GafferSceneUI/InteractiveRenderUI.py index 51ab06cae02..dbd48f08015 100644 --- a/python/GafferSceneUI/InteractiveRenderUI.py +++ b/python/GafferSceneUI/InteractiveRenderUI.py @@ -102,7 +102,7 @@ def __init__( self, view, **kwargs ) : self.__view = view if isinstance( self.__view["in"], GafferImage.ImagePlug ) : - view.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__viewPlugDirtied ), scoped = False ) + view.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__viewPlugDirtied ) ) self.__update() @@ -203,8 +203,8 @@ def __init__( self, plug, *args, **kwargs) : self.__startPauseButton._qtWidget().setFocusPolicy( QtCore.Qt.NoFocus ) self.__stopButton._qtWidget().setFocusPolicy( QtCore.Qt.NoFocus ) - self.__startPauseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__startPauseClicked ), scoped = False ) - self.__stopButton.clickedSignal().connect( Gaffer.WeakMethod( self.__stopClicked ), scoped = False ) + self.__startPauseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__startPauseClicked ) ) + self.__stopButton.clickedSignal().connect( Gaffer.WeakMethod( self.__stopClicked ) ) self.__stateIcons = { GafferScene.InteractiveRender.State.Running : 'renderPause.png', @@ -257,7 +257,7 @@ def __init__( self, plug ) : GafferUI.PlugValueWidget.__init__( self, self.__summaryWidget, plug ) - self.__summaryWidget.levelButtonClickedSignal().connect( Gaffer.WeakMethod( self.__levelButtonClicked ), scoped = False ) + self.__summaryWidget.levelButtonClickedSignal().connect( Gaffer.WeakMethod( self.__levelButtonClicked ) ) def getToolTip( self ) : @@ -302,8 +302,8 @@ def __init__( self, parentWindow, plug ) : node = plug.node() scriptNode = node.scriptNode() while node and not node.isSame( scriptNode ) : - node.nameChangedSignal().connect( Gaffer.WeakMethod( self.__updateTitle ), scoped = False ) - node.parentChangedSignal().connect( Gaffer.WeakMethod( self.__destroy ), scoped = False ) + node.nameChangedSignal().connect( Gaffer.WeakMethod( self.__updateTitle ) ) + node.parentChangedSignal().connect( Gaffer.WeakMethod( self.__destroy ) ) node = node.parent() self.__updateTitle() diff --git a/python/GafferSceneUI/LightEditor.py b/python/GafferSceneUI/LightEditor.py index 2247254b698..f9edec97260 100644 --- a/python/GafferSceneUI/LightEditor.py +++ b/python/GafferSceneUI/LightEditor.py @@ -107,9 +107,9 @@ def __init__( self, scriptNode, **kw ) : self.__pathListing.setDragPointer( "objects" ) self.__pathListing.setSortable( False ) self.__selectionChangedConnection = self.__pathListing.selectionChangedSignal().connect( - Gaffer.WeakMethod( self.__selectionChanged ), scoped = False + Gaffer.WeakMethod( self.__selectionChanged ) ) - self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ), scoped = False ) + self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ) ) self._updateFromSet() self.__setPathListingPath() @@ -429,7 +429,7 @@ def __init__( self, plug, **kw ) : self._qtWidget().currentChanged.connect( Gaffer.WeakMethod( self.__currentChanged ) ) self.__ignoreCurrentChanged = False - plug.node().plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ), scoped = False ) + plug.node().plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ) ) # Borrow the styling from the Spreadsheet's section chooser. ## \todo Should we be introducing a `GafferUI.TabBar` class which can be used in diff --git a/python/GafferSceneUI/OptionQueryUI.py b/python/GafferSceneUI/OptionQueryUI.py index cb706b4087f..53797db994d 100644 --- a/python/GafferSceneUI/OptionQueryUI.py +++ b/python/GafferSceneUI/OptionQueryUI.py @@ -309,8 +309,7 @@ def __init__( self, plug ) : GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand": True } ) plug.node().plugSetSignal().connect( - Gaffer.WeakMethod( self.__updateQueryMetadata ), - scoped = False + Gaffer.WeakMethod( self.__updateQueryMetadata ) ) def _updateFromEditable( self ) : @@ -444,4 +443,4 @@ def __deletePlug( plug ) : with Gaffer.UndoScope( plug.ancestor( Gaffer.ScriptNode ) ) : plug.node().removeQuery( plug ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) diff --git a/python/GafferSceneUI/OutputsUI.py b/python/GafferSceneUI/OutputsUI.py index 51f6d896047..b77904f7374 100644 --- a/python/GafferSceneUI/OutputsUI.py +++ b/python/GafferSceneUI/OutputsUI.py @@ -196,7 +196,7 @@ def __init__( self, childPlug ) : with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing=4 ) as header : collapseButton = GafferUI.Button( image = "collapsibleArrowRight.png", hasFrame=False ) - collapseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__collapseButtonClicked ), scoped = False ) + collapseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__collapseButtonClicked ) ) GafferUI.PlugValueWidget.create( childPlug["active"] ) self.__label = GafferUI.Label( childPlug["name"].getValue() ) @@ -204,14 +204,14 @@ def __init__( self, childPlug ) : GafferUI.Spacer( imath.V2i( 1 ), maximumSize = imath.V2i( 100000, 1 ), parenting = { "expand" : True } ) self.__deleteButton = GafferUI.Button( image = "delete.png", hasFrame=False ) - self.__deleteButton.clickedSignal().connect( Gaffer.WeakMethod( self.__deleteButtonClicked ), scoped = False ) + self.__deleteButton.clickedSignal().connect( Gaffer.WeakMethod( self.__deleteButtonClicked ) ) self.__deleteButton.setVisible( False ) self.__detailsColumn = GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Vertical, spacing = 4 ) self.__detailsColumn.setVisible( False ) - header.enterSignal().connect( Gaffer.WeakMethod( self.__enter ), scoped = False ) - header.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ), scoped = False ) + header.enterSignal().connect( Gaffer.WeakMethod( self.__enter ) ) + header.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ) ) def hasLabel( self ) : diff --git a/python/GafferSceneUI/PathFilterUI.py b/python/GafferSceneUI/PathFilterUI.py index 498ba17e416..2360daa431a 100644 --- a/python/GafferSceneUI/PathFilterUI.py +++ b/python/GafferSceneUI/PathFilterUI.py @@ -169,7 +169,7 @@ def __init__( self, plug, **kw ) : GafferUI.VectorDataPlugValueWidget.__init__( self, plug, **kw ) - self.vectorDataWidget().dataMenuSignal().connect( Gaffer.WeakMethod( self.__dataMenu ), scoped = False ) + self.vectorDataWidget().dataMenuSignal().connect( Gaffer.WeakMethod( self.__dataMenu ) ) def __dataMenu( self, vectorDataWidget, menuDefinition ) : @@ -226,7 +226,7 @@ def __popupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu ) ########################################################################## # NodeGadget drop handler @@ -389,10 +389,10 @@ def __drop( nodeGadget, event ) : def addObjectDropTarget( nodeGadget ) : - nodeGadget.dragEnterSignal().connect( __dragEnter, scoped = False ) - nodeGadget.dragLeaveSignal().connect( __dragLeave, scoped = False ) - nodeGadget.dragMoveSignal().connect( __dragMove, scoped = False ) - nodeGadget.dropSignal().connect( __drop, scoped = False ) + nodeGadget.dragEnterSignal().connect( __dragEnter ) + nodeGadget.dragLeaveSignal().connect( __dragLeave ) + nodeGadget.dragMoveSignal().connect( __dragMove ) + nodeGadget.dropSignal().connect( __drop ) def __nodeGadget( pathFilter ) : diff --git a/python/GafferSceneUI/PrimitiveVariableQueryUI.py b/python/GafferSceneUI/PrimitiveVariableQueryUI.py index 9c167dc9702..a0242f4a753 100644 --- a/python/GafferSceneUI/PrimitiveVariableQueryUI.py +++ b/python/GafferSceneUI/PrimitiveVariableQueryUI.py @@ -391,8 +391,7 @@ def __init__( self, plug ) : GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand": True } ) plug.node().plugSetSignal().connect( - Gaffer.WeakMethod( self.__updateQueryMetadata ), - scoped = False + Gaffer.WeakMethod( self.__updateQueryMetadata ) ) def _updateFromEditable( self ) : @@ -500,4 +499,4 @@ def __deletePlug( plug ) : with Gaffer.UndoScope( plug.ancestor( Gaffer.ScriptNode ) ) : plug.node().removeQuery( plug ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) diff --git a/python/GafferSceneUI/RenderPassEditor.py b/python/GafferSceneUI/RenderPassEditor.py index 46af5cfdee4..ec86a6e99c9 100644 --- a/python/GafferSceneUI/RenderPassEditor.py +++ b/python/GafferSceneUI/RenderPassEditor.py @@ -124,15 +124,15 @@ def __init__( self, scriptNode, **kw ) : GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand" : True } ) - self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addButtonClicked ), scoped = False ) - self.__removeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__removeButtonClicked ), scoped = False ) - Gaffer.Metadata.nodeValueChangedSignal().connect( Gaffer.WeakMethod( self.__metadataChanged ), scoped = False ) + self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addButtonClicked ) ) + self.__removeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__removeButtonClicked ) ) + Gaffer.Metadata.nodeValueChangedSignal().connect( Gaffer.WeakMethod( self.__metadataChanged ) ) - self.__pathListing.buttonDoubleClickSignal().connectFront( Gaffer.WeakMethod( self.__buttonDoubleClick ), scoped = False ) - self.__pathListing.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ), scoped = False ) - self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ), scoped = False ) - self.__pathListing.dragBeginSignal().connectFront( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) + self.__pathListing.buttonDoubleClickSignal().connectFront( Gaffer.WeakMethod( self.__buttonDoubleClick ) ) + self.__pathListing.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ) ) + self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ) ) + self.__pathListing.dragBeginSignal().connectFront( Gaffer.WeakMethod( self.__dragBegin ) ) self._updateFromSet() self.__setPathListingPath() @@ -669,7 +669,7 @@ def __init__( self, plug, **kw ) : self._qtWidget().currentChanged.connect( Gaffer.WeakMethod( self.__currentChanged ) ) self.__ignoreCurrentChanged = False - plug.node().plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ), scoped = False ) + plug.node().plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ) ) # Borrow the styling from the Spreadsheet's section chooser. ## \todo Should we be introducing a `GafferUI.TabBar` class which can be used in @@ -744,7 +744,7 @@ def __init__( self, plugs, **kw ) : GafferUI.PlugValueWidget.__init__( self, self.__row, plugs ) self.__groupingModeButton = GafferUI.Button( image = "pathListingList.png", hasFrame=False ) - self.__groupingModeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__groupingModeButtonClicked ), scoped = False ) + self.__groupingModeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__groupingModeButtonClicked ) ) self.__row.append( self.__groupingModeButton ) @@ -772,10 +772,10 @@ def __init__( self, pathFilter ) : self.__patternWidget.setPlaceholderText( "Filter..." ) - self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ), scoped = False ) - self.__patternWidget.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.__patternWidget.dragLeaveSignal().connectFront( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.__patternWidget.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ) ) + self.__patternWidget.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__dragEnter ) ) + self.__patternWidget.dragLeaveSignal().connectFront( Gaffer.WeakMethod( self.__dragLeave ) ) + self.__patternWidget.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ) ) self._updateFromPathFilter() @@ -840,9 +840,9 @@ def __init__( self, existingNames = [], editScope = None, title = "Add Render Pa self.__confirmButton = self._addButton( confirmLabel ) if hasattr( self.__renderPassNameWidget, "activatedSignal" ) : - self.__renderPassNameWidget.activatedSignal().connect( Gaffer.WeakMethod( self.__renderPassNameActivated ), scoped = False ) + self.__renderPassNameWidget.activatedSignal().connect( Gaffer.WeakMethod( self.__renderPassNameActivated ) ) if hasattr( self.__renderPassNameWidget, "renderPassNameChangedSignal" ) : - self.__renderPassNameWidget.renderPassNameChangedSignal().connect( Gaffer.WeakMethod( self.__renderPassNameChanged ), scoped = False ) + self.__renderPassNameWidget.renderPassNameChangedSignal().connect( Gaffer.WeakMethod( self.__renderPassNameChanged ) ) self.__updateButtonState() def waitForRenderPassName( self, **kw ) : diff --git a/python/GafferSceneUI/RenderPassesUI.py b/python/GafferSceneUI/RenderPassesUI.py index 7fd61a10e62..c19b82fc363 100644 --- a/python/GafferSceneUI/RenderPassesUI.py +++ b/python/GafferSceneUI/RenderPassesUI.py @@ -153,7 +153,7 @@ def __init__( self, plug, **kw ) : GafferUI.VectorDataPlugValueWidget.__init__( self, plug, **kw ) - self.vectorDataWidget().editSignal().connect( Gaffer.WeakMethod( self.__edit ), scoped = False ) + self.vectorDataWidget().editSignal().connect( Gaffer.WeakMethod( self.__edit ) ) def __edit( self, vectorDataWidget, column, row ) : @@ -169,7 +169,7 @@ def __init__( self ) : self._qtWidget().setFocusProxy( self.__nameWidget._qtWidget() ) - GafferUI.Widget.focusChangedSignal().connect( Gaffer.WeakMethod( self.__focusChanged ), scoped = False ) + GafferUI.Widget.focusChangedSignal().connect( Gaffer.WeakMethod( self.__focusChanged ) ) def setValue( self, value ) : diff --git a/python/GafferSceneUI/SceneHistoryUI.py b/python/GafferSceneUI/SceneHistoryUI.py index 550c256f4e4..294ed3b6700 100644 --- a/python/GafferSceneUI/SceneHistoryUI.py +++ b/python/GafferSceneUI/SceneHistoryUI.py @@ -64,11 +64,11 @@ def appendViewContextMenuItems( viewer, view, menuDefinition ) : def connectToEditor( editor ) : if isinstance( editor, GafferUI.Viewer ) : - editor.keyPressSignal().connect( __viewerKeyPress, scoped = False ) + editor.keyPressSignal().connect( __viewerKeyPress ) elif isinstance( editor, GafferSceneUI.HierarchyView ) or isinstance( editor, GafferSceneUI.LightEditor ) : - editor.keyPressSignal().connect( __hierarchyViewKeyPress, scoped = False ) + editor.keyPressSignal().connect( __hierarchyViewKeyPress ) elif isinstance( editor, GafferUI.NodeEditor ) : - editor.keyPressSignal().connect( __nodeEditorKeyPress, scoped = False ) + editor.keyPressSignal().connect( __nodeEditorKeyPress ) ########################################################################## # Internal implementation diff --git a/python/GafferSceneUI/SceneInspector.py b/python/GafferSceneUI/SceneInspector.py index 9c5e18c4b70..0f69d1f895a 100644 --- a/python/GafferSceneUI/SceneInspector.py +++ b/python/GafferSceneUI/SceneInspector.py @@ -425,9 +425,9 @@ def __init__( self, highlightDiffs=True, **kw ) : for i in range( 0, 2 ) : label = GafferUI.Label() label._qtWidget().setSizePolicy( QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed ) ) - label.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - label.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - label.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + label.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + label.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + label.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) self.setValueWidget( i, label ) self.__highlightDiffs = highlightDiffs @@ -760,9 +760,9 @@ def __init__( self, inspector, diffCreator = TextDiff, alternate = False, **kw ) diffWidgets = [ diff.getValueWidget( 0 ), diff.getValueWidget( 1 ) ] if isinstance( diff, SideBySideDiff ) else [ diff ] for diffWidget in diffWidgets : - diffWidget.enterSignal().connect( Gaffer.WeakMethod( self.__enter ), scoped = False ) - diffWidget.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ), scoped = False ) - diffWidget.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ), scoped = False ) + diffWidget.enterSignal().connect( Gaffer.WeakMethod( self.__enter ) ) + diffWidget.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ) ) + diffWidget.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ) ) if inspector._useBackgroundThread() : GafferUI.BusyWidget( size = 22, busy = False ) @@ -775,9 +775,9 @@ def __init__( self, inspector, diffCreator = TextDiff, alternate = False, **kw ) menu = GafferUI.Menu( Gaffer.WeakMethod( self.__menuDefinition ) ) ) - label.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - label.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - label.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + label.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + label.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + label.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) self.__inspector = inspector self.__diffCreator = diffCreator @@ -1043,7 +1043,7 @@ def __init__( self, inspector, diffCreator = TextDiff, label = None, filterable self.__filterWidget = GafferUI.TextWidget() self.__filterWidget.setPlaceholderText( "Filter..." ) self.__filterWidget.textChangedSignal().connect( - Gaffer.WeakMethod( self.__filterTextChanged ), scoped = False + Gaffer.WeakMethod( self.__filterTextChanged ) ) self.__rowContainer = GafferUI.ListContainer() @@ -1227,7 +1227,7 @@ def __init__( self, label, section, targets ) : # tricky because sections resize lazily when they are first shown. self._qtWidget().resize( 400, 250 ) - editor.getNodeSet().memberRemovedSignal().connect( Gaffer.WeakMethod( self.__nodeSetMemberRemoved ), scoped = False ) + editor.getNodeSet().memberRemovedSignal().connect( Gaffer.WeakMethod( self.__nodeSetMemberRemoved ) ) def __nodeSetMemberRemoved( self, set, node ) : @@ -1314,9 +1314,9 @@ def update( self, targets ) : if atEitherEnd or value is not None : label = GafferUI.Label( path ) label.setToolTip( "Click to select \"%s\"" % path ) - label.enterSignal().connect( lambda gadget : gadget.setHighlighted( True ), scoped = False ) - label.leaveSignal().connect( lambda gadget : gadget.setHighlighted( False ), scoped = False ) - label.buttonPressSignal().connect( Gaffer.WeakMethod( self.__labelButtonPress ), scoped = False ) + label.enterSignal().connect( lambda gadget : gadget.setHighlighted( True ) ) + label.leaveSignal().connect( lambda gadget : gadget.setHighlighted( False ) ) + label.buttonPressSignal().connect( Gaffer.WeakMethod( self.__labelButtonPress ) ) else : GafferUI.Label( "..." ) @@ -1514,8 +1514,7 @@ def update( self, targets ) : editButton = GafferUI.Button( image = "editOn.png", hasFrame = False ) if not Gaffer.MetadataAlgo.readOnly( history[i].target.scene.node() ) : editButton.clickedSignal().connect( - functools.partial( _HistorySection.__editClicked, node = history[i].target.scene.node() ), - scoped = False + functools.partial( _HistorySection.__editClicked, node = history[i].target.scene.node() ) ) else : editButton.setEnabled( False ) @@ -2360,7 +2359,7 @@ def __init__( self, name, **kw ) : with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal ) : collapseButton = GafferUI.Button( image = "collapsibleArrowRight.png", hasFrame=False ) - collapseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__collapseButtonClicked ), scoped = False ) + collapseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__collapseButtonClicked ) ) self.__label = TextDiff() GafferUI.Spacer( imath.V2i( 1 ), parenting = { "expand" : True } ) @@ -2467,12 +2466,12 @@ def __init__( self, **kw ) : frame._qtWidget().setProperty( "gafferDiff", diffName ) - frame.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - frame.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) - frame.enterSignal().connect( lambda widget : widget.setHighlighted( True ), scoped = False ) - frame.leaveSignal().connect( lambda widget : widget.setHighlighted( False ), scoped = False ) - frame.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - frame.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + frame.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + frame.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) + frame.enterSignal().connect( lambda widget : widget.setHighlighted( True ) ) + frame.leaveSignal().connect( lambda widget : widget.setHighlighted( False ) ) + frame.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + frame.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) GafferUI.Label( "" ) diff --git a/python/GafferSceneUI/ScenePathPlugValueWidget.py b/python/GafferSceneUI/ScenePathPlugValueWidget.py index cf1cf2be64a..0774f8b6a0e 100644 --- a/python/GafferSceneUI/ScenePathPlugValueWidget.py +++ b/python/GafferSceneUI/ScenePathPlugValueWidget.py @@ -62,7 +62,7 @@ def __init__( self, plug, path = None, **kw ) : GafferUI.PathPlugValueWidget.__init__( self, plug, path, **kw ) - plug.ancestor( Gaffer.ScriptNode ).focusChangedSignal().connect( Gaffer.WeakMethod( self.__focusChanged ), scoped = False ) + plug.ancestor( Gaffer.ScriptNode ).focusChangedSignal().connect( Gaffer.WeakMethod( self.__focusChanged ) ) def _pathChooserDialogue( self ) : diff --git a/python/GafferSceneUI/SceneReaderUI.py b/python/GafferSceneUI/SceneReaderUI.py index 16828cc6ee1..eb67f4147bb 100644 --- a/python/GafferSceneUI/SceneReaderUI.py +++ b/python/GafferSceneUI/SceneReaderUI.py @@ -169,4 +169,4 @@ def __tagsPopupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __tagsPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __tagsPopupMenu ) diff --git a/python/GafferSceneUI/SceneViewUI.py b/python/GafferSceneUI/SceneViewUI.py index a1ad26a38db..8fedbc530fe 100644 --- a/python/GafferSceneUI/SceneViewUI.py +++ b/python/GafferSceneUI/SceneViewUI.py @@ -330,7 +330,7 @@ def __init__( self, plug, **kw ) : self.__window = None - button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ), scoped = False ) + button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ) ) def __clicked( self, button ) : @@ -737,8 +737,8 @@ def __init__( self, plug, **kw ) : self.__settingsWindow = None # Must connect at front so we get called before PlugValueWidget's default handlers - self.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ) ) def setHighlighted( self, highlighted ) : @@ -1200,7 +1200,7 @@ def __viewContextMenu( viewer, view, menuDefinition ) : ) -GafferUI.Viewer.viewContextMenuSignal().connect( __viewContextMenu, scoped = False ) +GafferUI.Viewer.viewContextMenuSignal().connect( __viewContextMenu ) def __plugValueWidgetContextMenu( menuDefinition, plugValueWidget ) : @@ -1215,7 +1215,7 @@ def __plugValueWidgetContextMenu( menuDefinition, plugValueWidget ) : __appendClippingPlaneMenuItems( menuDefinition, "", node, plugValueWidget ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugValueWidgetContextMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugValueWidgetContextMenu ) ########################################################################## # _Spacers @@ -1278,8 +1278,8 @@ def __init__( self, sceneView, **kw ) : self.__sceneGadget = sceneView.viewportGadget().getPrimaryChild() - self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClick ), scoped = False ) - self.__sceneGadget.stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ), scoped = False ) + self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClick ) ) + self.__sceneGadget.stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ) ) self.__update() diff --git a/python/GafferSceneUI/SetEditor.py b/python/GafferSceneUI/SetEditor.py index c2ef89c8bd6..448b9f1284a 100644 --- a/python/GafferSceneUI/SetEditor.py +++ b/python/GafferSceneUI/SetEditor.py @@ -91,9 +91,9 @@ def __init__( self, scriptNode, **kw ) : displayMode = GafferUI.PathListingWidget.DisplayMode.Tree, ) - self.__pathListing.dragBeginSignal().connectFront( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ), scoped = False ) - self.__pathListing.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPressSignal ), scoped = False ) + self.__pathListing.dragBeginSignal().connectFront( Gaffer.WeakMethod( self.__dragBegin ) ) + self.__pathListing.columnContextMenuSignal().connect( Gaffer.WeakMethod( self.__columnContextMenuSignal ) ) + self.__pathListing.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPressSignal ) ) self._updateFromSet() self.__updatePathListingPath() @@ -265,10 +265,10 @@ def __init__( self, pathFilter ) : self.__patternWidget.setPlaceholderText( "Filter..." ) - self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ), scoped = False ) - self.__patternWidget.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.__patternWidget.dragLeaveSignal().connectFront( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.__patternWidget.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ) ) + self.__patternWidget.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__dragEnter ) ) + self.__patternWidget.dragLeaveSignal().connectFront( Gaffer.WeakMethod( self.__dragLeave ) ) + self.__patternWidget.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ) ) self.__context = None self.__scene = None diff --git a/python/GafferSceneUI/SetExpressionPlugValueWidget.py b/python/GafferSceneUI/SetExpressionPlugValueWidget.py index e2a384264c3..fc2fcb27cf2 100644 --- a/python/GafferSceneUI/SetExpressionPlugValueWidget.py +++ b/python/GafferSceneUI/SetExpressionPlugValueWidget.py @@ -54,7 +54,7 @@ def __init__( self, plug, **kw ) : self._addPopupMenu( self.__codeWidget ) - self.__codeWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValues ), scoped = False ) + self.__codeWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValues ) ) self.__availableSets = {} self.__sourceSubstitionAvailable = False diff --git a/python/GafferSceneUI/SetFilterUI.py b/python/GafferSceneUI/SetFilterUI.py index 742f5363ae6..356422be8af 100644 --- a/python/GafferSceneUI/SetFilterUI.py +++ b/python/GafferSceneUI/SetFilterUI.py @@ -248,10 +248,10 @@ def __drop( nodeGadget, event ) : def addSetDropTarget( nodeGadget ) : - nodeGadget.dragEnterSignal().connect( __dragEnter, scoped = False ) - nodeGadget.dragLeaveSignal().connect( __dragLeave, scoped = False ) - nodeGadget.dragMoveSignal().connect( __dragMove, scoped = False ) - nodeGadget.dropSignal().connect( __drop, scoped = False ) + nodeGadget.dragEnterSignal().connect( __dragEnter ) + nodeGadget.dragLeaveSignal().connect( __dragLeave ) + nodeGadget.dragMoveSignal().connect( __dragMove ) + nodeGadget.dropSignal().connect( __drop ) def __nodeGadget( setFilter ) : diff --git a/python/GafferSceneUI/SetUI.py b/python/GafferSceneUI/SetUI.py index 6f6e2828ec2..60709661b19 100644 --- a/python/GafferSceneUI/SetUI.py +++ b/python/GafferSceneUI/SetUI.py @@ -393,7 +393,7 @@ def __popupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu ) ########################################################################## # Gadgets diff --git a/python/GafferSceneUI/SetVisualiserUI.py b/python/GafferSceneUI/SetVisualiserUI.py index e65f43da54a..3dd58fd91cf 100644 --- a/python/GafferSceneUI/SetVisualiserUI.py +++ b/python/GafferSceneUI/SetVisualiserUI.py @@ -143,7 +143,7 @@ def __init__( self, node, **kw ) : self.__node = node self.__swatches = [] - node.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__plugDirtied ), scoped = False ) + node.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__plugDirtied ) ) self._update() @@ -209,7 +209,7 @@ def __init__( self, plug ) : GafferUI.Spacer( imath.V2i( GafferUI.PlugWidget.labelWidth(), 1 ) ) self.__addButton = GafferUI.Button( image = "plus.png", hasFrame = False ) - self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addOverride ), scoped = False ) + self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addOverride ) ) GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand" : True } ) @@ -243,7 +243,7 @@ def __init__( self, **kw ) : # Allow right-click to add an override for the target set self.__menu = GafferUI.Menu( Gaffer.WeakMethod( self.__addMenuDefinition ) ) - self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__menu.popup ), scoped = False ) + self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__menu.popup ) ) def setColorAndLabel( self, color, label ) : diff --git a/python/GafferSceneUI/ShaderQueryUI.py b/python/GafferSceneUI/ShaderQueryUI.py index c07d82ccfa2..cdea7e389dc 100644 --- a/python/GafferSceneUI/ShaderQueryUI.py +++ b/python/GafferSceneUI/ShaderQueryUI.py @@ -438,8 +438,7 @@ def __init__( self, plug ) : GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand": True } ) plug.node().plugSetSignal().connect( - Gaffer.WeakMethod( self.__updateQueryMetadata ), - scoped = False + Gaffer.WeakMethod( self.__updateQueryMetadata ) ) def _updateFromEditable( self ) : @@ -606,7 +605,7 @@ def __plugPopupMenu( menuDefinition, plugValueWidget ) : menuDefinition.prepend( "/From Location/", { "subMenu" : __setShaderFromLocationMenuDefinition } ) menuDefinition.prepend( "/From Selection/", { "subMenu" : __setShaderFromSelectionMenuDefinition } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) ########################################################################## @@ -630,4 +629,4 @@ def __deletePlug( plug ) : with Gaffer.UndoScope( plug.ancestor( Gaffer.ScriptNode ) ) : plug.node().removeQuery( plug ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) diff --git a/python/GafferSceneUI/ShaderTweakProxyUI.py b/python/GafferSceneUI/ShaderTweakProxyUI.py index c062efac2d4..d0e43a15863 100644 --- a/python/GafferSceneUI/ShaderTweakProxyUI.py +++ b/python/GafferSceneUI/ShaderTweakProxyUI.py @@ -313,4 +313,4 @@ def isParameterOrTweak( plug ) : { "subMenu" : functools.partial( _plugContextMenu, plug, None ) } ) -GafferUI.GraphEditor.plugContextMenuSignal().connect( __plugContextMenuSignal, scoped = False ) +GafferUI.GraphEditor.plugContextMenuSignal().connect( __plugContextMenuSignal ) diff --git a/python/GafferSceneUI/ShaderTweaksUI.py b/python/GafferSceneUI/ShaderTweaksUI.py index 7173a391c54..e268b1773ea 100644 --- a/python/GafferSceneUI/ShaderTweaksUI.py +++ b/python/GafferSceneUI/ShaderTweaksUI.py @@ -414,7 +414,7 @@ def __plugPopupMenu( menuDefinition, plugValueWidget ) : menuDefinition.prepend( "/From Selection/", { "subMenu" : __setShaderFromSelectionMenuDefinition } ) menuDefinition.prepend( "/From Affected/", { "subMenu" : __setShaderFromAffectedMenuDefinition } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) ########################################################################## # Nodule context menu @@ -450,4 +450,4 @@ def __graphEditorPlugContextMenu( graphEditor, plug, menuDefinition ) : ) -GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu, scoped = False ) +GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu ) diff --git a/python/GafferSceneUI/ShaderUI.py b/python/GafferSceneUI/ShaderUI.py index a45ac3cdffe..f6cce220395 100644 --- a/python/GafferSceneUI/ShaderUI.py +++ b/python/GafferSceneUI/ShaderUI.py @@ -202,7 +202,7 @@ def __init__( self, plugs, **kw ) : self.__stringPlugValueWidget = GafferUI.StringPlugValueWidget( plugs ) self.__reloadButton = GafferUI.Button( image = "refresh.png", hasFrame = False, toolTip = "Click to reload shader" ) - self.__reloadButton.clickedSignal().connect( Gaffer.WeakMethod( self.__reloadButtonClicked ), scoped = False ) + self.__reloadButton.clickedSignal().connect( Gaffer.WeakMethod( self.__reloadButtonClicked ) ) def setPlugs( self, plugs ) : @@ -371,7 +371,7 @@ def __graphEditorPlugContextMenu( graphEditor, plug, menuDefinition ) : ) -GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu, scoped = False ) +GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu ) ########################################################################## @@ -660,7 +660,7 @@ def __init__( self, patterns, rootPath = None, propertyName = "name", userData = self.__pathMatcherDirty = True self.__pathMatcher = IECore.PathMatcher() - rootPath.pathChangedSignal().connect( Gaffer.WeakMethod( self.__rootPathChanged ), scoped = False ) + rootPath.pathChangedSignal().connect( Gaffer.WeakMethod( self.__rootPathChanged ) ) def setMatchPatterns( self, patterns ) : @@ -787,13 +787,13 @@ def __init__( self, shaderNetworks, title, selectParameters, **kw ) : self._setWidget( mainColumn ) - self.__pathListingWidget.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__updateButtonState ), scoped = False ) - self.__pathListingWidget.buttonReleaseSignal().connectFront( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) - self.__pathListingWidget.pathSelectedSignal().connect( Gaffer.WeakMethod( self.__pathSelected ), scoped = False ) + self.__pathListingWidget.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__updateButtonState ) ) + self.__pathListingWidget.buttonReleaseSignal().connectFront( Gaffer.WeakMethod( self.__buttonRelease ) ) + self.__pathListingWidget.pathSelectedSignal().connect( Gaffer.WeakMethod( self.__pathSelected ) ) self._addButton( "Cancel" ) self.__confirmButton = self._addButton( "OK" ) - self.__confirmButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__confirmButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__selectedSignal = Gaffer.Signal1() diff --git a/python/GafferSceneUI/ShaderViewUI.py b/python/GafferSceneUI/ShaderViewUI.py index d78de2513f4..4f4180a5577 100644 --- a/python/GafferSceneUI/ShaderViewUI.py +++ b/python/GafferSceneUI/ShaderViewUI.py @@ -130,7 +130,7 @@ def __init__( self, shaderView ) : GafferUI.Spacer( imath.V2i( 0 ), parenting = { "expand" : True } ) self.__shaderView = shaderView - shaderView.sceneChangedSignal().connect( Gaffer.WeakMethod( self.__sceneChanged ), scoped = False ) + shaderView.sceneChangedSignal().connect( Gaffer.WeakMethod( self.__sceneChanged ) ) self.__updateNodeUI() def __updateNodeUI( self ) : diff --git a/python/GafferSceneUI/TransformToolUI.py b/python/GafferSceneUI/TransformToolUI.py index b697fefd5bb..050e062414d 100644 --- a/python/GafferSceneUI/TransformToolUI.py +++ b/python/GafferSceneUI/TransformToolUI.py @@ -95,7 +95,7 @@ def __init__( self, tool, **kw ) : self.__tool = tool - tool.plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ), scoped = False ) + tool.plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ) ) with self : with GafferUI.Frame( borderWidth = 0 ) as self.__innerFrame : @@ -128,13 +128,13 @@ def __init__( self, tool, **kw ) : self.__infoLabel = GafferUI.Label( "" ) self.__nameLabel = GafferUI.NameLabel( graphComponent = None, numComponents = sys.maxsize ) self.__nameLabel.setFormatter( _boldFormatter ) - self.__nameLabel.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ), scoped = False ) + self.__nameLabel.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ) ) with GafferUI.ListContainer( orientation = GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) as self.__warningRow : GafferUI.Image( "warningSmall.png" ) self.__warningLabel = GafferUI.Label( "" ) - self.__tool.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__update, fallbackResult = None ), scoped = False ) + self.__tool.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__update, fallbackResult = None ) ) self.__update() diff --git a/python/GafferSceneUI/UVInspector.py b/python/GafferSceneUI/UVInspector.py index b09764673b8..99ae8a4bec7 100644 --- a/python/GafferSceneUI/UVInspector.py +++ b/python/GafferSceneUI/UVInspector.py @@ -64,15 +64,15 @@ def __init__( self, scriptNode, **kw ) : self.__gadgetWidget.setViewportGadget( self.__uvView.viewportGadget() ) self.__gadgetWidget.getViewportGadget().frame( imath.Box3f( imath.V3f( 0, 0, 0 ), imath.V3f( 1, 1, 0 ) ) ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) self.__gadgetWidget.getViewportGadget().buttonPressSignal().connect( - Gaffer.WeakMethod( self.__buttonPress ), scoped = False + Gaffer.WeakMethod( self.__buttonPress ) ) self.__gadgetWidget.getViewportGadget().dragBeginSignal().connect( - Gaffer.WeakMethod( self.__dragBegin ), scoped = False + Gaffer.WeakMethod( self.__dragBegin ) ) self.__gadgetWidget.getViewportGadget().dragEndSignal().connect( - Gaffer.WeakMethod( self.__dragEnd ), scoped = False + Gaffer.WeakMethod( self.__dragEnd ) ) self._updateFromSet() @@ -153,11 +153,11 @@ def __init__( self, uvView, **kw ) : self.__uvView = uvView self.__button.clickedSignal().connect( - Gaffer.WeakMethod( self.__buttonClick ), scoped = False + Gaffer.WeakMethod( self.__buttonClick ) ) self.__uvView.stateChangedSignal().connect( - Gaffer.WeakMethod( self.__stateChanged ), scoped = False + Gaffer.WeakMethod( self.__stateChanged ) ) self.__update() diff --git a/python/GafferSceneUI/_HistoryWindow.py b/python/GafferSceneUI/_HistoryWindow.py index 8359d879033..b4fc39f5a52 100644 --- a/python/GafferSceneUI/_HistoryWindow.py +++ b/python/GafferSceneUI/_HistoryWindow.py @@ -168,14 +168,14 @@ def __init__( self, inspector, scenePath, context, scriptNode, title=None, **kw self.__valueColumnIndex = 1 self.__operationColumnIndex = 2 - self.__pathListingWidget.buttonDoubleClickSignal().connectFront( Gaffer.WeakMethod( self.__buttonDoubleClick ), scoped = False ) - self.__pathListingWidget.keyPressSignal().connectFront( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.__pathListingWidget.dragBeginSignal().connectFront( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.__pathListingWidget.updateFinishedSignal().connectFront( Gaffer.WeakMethod( self.__updateFinished ), scoped = False ) + self.__pathListingWidget.buttonDoubleClickSignal().connectFront( Gaffer.WeakMethod( self.__buttonDoubleClick ) ) + self.__pathListingWidget.keyPressSignal().connectFront( Gaffer.WeakMethod( self.__keyPress ) ) + self.__pathListingWidget.dragBeginSignal().connectFront( Gaffer.WeakMethod( self.__dragBegin ) ) + self.__pathListingWidget.updateFinishedSignal().connectFront( Gaffer.WeakMethod( self.__updateFinished ) ) - inspector.dirtiedSignal().connect( Gaffer.WeakMethod( self.__inspectorDirtied ), scoped = False ) + inspector.dirtiedSignal().connect( Gaffer.WeakMethod( self.__inspectorDirtied ) ) - context.changedSignal().connect( Gaffer.WeakMethod( self.__contextChanged ), scoped = False ) + context.changedSignal().connect( Gaffer.WeakMethod( self.__contextChanged ) ) self.__updatePath( context ) diff --git a/python/GafferSceneUI/_InspectorColumn.py b/python/GafferSceneUI/_InspectorColumn.py index dbfa6ccc305..9978bfe8d90 100644 --- a/python/GafferSceneUI/_InspectorColumn.py +++ b/python/GafferSceneUI/_InspectorColumn.py @@ -441,8 +441,8 @@ def __keyPress( column, pathListing, event ) : def __inspectorColumnCreated( column ) : if isinstance( column, GafferSceneUI.Private.InspectorColumn ) : - column.buttonDoubleClickSignal().connectFront( __buttonDoubleClick, scoped = False ) - column.contextMenuSignal().connectFront( __contextMenu, scoped = False ) - column.keyPressSignal().connectFront( __keyPress, scoped = False ) + column.buttonDoubleClickSignal().connectFront( __buttonDoubleClick ) + column.contextMenuSignal().connectFront( __contextMenu ) + column.keyPressSignal().connectFront( __keyPress ) -GafferSceneUI.Private.InspectorColumn.instanceCreatedSignal().connect( __inspectorColumnCreated, scoped = False ) +GafferSceneUI.Private.InspectorColumn.instanceCreatedSignal().connect( __inspectorColumnCreated ) diff --git a/python/GafferSceneUI/_SceneViewInspector.py b/python/GafferSceneUI/_SceneViewInspector.py index 8aa4da0a73f..5a18149e369 100644 --- a/python/GafferSceneUI/_SceneViewInspector.py +++ b/python/GafferSceneUI/_SceneViewInspector.py @@ -122,7 +122,7 @@ def __init__( self, sceneView ) : GafferUI.Spacer( imath.V2i( 1 ) ) self.__busyWidget = GafferUI.BusyWidget( size = 20, busy = False ) hideButton = GafferUI.Button( image="deleteSmall.png", hasFrame=False ) - hideButton.clickedSignal().connect( Gaffer.WeakMethod( self.__closeButtonClicked ), scoped = False ) + hideButton.clickedSignal().connect( Gaffer.WeakMethod( self.__closeButtonClicked ) ) with GafferUI.ScrolledContainer( horizontalMode = GafferUI.ScrollMode.Never ) : with GafferUI.ListContainer( spacing = 20 ) as self.__sections : @@ -142,7 +142,7 @@ def __init__( self, sceneView ) : # this frame which holds all our contents. self.__frame.setVisible( False ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress )) def _scheduleUpdate( self, inspectorWidget ) : @@ -157,7 +157,7 @@ def __attachToView( self, sceneView ) : sceneView["inspector"].addChild( Gaffer.BoolPlug( "visible", Gaffer.Plug.Direction.In, True ) ) Gaffer.NodeAlgo.applyUserDefaults( sceneView["inspector"] ) - sceneView.viewportGadget().keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + sceneView.viewportGadget().keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) self.__sceneView = sceneView @@ -302,11 +302,11 @@ def __init__( self, inspector, context ) : label._qtWidget().setMaximumWidth( 140 ) self.__valueWidget = _ValueWidget() - self.__valueWidget.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__valueDoubleClick ), scoped = False ) + self.__valueWidget.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__valueDoubleClick ) ) self.__inspectorResults = [] - self.__context.changedSignal().connect( Gaffer.WeakMethod( self.__contextChanged ), scoped = False ) - self.__inspector.dirtiedSignal().connect( Gaffer.WeakMethod( self.__inspectorDirtied ), scoped = False ) + self.__context.changedSignal().connect( Gaffer.WeakMethod( self.__contextChanged ) ) + self.__inspector.dirtiedSignal().connect( Gaffer.WeakMethod( self.__inspectorDirtied ) ) def context( self ) : @@ -454,9 +454,9 @@ def __init__( self, values = [], **kw ) : self._qtWidget().setStyleSheet( "padding-left: 4px; padding-right: 4px;" ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) self.__values = [] self.setValues( values ) diff --git a/python/GafferTest/BlockedConnectionTest.py b/python/GafferTest/BlockedConnectionTest.py index 646a6fd90a0..13c46aef62c 100644 --- a/python/GafferTest/BlockedConnectionTest.py +++ b/python/GafferTest/BlockedConnectionTest.py @@ -48,7 +48,7 @@ def f() : self.numCalls += 1 s = Gaffer.Signals.Signal0() - c = s.connect( f, scoped = False ) + c = s.connect( f ) s() self.assertEqual( self.numCalls, 1 ) @@ -68,7 +68,7 @@ def f() : self.numCalls += 1 s = Gaffer.Signals.Signal0() - c = s.connect( f, scoped = False ) + c = s.connect( f ) s() self.assertEqual( self.numCalls, 1 ) diff --git a/python/GafferTest/ChildSetTest.py b/python/GafferTest/ChildSetTest.py index 59e0bfae4f4..0ab914ac366 100644 --- a/python/GafferTest/ChildSetTest.py +++ b/python/GafferTest/ChildSetTest.py @@ -74,8 +74,8 @@ def removed( s, member ) : p = Gaffer.GraphComponent() s = Gaffer.ChildSet( p ) - addedConnection = s.memberAddedSignal().connect( added, scoped = False ) - removedConnection = s.memberRemovedSignal().connect( removed, scoped = False ) + addedConnection = s.memberAddedSignal().connect( added ) + removedConnection = s.memberRemovedSignal().connect( removed ) p["one"] = Gaffer.GraphComponent() diff --git a/python/GafferTest/CompoundPathFilterTest.py b/python/GafferTest/CompoundPathFilterTest.py index 3af04304441..97d617dcefd 100644 --- a/python/GafferTest/CompoundPathFilterTest.py +++ b/python/GafferTest/CompoundPathFilterTest.py @@ -80,7 +80,7 @@ def f( filter ) : f1 = Gaffer.FileNamePathFilter( [ "*.gfr" ] ) f2 = Gaffer.FileNamePathFilter( [ "*.tif" ] ) - cf.changedSignal().connect( f, scoped = False ) + cf.changedSignal().connect( f ) self.assertEqual( self.__numChanges, 0 ) cf.addFilter( f1 ) @@ -118,7 +118,7 @@ def f( filter ) : f1 = Gaffer.FileNamePathFilter( [ "*.gfr" ] ) f2 = Gaffer.FileNamePathFilter( [ "*.tif" ] ) - cf.changedSignal().connect( f, scoped = False ) + cf.changedSignal().connect( f ) self.assertEqual( self.__numChanges, 0 ) cf.setFilters( [ f1, f2 ] ) diff --git a/python/GafferTest/ContextTest.py b/python/GafferTest/ContextTest.py index 44ee027ea2f..f06f6175d49 100644 --- a/python/GafferTest/ContextTest.py +++ b/python/GafferTest/ContextTest.py @@ -67,7 +67,7 @@ def f( context, name ) : self.assertTrue( context.isSame( c ) ) changes.append( ( name, context.get( name, None ), context.hash() ) ) - c.changedSignal().connect( f, scoped = False ) + c.changedSignal().connect( f ) c["a"] = 2 hash1 = c.hash() @@ -835,7 +835,7 @@ def changed( context, variable ) : context[variable] = IECore.PathMatcherData( value ) context = Gaffer.Context() - context.changedSignal().connect( changed, scoped = False ) + context.changedSignal().connect( changed ) context["test"] = IECore.PathMatcherData() expected = IECore.PathMatcher() diff --git a/python/GafferTest/DependencyNodeTest.py b/python/GafferTest/DependencyNodeTest.py index ae6a968915c..a2027281d5d 100644 --- a/python/GafferTest/DependencyNodeTest.py +++ b/python/GafferTest/DependencyNodeTest.py @@ -488,7 +488,7 @@ def assertStatesValid() : self.assertTrue( state.s is None ) self.assertTrue( state.f is None ) - n3.plugDirtiedSignal().connect( plugDirtied, scoped = False ) + n3.plugDirtiedSignal().connect( plugDirtied ) n3["p"].setInput( n1["o"] ) assertStatesValid() @@ -545,7 +545,7 @@ def plugDirtied( plug ) : valuesWhenDirtied.append( plug.getValue() ) n = DynamicAddNode() - n.plugDirtiedSignal().connect( plugDirtied, scoped = False ) + n.plugDirtiedSignal().connect( plugDirtied ) n["in"] = Gaffer.IntPlug( defaultValue = 1, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) self.assertEqual( valuesWhenDirtied, [ 1 ] ) diff --git a/python/GafferTest/ExpressionTest.py b/python/GafferTest/ExpressionTest.py index 1f4c1bc5633..24213c0f3d8 100644 --- a/python/GafferTest/ExpressionTest.py +++ b/python/GafferTest/ExpressionTest.py @@ -155,7 +155,7 @@ def f( plug ) : s["m1"] = GafferTest.MultiplyNode() - s["m1"].plugDirtiedSignal().connect( f, scoped = False ) + s["m1"].plugDirtiedSignal().connect( f ) s["e"] = Gaffer.Expression() s["e"].setExpression( @@ -912,7 +912,7 @@ def f( node ) : s["e"] = Gaffer.Expression() self.assertEqual( s["e"].getExpression(), ( "", "" ) ) - s["e"].expressionChangedSignal().connect( f, scoped = False ) + s["e"].expressionChangedSignal().connect( f ) with Gaffer.UndoScope( s ) : s["e"].setExpression( 'parent["n"]["user"]["p"] = 10' ) diff --git a/python/GafferTest/GraphComponentTest.py b/python/GafferTest/GraphComponentTest.py index c711b330513..8bb629e98ac 100644 --- a/python/GafferTest/GraphComponentTest.py +++ b/python/GafferTest/GraphComponentTest.py @@ -166,7 +166,7 @@ def f( child, previousParent ) : p1["c"] = c - c.parentChangedSignal().connect( f, scoped = False ) + c.parentChangedSignal().connect( f ) p2["c"] = c @@ -186,7 +186,7 @@ def f( child, previousParent ) : GraphComponentTest.newParent = child.parent() GraphComponentTest.previousParent = previousParent - child.parentChangedSignal().connect( f, scoped = False ) + child.parentChangedSignal().connect( f ) GraphComponentTest.newParent = "XXX" GraphComponentTest.previousParent = "XXX" @@ -216,8 +216,8 @@ def testReparentingDoesntSignal( self ) : def f( a, b=None ) : GraphComponentTest.numSignals += 1 - child.parentChangedSignal().connect( f, scoped = False ) - parent.childAddedSignal().connect( f, scoped = False ) + child.parentChangedSignal().connect( f ) + parent.childAddedSignal().connect( f ) parent.addChild( child ) @@ -536,10 +536,10 @@ def testSetChildAgain( self ) : def f( *args ) : GraphComponentTest.numSignals += 1 - child.parentChangedSignal().connect( f, scoped = False ) - parent.childAddedSignal().connect( f, scoped = False ) - parent.childRemovedSignal().connect( f, scoped = False ) - child.nameChangedSignal().connect( f, scoped = False ) + child.parentChangedSignal().connect( f ) + parent.childAddedSignal().connect( f ) + parent.childRemovedSignal().connect( f ) + child.nameChangedSignal().connect( f ) parent.setChild( "c", child ) @@ -1050,7 +1050,7 @@ def childrenReordered( parent, oldIndices ) : # Demonstrates how you could maintain a parallel data structure # to keep the same order. For example, a list of widgets in the UI. mirror[:] = [ mirror[i] for i in oldIndices ] - script["node"]["p"].childrenReorderedSignal().connect( childrenReordered, scoped = False ) + script["node"]["p"].childrenReorderedSignal().connect( childrenReordered ) cs = GafferTest.CapturingSlot( p.childrenReorderedSignal() ) with Gaffer.UndoScope( script ) : @@ -1106,7 +1106,7 @@ def f( g, oldName ) : self.assertIsInstance( oldName, str ) names.append( ( oldName, g.getName() ) ) - g.nameChangedSignal().connect( f, scoped = False ) + g.nameChangedSignal().connect( f ) with Gaffer.UndoScope( s ) : g.setName( "newName" ) @@ -1144,7 +1144,7 @@ def __init__( self, name = "NameTracker" ) : Gaffer.Node.__init__( self, name ) - self.nameChangedSignal().connect( Gaffer.WeakMethod( self.__nameChanged ), scoped = False ) + self.nameChangedSignal().connect( Gaffer.WeakMethod( self.__nameChanged ) ) self.nameChanges = [] diff --git a/python/GafferTest/LoopTest.py b/python/GafferTest/LoopTest.py index a602f7cd08b..428d4131af6 100644 --- a/python/GafferTest/LoopTest.py +++ b/python/GafferTest/LoopTest.py @@ -260,8 +260,8 @@ def plugDirtied( plug ) : valuesWhenDirtied[plug] = plugValue( plug ) - loop.plugDirtiedSignal().connect( plugDirtied, scoped = False ) - add.plugDirtiedSignal().connect( plugDirtied, scoped = False ) + loop.plugDirtiedSignal().connect( plugDirtied ) + add.plugDirtiedSignal().connect( plugDirtied ) loop["in"].setValue( 1 ) # Check that we saw the values we expected. diff --git a/python/GafferTest/MetadataTest.py b/python/GafferTest/MetadataTest.py index ef5b661b43e..fba20a107f5 100644 --- a/python/GafferTest/MetadataTest.py +++ b/python/GafferTest/MetadataTest.py @@ -1352,7 +1352,7 @@ def changed( node, key, reason ) : if Gaffer.Metadata.value( node, key ) != 1 : Gaffer.Metadata.registerValue( node, key, 1 ) - Gaffer.Metadata.nodeValueChangedSignal( node ).connect( changed, scoped = False ) + Gaffer.Metadata.nodeValueChangedSignal( node ).connect( changed ) Gaffer.Metadata.registerValue( node, "test", 2 ) self.assertEqual( Gaffer.Metadata.value( node, "test" ), 1 ) diff --git a/python/GafferTest/NodeTest.py b/python/GafferTest/NodeTest.py index f6fd663f6a9..f002e336150 100644 --- a/python/GafferTest/NodeTest.py +++ b/python/GafferTest/NodeTest.py @@ -396,7 +396,7 @@ def badSlot( plug, sourcePlug, error ) : raise RuntimeError( "Bad slot" ) - node.errorSignal().connect( badSlot, scoped = False ) + node.errorSignal().connect( badSlot ) cs = GafferTest.CapturingSlot( node.errorSignal() ) with IECore.CapturingMessageHandler() as mh : diff --git a/python/GafferTest/NumericBookmarkSetTest.py b/python/GafferTest/NumericBookmarkSetTest.py index 75b261bebfe..85a8acc1ee4 100644 --- a/python/GafferTest/NumericBookmarkSetTest.py +++ b/python/GafferTest/NumericBookmarkSetTest.py @@ -102,8 +102,8 @@ def removed( _, member ) : b = Gaffer.NumericBookmarkSet( s, 1 ) - b.memberAddedSignal().connect( added, scoped = False ) - b.memberRemovedSignal().connect( removed, scoped = False ) + b.memberAddedSignal().connect( added ) + b.memberRemovedSignal().connect( removed ) self.assertEqual( set(b), mirror ) diff --git a/python/GafferTest/PathFilterTest.py b/python/GafferTest/PathFilterTest.py index 232051b7966..57f7da8e11c 100644 --- a/python/GafferTest/PathFilterTest.py +++ b/python/GafferTest/PathFilterTest.py @@ -111,7 +111,7 @@ def f( pf ) : self.assertTrue( pf.isSame( pathFilter ) ) enabledStates.append( pf.getEnabled() ) - pathFilter.changedSignal().connect( f, scoped = False ) + pathFilter.changedSignal().connect( f ) pathFilter.setEnabled( False ) pathFilter.setEnabled( False ) diff --git a/python/GafferTest/PathTest.py b/python/GafferTest/PathTest.py index 94e5c58f9fa..7f498b85c46 100644 --- a/python/GafferTest/PathTest.py +++ b/python/GafferTest/PathTest.py @@ -88,7 +88,7 @@ def f( path ) : changedPaths.append( str( path ) ) p = Gaffer.Path( "/" ) - p.pathChangedSignal().connect( f, scoped = False ) + p.pathChangedSignal().connect( f ) p.append( "hello" ) p.append( "goodbye" ) @@ -106,7 +106,7 @@ def testFilters( self ) : def f( path ) : changedPaths.append( str( path ) ) - p.pathChangedSignal().connect( f, scoped = False ) + p.pathChangedSignal().connect( f ) self.assertEqual( len( changedPaths ), 0 ) filter = Gaffer.FileNamePathFilter( [ "*.gfr" ] ) diff --git a/python/GafferTest/PlugTest.py b/python/GafferTest/PlugTest.py index 369e800ccb2..eacabd266b2 100644 --- a/python/GafferTest/PlugTest.py +++ b/python/GafferTest/PlugTest.py @@ -102,7 +102,7 @@ def f( p ) : p2 = Gaffer.Plug( direction=Gaffer.Plug.Direction.In ) n2.addChild( p2 ) - n2.plugInputChangedSignal().connect( f, scoped = False ) + n2.plugInputChangedSignal().connect( f ) p2.setInput( p1 ) self.assertTrue( PlugTest.__connection[0].isSame( p2 ) ) self.assertTrue( PlugTest.__connection[1].isSame( p1 ) ) @@ -1059,8 +1059,8 @@ def plugDirtied( plug ) : self.assertEqual( node1["user"]["p"].keys(), [ "c2", "c1" ] ) self.assertEqual( node2["user"]["p"].keys(), [ "c2", "c1" ] ) - node1.plugDirtiedSignal().connect( plugDirtied, scoped = False ) - node2.plugDirtiedSignal().connect( plugDirtied, scoped = False ) + node1.plugDirtiedSignal().connect( plugDirtied ) + node2.plugDirtiedSignal().connect( plugDirtied ) node1["user"]["p"].reorderChildren( reversed( node1["user"]["p"] ) @@ -1107,7 +1107,7 @@ def plugDirtied( plug ) : dirtiedPlugs.add( plug ) - s["n1"].plugDirtiedSignal().connect( plugDirtied, scoped = False ) + s["n1"].plugDirtiedSignal().connect( plugDirtied ) s["n1"]["p1"].setValue( 1 ) diff --git a/python/GafferTest/ReferenceTest.py b/python/GafferTest/ReferenceTest.py index 402caf704d6..5a7514ac1a4 100644 --- a/python/GafferTest/ReferenceTest.py +++ b/python/GafferTest/ReferenceTest.py @@ -894,7 +894,7 @@ def testUndo( self ) : def referenceLoaded( node ) : states.append( State( keys = node.keys(), fileName = node.fileName() ) ) - s["r"].referenceLoadedSignal().connect( referenceLoaded, scoped = False ) + s["r"].referenceLoadedSignal().connect( referenceLoaded ) with Gaffer.UndoScope( s ) : s["r"].load( self.temporaryDirectory() / "test.grf" ) diff --git a/python/GafferTest/ScriptNodeTest.py b/python/GafferTest/ScriptNodeTest.py index 13e3f81bba0..4e0c80570b9 100644 --- a/python/GafferTest/ScriptNodeTest.py +++ b/python/GafferTest/ScriptNodeTest.py @@ -944,7 +944,7 @@ def testUndoAndRedoOrder( self ) : def f( plug ) : values.append( plug.getValue() ) - s["n"].plugSetSignal().connect( f, scoped = False ) + s["n"].plugSetSignal().connect( f ) with Gaffer.UndoScope( s ) : s["n"]["p"].setValue( 10 ) @@ -1061,7 +1061,7 @@ def f( plug ) : self.assertFalse( s.undoAvailable() ) self.assertFalse( s.redoAvailable() ) - s["n"].plugSetSignal().connect( f, scoped = False ) + s["n"].plugSetSignal().connect( f ) self.assertEqual( s.currentActionStage(), Gaffer.Action.Stage.Invalid ) self.assertEqual( len( actionStages ), 0 ) @@ -1341,7 +1341,7 @@ def testIsExecuting( self ) : def f( script, child ) : self.__wasExecuting.append( script.isExecuting() ) - s.childAddedSignal().connect( f, scoped = False ) + s.childAddedSignal().connect( f ) s["n"] = GafferTest.AddNode() diff --git a/python/GafferTest/SplinePlugTest.py b/python/GafferTest/SplinePlugTest.py index 8ee8c930344..5c9fa089182 100644 --- a/python/GafferTest/SplinePlugTest.py +++ b/python/GafferTest/SplinePlugTest.py @@ -272,7 +272,7 @@ def plugSet( plug ) : if plug.isSame( p ) : self.__plugSetCount += 1 - n.plugSetSignal().connect( plugSet, scoped = False ) + n.plugSetSignal().connect( plugSet ) p.pointYPlug( 2 ).setValue( 1.0 ) diff --git a/python/GafferTest/SpreadsheetTest.py b/python/GafferTest/SpreadsheetTest.py index e5c039f265a..3b686844fbc 100644 --- a/python/GafferTest/SpreadsheetTest.py +++ b/python/GafferTest/SpreadsheetTest.py @@ -550,8 +550,8 @@ def outputAddedOrRemoved( parent, child ) : except Exception as e : exceptions.append( e ) - script["sheet"]["out"].childAddedSignal().connect( outputAddedOrRemoved, scoped = False ) - script["sheet"]["out"].childRemovedSignal().connect( outputAddedOrRemoved, scoped = False ) + script["sheet"]["out"].childAddedSignal().connect( outputAddedOrRemoved ) + script["sheet"]["out"].childRemovedSignal().connect( outputAddedOrRemoved ) with Gaffer.UndoScope( script ) : script["sheet"]["rows"].addColumn( Gaffer.StringPlug( "column1" ) ) diff --git a/python/GafferTest/StandardSetTest.py b/python/GafferTest/StandardSetTest.py index c2d6725142b..02154618af1 100644 --- a/python/GafferTest/StandardSetTest.py +++ b/python/GafferTest/StandardSetTest.py @@ -163,8 +163,8 @@ def removed( set, member ) : s = Gaffer.StandardSet() - s.memberAddedSignal().connect( added, scoped = False ) - s.memberRemovedSignal().connect( removed, scoped = False ) + s.memberAddedSignal().connect( added ) + s.memberRemovedSignal().connect( removed ) n1 = Gaffer.Node() n2 = Gaffer.Node() @@ -220,7 +220,7 @@ def f( s, m ) : return m.isInstanceOf( Gaffer.Plug.staticTypeId() ) - s.memberAcceptanceSignal().connect( f, scoped = False ) + s.memberAcceptanceSignal().connect( f ) n = Gaffer.Node() p = Gaffer.Plug() @@ -268,7 +268,7 @@ def f( s, m ) : pass - s.memberRemovedSignal().connect( f, scoped = False ) + s.memberRemovedSignal().connect( f ) s.clear() diff --git a/python/GafferTest/ValuePlugTest.py b/python/GafferTest/ValuePlugTest.py index b74f5717aea..87c8e59a9d2 100644 --- a/python/GafferTest/ValuePlugTest.py +++ b/python/GafferTest/ValuePlugTest.py @@ -426,7 +426,7 @@ def setCallback( plug ) : if plug.isSame( c ) : self.set = True - n.plugSetSignal().connect( setCallback, scoped = False ) + n.plugSetSignal().connect( setCallback ) self.set = False @@ -447,7 +447,7 @@ def setCallback( plug ) : self.setPlugs.append( plug.getName() ) - n.plugSetSignal().connect( setCallback, scoped = False ) + n.plugSetSignal().connect( setCallback ) self.setPlugs = [] @@ -468,7 +468,7 @@ def setCallback( plug ) : self.setPlugs.append( plug.getName() ) - n.plugSetSignal().connect( setCallback, scoped = False ) + n.plugSetSignal().connect( setCallback ) self.setPlugs = [] diff --git a/python/GafferUI/AboutWindow.py b/python/GafferUI/AboutWindow.py index a89fa12ef48..44e97a8dacb 100644 --- a/python/GafferUI/AboutWindow.py +++ b/python/GafferUI/AboutWindow.py @@ -160,7 +160,7 @@ def __label( self, text, **kw ) : text = header + text + footer label = GafferUI.Label( text, **kw ) - label.linkActivatedSignal().connect( Gaffer.WeakMethod( self.__linkActivated ), scoped = False ) + label.linkActivatedSignal().connect( Gaffer.WeakMethod( self.__linkActivated ) ) return label def __linkActivated( self, label, url ) : diff --git a/python/GafferUI/AnimationEditor.py b/python/GafferUI/AnimationEditor.py index 564ebad1dd4..5b77d3b234a 100644 --- a/python/GafferUI/AnimationEditor.py +++ b/python/GafferUI/AnimationEditor.py @@ -145,8 +145,8 @@ def __init__( self, scriptNode, **kw ) : self.__curveList._qtWidget().setMinimumSize( 160, 0 ) self.__curveList._qtWidget().setSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Ignored ) - self.__curveList.expansionChangedSignal().connect( Gaffer.WeakMethod( self.__updateGadgetSets ), scoped = False ) - self.__selectionChangedConnection = self.__curveList.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__updateGadgetSets ), scoped = False ) + self.__curveList.expansionChangedSignal().connect( Gaffer.WeakMethod( self.__updateGadgetSets ) ) + self.__selectionChangedConnection = self.__curveList.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__updateGadgetSets ) ) # Set up the widget responsible for actual curve drawing self.__animationGadget = GafferUI.AnimationGadget() @@ -154,8 +154,8 @@ def __init__( self, scriptNode, **kw ) : # Set up signals needed to update selection state in PathListingWidget editable = self.__animationGadget.editablePlugs() self.__editablePlugsConnections = [ - editable.memberAddedSignal().connect( Gaffer.WeakMethod( self.__editablePlugAdded ), scoped = False ), - editable.memberRemovedSignal().connect( Gaffer.WeakMethod( self.__editablePlugRemoved ), scoped = False ) + editable.memberAddedSignal().connect( Gaffer.WeakMethod( self.__editablePlugAdded ) ), + editable.memberRemovedSignal().connect( Gaffer.WeakMethod( self.__editablePlugRemoved ) ) ] self.__gadgetWidget = GafferUI.GadgetWidget() @@ -197,7 +197,7 @@ def __init__( self, scriptNode, **kw ) : self.__gadgetWidget.getViewportGadget().frame( bound ) # connect context menu for animation gadget - self.__gadgetWidget.contextMenuSignal().connect( Gaffer.WeakMethod( self.__animationGadgetContextMenu ), scoped = False ) + self.__gadgetWidget.contextMenuSignal().connect( Gaffer.WeakMethod( self.__animationGadgetContextMenu ) ) def _updateFromSet( self ) : @@ -427,13 +427,13 @@ def __init__( self, curveGadget ) : # set up signals self.__curveGadget.selectedKeys().memberAddedSignal().connect( - Gaffer.WeakMethod( self.__selectedKeysKeyAdded ), scoped = False ) + Gaffer.WeakMethod( self.__selectedKeysKeyAdded ) ) self.__curveGadget.selectedKeys().memberRemovedSignal().connect( - Gaffer.WeakMethod( self.__selectedKeysKeyRemoved ), scoped = False ) + Gaffer.WeakMethod( self.__selectedKeysKeyRemoved ) ) self.__curveGadget.editablePlugs().memberAddedSignal().connect( - Gaffer.WeakMethod( self.__curveSelected ), scoped = False ), + Gaffer.WeakMethod( self.__curveSelected ) ), self.__curveGadget.editablePlugs().memberRemovedSignal().connect( - Gaffer.WeakMethod( self.__curveDeselected ), scoped = False ) + Gaffer.WeakMethod( self.__curveDeselected ) ) # update all tabs for tab in self : @@ -543,19 +543,19 @@ def __init__( self ) : # setup editor connections self.__frameConnection = self.__frameEditor.valueChangedSignal().connect( - Gaffer.WeakMethod( self.__setFrame ), scoped = False ) + Gaffer.WeakMethod( self.__setFrame ) ) self.__valueConnection = self.__valueEditor.valueChangedSignal().connect( - Gaffer.WeakMethod( self.__setValue ), scoped = False ) + Gaffer.WeakMethod( self.__setValue ) ) self.__slopeConnection = ( self.__slopeEditor[ Gaffer.Animation.Direction.In ].valueChangedSignal().connect( - functools.partial( Gaffer.WeakMethod( self.__setSlope ), Gaffer.Animation.Direction.In ), scoped = False ), + functools.partial( Gaffer.WeakMethod( self.__setSlope ), Gaffer.Animation.Direction.In ) ), self.__slopeEditor[ Gaffer.Animation.Direction.Out ].valueChangedSignal().connect( - functools.partial( Gaffer.WeakMethod( self.__setSlope ), Gaffer.Animation.Direction.Out ), scoped = False ) ) + functools.partial( Gaffer.WeakMethod( self.__setSlope ), Gaffer.Animation.Direction.Out ) ) ) self.__scaleConnection = ( self.__scaleEditor[ Gaffer.Animation.Direction.In ].valueChangedSignal().connect( - functools.partial( Gaffer.WeakMethod( self.__setScale ), Gaffer.Animation.Direction.In ), scoped = False ), + functools.partial( Gaffer.WeakMethod( self.__setScale ), Gaffer.Animation.Direction.In ) ), self.__scaleEditor[ Gaffer.Animation.Direction.Out ].valueChangedSignal().connect( - functools.partial( Gaffer.WeakMethod( self.__setScale ), Gaffer.Animation.Direction.Out ), scoped = False ) ) + functools.partial( Gaffer.WeakMethod( self.__setScale ), Gaffer.Animation.Direction.Out ) ) ) # layout widgets alignment = ( GafferUI.HorizontalAlignment.Right, GafferUI.VerticalAlignment.Center ) @@ -594,11 +594,11 @@ def __init__( self ) : def connect( self, curve ) : if curve not in self.__connections : self.__connections[ curve ] = _KeyWidget.Connections( - frame = curve.keyTimeChangedSignal().connect( Gaffer.WeakMethod( self.__keyFrameChanged ), scoped = False ), - value = curve.keyValueChangedSignal().connect( Gaffer.WeakMethod( self.__keyValueChanged ), scoped = False ), - interpolation = curve.keyInterpolationChangedSignal().connect( Gaffer.WeakMethod( self.__keyInterpolationChanged ), scoped = False ), - tieMode = curve.keyTieModeChangedSignal().connect( Gaffer.WeakMethod( self.__keyTieModeChanged ), scoped = False ), - tangent = curve.node().plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__keyTangentChanged ), scoped = False ) ) + frame = curve.keyTimeChangedSignal().connect( Gaffer.WeakMethod( self.__keyFrameChanged ) ), + value = curve.keyValueChangedSignal().connect( Gaffer.WeakMethod( self.__keyValueChanged ) ), + interpolation = curve.keyInterpolationChangedSignal().connect( Gaffer.WeakMethod( self.__keyInterpolationChanged ) ), + tieMode = curve.keyTieModeChangedSignal().connect( Gaffer.WeakMethod( self.__keyTieModeChanged ) ), + tangent = curve.node().plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__keyTangentChanged ) ) ) def disconnect( self, curve ) : if curve in self.__connections : @@ -954,7 +954,7 @@ def __init__( self ) : def connect( self, curve ) : if curve not in self.__connections : self.__connections[ curve ] = _CurveWidget.Connections( - extrapolation = curve.extrapolationChangedSignal().connect( Gaffer.WeakMethod( self.__extrapolationChanged ), scoped = False ) ) + extrapolation = curve.extrapolationChangedSignal().connect( Gaffer.WeakMethod( self.__extrapolationChanged ) ) ) def disconnect( self, curve ) : if curve in self.__connections : diff --git a/python/GafferUI/AnimationUI.py b/python/GafferUI/AnimationUI.py index 747df3b2d5e..379f0a39512 100644 --- a/python/GafferUI/AnimationUI.py +++ b/python/GafferUI/AnimationUI.py @@ -215,4 +215,4 @@ def __popupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu ) diff --git a/python/GafferUI/AnnotationsUI.py b/python/GafferUI/AnnotationsUI.py index c1195c6d580..d2864c2d147 100644 --- a/python/GafferUI/AnnotationsUI.py +++ b/python/GafferUI/AnnotationsUI.py @@ -159,13 +159,13 @@ def __init__( self, node, name ) : self.__textWidget.setHighlighter( _AnnotationsHighlighter( node ) ) self.__textWidget.setCompleter( _AnnotationsCompleter( node ) ) self.__textWidget.textChangedSignal().connect( - Gaffer.WeakMethod( self.__updateButtonStatus ), scoped = False + Gaffer.WeakMethod( self.__updateButtonStatus ) ) self.__textWidget.activatedSignal().connect( - Gaffer.WeakMethod( self.__textActivated ), scoped = False + Gaffer.WeakMethod( self.__textActivated ) ) self.__textWidget.contextMenuSignal().connect( - Gaffer.WeakMethod( self.__textWidgetContextMenu ), scoped = False + Gaffer.WeakMethod( self.__textWidgetContextMenu ) ) if not template : self.__colorChooser = GafferUI.ColorChooser( @@ -173,7 +173,7 @@ def __init__( self, node, name ) : displayTransform = GafferUI.Widget.identityDisplayTransform ) self.__colorChooser.colorChangedSignal().connect( - Gaffer.WeakMethod( self.__updateButtonStatus ), scoped = False + Gaffer.WeakMethod( self.__updateButtonStatus ) ) else : self.__colorChooser = None diff --git a/python/GafferUI/ApplicationMenu.py b/python/GafferUI/ApplicationMenu.py index a18dc409479..6667b45ab56 100644 --- a/python/GafferUI/ApplicationMenu.py +++ b/python/GafferUI/ApplicationMenu.py @@ -99,9 +99,9 @@ def preferences( menu ) : else : window = GafferUI.Dialogue( "Preferences" ) closeButton = window._addButton( "Close" ) - closeButton.clickedSignal().connect( __closePreferences, scoped = False ) + closeButton.clickedSignal().connect( __closePreferences ) saveButton = window._addButton( "Save" ) - saveButton.clickedSignal().connect( __savePreferences, scoped = False ) + saveButton.clickedSignal().connect( __savePreferences ) window._setWidget( GafferUI.NodeUI.create( application["preferences"] ) ) __preferencesWindows[application] = weakref.ref( window ) scriptWindow.addChildWindow( window ) diff --git a/python/GafferUI/BackgroundTaskDialogue.py b/python/GafferUI/BackgroundTaskDialogue.py index 0d7e0b566d2..f8616259b2c 100644 --- a/python/GafferUI/BackgroundTaskDialogue.py +++ b/python/GafferUI/BackgroundTaskDialogue.py @@ -88,9 +88,9 @@ def __init__( self, title, **kw ) : self.__cancelButton = self._addButton( "Cancel" ) # Make it impossible to accidentally cancel by hitting `Enter`. self.__cancelButton._qtWidget().setFocusPolicy( QtCore.Qt.NoFocus ) - self.__cancelButton.clickedSignal().connect( Gaffer.WeakMethod( self.__cancelClicked ), scoped = False ) + self.__cancelButton.clickedSignal().connect( Gaffer.WeakMethod( self.__cancelClicked ) ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) self.__backgroundTask = None self.__messageHandler = IECore.CapturingMessageHandler() diff --git a/python/GafferUI/Backups.py b/python/GafferUI/Backups.py index 7e8ce7b3e40..6a6e8b38197 100644 --- a/python/GafferUI/Backups.py +++ b/python/GafferUI/Backups.py @@ -64,7 +64,7 @@ def __init__( self, applicationRoot ) : applicationRoot["preferences"]["backups"] = self.__settings - applicationRoot["preferences"].plugSetSignal().connect( self.__plugSet, scoped = False ) + applicationRoot["preferences"].plugSetSignal().connect( self.__plugSet ) self.__timer = QtCore.QTimer() self.__timer.timeout.connect( Gaffer.WeakMethod( self.__timeout ) ) diff --git a/python/GafferUI/BoolPlugValueWidget.py b/python/GafferUI/BoolPlugValueWidget.py index 5784f05cb7b..9550b22df8f 100644 --- a/python/GafferUI/BoolPlugValueWidget.py +++ b/python/GafferUI/BoolPlugValueWidget.py @@ -55,7 +55,7 @@ def __init__( self, plugs, displayMode=GafferUI.BoolWidget.DisplayMode.CheckBox, self._addPopupMenu( self.__boolWidget ) - self.__stateChangedConnection = self.__boolWidget.stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ), scoped = False ) + self.__stateChangedConnection = self.__boolWidget.stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ) ) def boolWidget( self ) : diff --git a/python/GafferUI/BoxUI.py b/python/GafferUI/BoxUI.py index ae4e0b112b0..9c611439907 100644 --- a/python/GafferUI/BoxUI.py +++ b/python/GafferUI/BoxUI.py @@ -385,7 +385,7 @@ def __plugPopupMenu( menuDefinition, plugValueWidget ) : __appendPlugResetDefaultMenuItems( menuDefinition, plugValueWidget.getPlug() ) __appendPlugPromotionMenuItems( menuDefinition, plugValueWidget.getPlug() ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) # GraphEditor plug context menu ########################################################################## @@ -487,4 +487,4 @@ def __graphEditorPlugContextMenu( graphEditor, plug, menuDefinition ) : __appendPlugPromotionMenuItems( menuDefinition, plug ) -GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu, scoped = False ) +GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu ) diff --git a/python/GafferUI/BrowserEditor.py b/python/GafferUI/BrowserEditor.py index d199e496679..3925ccd16ff 100644 --- a/python/GafferUI/BrowserEditor.py +++ b/python/GafferUI/BrowserEditor.py @@ -64,7 +64,7 @@ def __init__( self, scriptNode, **kw ) : ) for mode in self.__modes : modeMenu.append( mode[0] ) - modeMenu.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__modeChanged ), scoped = False ) + modeMenu.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__modeChanged ) ) self.__pathChooser = GafferUI.PathChooserWidget( Gaffer.DictPath( {}, "/" ), previewTypes=GafferUI.PathPreviewWidget.types() ) self.__pathChooser.pathWidget().setVisible( False ) diff --git a/python/GafferUI/Button.py b/python/GafferUI/Button.py index 1b59a13f0bd..fa2d8c7a414 100644 --- a/python/GafferUI/Button.py +++ b/python/GafferUI/Button.py @@ -79,8 +79,8 @@ def __init__( self, text="", image=None, hasFrame=True, highlightOnOver=True, ** self._qtWidget().setPalette( Button.__palette ) if highlightOnOver : - self.enterSignal().connect( Gaffer.WeakMethod( self.__enter ), scoped = False ) - self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ), scoped = False ) + self.enterSignal().connect( Gaffer.WeakMethod( self.__enter ) ) + self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ) ) def setHighlighted( self, highlighted ) : diff --git a/python/GafferUI/ButtonPlugValueWidget.py b/python/GafferUI/ButtonPlugValueWidget.py index 3d135f4d019..f165c63c22b 100644 --- a/python/GafferUI/ButtonPlugValueWidget.py +++ b/python/GafferUI/ButtonPlugValueWidget.py @@ -50,7 +50,7 @@ def __init__( self, plug, **kw ) : GafferUI.PlugValueWidget.__init__( self, self.__button, plug, **kw ) - self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ), scoped = False ) + self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ) ) self.setPlug( plug ) diff --git a/python/GafferUI/CodeWidget.py b/python/GafferUI/CodeWidget.py index 5465be62331..7bb2eb7a98c 100644 --- a/python/GafferUI/CodeWidget.py +++ b/python/GafferUI/CodeWidget.py @@ -64,9 +64,9 @@ def __init__( self, text="", editable=True, fixedLineHeight=None, **kw ) : self.__highlighter = _QtHighlighter( self._qtWidget().document() ) self.__commentPrefix = None - self.activatedSignal().connect( Gaffer.WeakMethod( self.__activated ), scoped = False ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.__textChangedConnection = self.textChangedSignal().connect( Gaffer.WeakMethod( self.__textChanged ), scoped = False ) + self.activatedSignal().connect( Gaffer.WeakMethod( self.__activated ) ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.__textChangedConnection = self.textChangedSignal().connect( Gaffer.WeakMethod( self.__textChanged ) ) def setCompleter( self, completer ) : diff --git a/python/GafferUI/CollectUI.py b/python/GafferUI/CollectUI.py index f7b36fe192d..65cbda7ef9e 100644 --- a/python/GafferUI/CollectUI.py +++ b/python/GafferUI/CollectUI.py @@ -208,9 +208,9 @@ def __init__( self, plug ) : GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand": True } ) - self.__menuButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.__menuButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.__menuButton.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.__menuButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.__menuButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.__menuButton.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) def _updateFromEditable( self ) : @@ -398,11 +398,9 @@ def __deletePlug( plug ) : plug.node().removeInput( input ) GafferUI.PlugValueWidget.popupMenuSignal().connect( - lambda menuDefinition, plugValueWidget : __plugPopupMenu( menuDefinition, plugValueWidget.getPlug() ), - scoped = False + lambda menuDefinition, plugValueWidget : __plugPopupMenu( menuDefinition, plugValueWidget.getPlug() ) ) GafferUI.GraphEditor.plugContextMenuSignal().connect( - lambda graphEditor, plug, menuDefinition : __plugPopupMenu( menuDefinition, plug ), - scoped = False + lambda graphEditor, plug, menuDefinition : __plugPopupMenu( menuDefinition, plug ) ) diff --git a/python/GafferUI/ColorChooser.py b/python/GafferUI/ColorChooser.py index 8206e340f4a..926f99e5972 100644 --- a/python/GafferUI/ColorChooser.py +++ b/python/GafferUI/ColorChooser.py @@ -176,11 +176,11 @@ def __init__( self, color = imath.Color3f( 1.0 ), staticComponent = "h", **kw ) self._qtWidget().paintEvent = Gaffer.WeakMethod( self.__paintEvent ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) self.__valueChangedSignal = Gaffer.Signals.Signal2() @@ -480,7 +480,7 @@ def __init__( self, color=imath.Color3f( 1 ), **kw ) : with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) : self.__colorField = _ColorField( color, "h" ) - self.__colorValueChangedConnection = self.__colorField.valueChangedSignal().connect( Gaffer.WeakMethod( self.__colorValueChanged ), scoped = False ) + self.__colorValueChangedConnection = self.__colorField.valueChangedSignal().connect( Gaffer.WeakMethod( self.__colorValueChanged ) ) # \todo Don't hide color field when we're ready to expose the UI self.__colorField.setVisible( False ) @@ -498,22 +498,19 @@ def __init__( self, color=imath.Color3f( 1 ), **kw ) : functools.partial( Gaffer.WeakMethod( self.__setStaticComponent ), component = component - ), - scoped = False + ) ) self.__channelLabels[component].enterSignal().connect( functools.partial( Gaffer.WeakMethod( self.__labelEnter ), component = component - ), - scoped = False + ) ) self.__channelLabels[component].leaveSignal().connect( functools.partial( Gaffer.WeakMethod( self.__labelLeave ), component = component - ), - scoped = False + ) ) numericWidget = GafferUI.NumericWidget( 0.0, parenting = { "index" : ( 1, row ) } ) @@ -526,11 +523,11 @@ def __init__( self, color=imath.Color3f( 1 ), **kw ) : self.__sliders[component] = slider self.__componentValueChangedConnections.append( - numericWidget.valueChangedSignal().connect( Gaffer.WeakMethod( self.__componentValueChanged ), scoped = False ) + numericWidget.valueChangedSignal().connect( Gaffer.WeakMethod( self.__componentValueChanged ) ) ) self.__componentValueChangedConnections.append( - slider.valueChangedSignal().connect( Gaffer.WeakMethod( self.__componentValueChanged ), scoped = False ) + slider.valueChangedSignal().connect( Gaffer.WeakMethod( self.__componentValueChanged ) ) ) # initial and current colour swatches @@ -538,7 +535,7 @@ def __init__( self, color=imath.Color3f( 1 ), **kw ) : self.__initialColorSwatch = GafferUI.ColorSwatch( color, parenting = { "expand" : True } ) self.__initialColorSwatch._qtWidget().setFixedHeight( 40 ) - self.__initialColorSwatch.buttonPressSignal().connect( Gaffer.WeakMethod( self.__initialColorPress ), scoped = False ) + self.__initialColorSwatch.buttonPressSignal().connect( Gaffer.WeakMethod( self.__initialColorPress ) ) self.__colorSwatch = GafferUI.ColorSwatch( color, parenting = { "expand" : True } ) self.__colorSwatch._qtWidget().setFixedHeight( 40 ) diff --git a/python/GafferUI/ColorChooserPlugValueWidget.py b/python/GafferUI/ColorChooserPlugValueWidget.py index 0193d500c7b..fd47d044bd4 100644 --- a/python/GafferUI/ColorChooserPlugValueWidget.py +++ b/python/GafferUI/ColorChooserPlugValueWidget.py @@ -50,7 +50,7 @@ def __init__( self, plugs, **kw ) : self.__colorChooser.setSwatchesVisible( False ) self.__colorChangedConnection = self.__colorChooser.colorChangedSignal().connect( - Gaffer.WeakMethod( self.__colorChanged ), scoped = False + Gaffer.WeakMethod( self.__colorChanged ) ) self.__lastChangedReason = None diff --git a/python/GafferUI/ColorPlugValueWidget.py b/python/GafferUI/ColorPlugValueWidget.py index 78260002df8..8e040dceb2c 100644 --- a/python/GafferUI/ColorPlugValueWidget.py +++ b/python/GafferUI/ColorPlugValueWidget.py @@ -59,10 +59,10 @@ def __init__( self, plugs, **kw ) : self.__compoundNumericWidget = GafferUI.CompoundNumericPlugValueWidget( plugs ) self.__swatch = GafferUI.ColorSwatchPlugValueWidget( plugs, parenting = { "expand" : True } ) - self.__swatch.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__swatchButtonRelease ), scoped = False ) + self.__swatch.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__swatchButtonRelease ) ) self.__chooserButton = GafferUI.Button( image = "colorPlugValueWidgetSlidersOff.png", hasFrame = False ) - self.__chooserButton.clickedSignal().connect( Gaffer.WeakMethod( self.__chooserButtonClicked ), scoped = False ) + self.__chooserButton.clickedSignal().connect( Gaffer.WeakMethod( self.__chooserButtonClicked ) ) self.__colorChooser = GafferUI.ColorChooserPlugValueWidget( plugs ) diff --git a/python/GafferUI/ColorSwatchPlugValueWidget.py b/python/GafferUI/ColorSwatchPlugValueWidget.py index 23ffce27f6f..752ef41369f 100644 --- a/python/GafferUI/ColorSwatchPlugValueWidget.py +++ b/python/GafferUI/ColorSwatchPlugValueWidget.py @@ -55,10 +55,10 @@ def __init__( self, plugs, **kw ) : self._addPopupMenu( self.__swatch ) - self.__swatch.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.__swatch.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.__swatch.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) - self.__swatch.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) + self.__swatch.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.__swatch.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.__swatch.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) + self.__swatch.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) def setHighlighted( self, highlighted ) : @@ -131,17 +131,17 @@ def __init__( self, plugs, parentWindow ) : self.__lastChangedReason = None self.__mergeGroupId = 0 - self.__colorChangedConnection = self.colorChooser().colorChangedSignal().connect( Gaffer.WeakMethod( self.__colorChanged ), scoped = False ) - self.confirmButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) - self.cancelButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__colorChangedConnection = self.colorChooser().colorChangedSignal().connect( Gaffer.WeakMethod( self.__colorChanged ) ) + self.confirmButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) + self.cancelButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__plugs = plugs self.__initialValues = { p : p.getValue() for p in self.__plugs } nodes = { p.node() for p in self.__plugs } - self.__plugSetConnections = [ n.plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ), scoped = False ) for n in nodes ] + self.__plugSetConnections = [ n.plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ) ) for n in nodes ] for node in nodes : - node.parentChangedSignal().connect( Gaffer.WeakMethod( self.__destroy ), scoped = False ) + node.parentChangedSignal().connect( Gaffer.WeakMethod( self.__destroy ) ) plug = next( iter( self.__plugs ) ) if len( self.__plugs ) == 1 : diff --git a/python/GafferUI/CompoundEditor.py b/python/GafferUI/CompoundEditor.py index 6514d4c729d..eaada12bb6c 100644 --- a/python/GafferUI/CompoundEditor.py +++ b/python/GafferUI/CompoundEditor.py @@ -64,8 +64,8 @@ def __init__( self, scriptNode, _state={}, **kw ) : self.__splitContainer.append( _TabbedContainer() ) - self.__splitContainer.keyPressSignal().connect( CompoundEditor.__keyPress, scoped = False ) - self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ), scoped = False ) + self.__splitContainer.keyPressSignal().connect( CompoundEditor.__keyPress ) + self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ) ) self.__windowState = _state.get( "windowState", {} ) @@ -79,7 +79,7 @@ def __init__( self, scriptNode, _state={}, **kw ) : # By Now, all Editors will have been created, so we can restore any state self.__restoreEditorState( _state.get( "editorState", {} ) ) - self.parentChangedSignal().connect( Gaffer.WeakMethod( self.__parentChanged ), scoped=False ) + self.parentChangedSignal().connect( Gaffer.WeakMethod( self.__parentChanged ) ) # Returns the editor of the specified type that the user is most likely to # be interested in. If `focussedOnly` is true, only editors with the keyboard @@ -165,7 +165,7 @@ def _createDetachedPanel( self, *args, **kwargs ) : panel = _DetachedPanel( self, *args, **kwargs ) panel.__removeOnCloseConnection = panel.closedSignal().connect( lambda w : w.parent()._removeDetachedPanel( w ), scoped = True ) - panel.keyPressSignal().connect( CompoundEditor.__keyPress, scoped = False ) + panel.keyPressSignal().connect( CompoundEditor.__keyPress ) scriptWindow = self.ancestor( GafferUI.ScriptWindow ) if scriptWindow : @@ -566,10 +566,10 @@ def __init__( self, cornerWidget=None, **kw ) : cornerWidget._qtWidget().setObjectName( "gafferCompoundEditorTools" ) self.setCornerWidget( cornerWidget ) - self.currentChangedSignal().connect( Gaffer.WeakMethod( self.__currentTabChanged ), scoped = False ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.currentChangedSignal().connect( Gaffer.WeakMethod( self.__currentTabChanged ) ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) tabBar = self._qtWidget().tabBar() tabBar.setProperty( "gafferHasTabCloseButtons", GafferUI._Variant.toVariant( True ) ) @@ -656,8 +656,7 @@ def __configureTab( self, editor ) : functools.partial( lambda editor, container, _ : container().removeEditor( editor() ), weakref.ref( editor ), weakref.ref( self ) - ), - scoped = False + ) ) tabIndex = self.index( editor ) @@ -1463,21 +1462,21 @@ def __init__( self ) : with row : self.__bookmarkNumber = GafferUI.Label( horizontalAlignment=GafferUI.Label.HorizontalAlignment.Right ) - self.__bookmarkNumber.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ), scoped=False ) + self.__bookmarkNumber.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ) ) self.__icon = GafferUI.Button( hasFrame=False, highlightOnOver=False ) self.__icon._qtWidget().setFixedHeight( 13 ) self.__icon._qtWidget().setFixedWidth( 13 ) - self.__icon.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ), scoped=False ) + self.__icon.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ) ) self.__menuButton = GafferUI.Button( image="menuIndicator.png", hasFrame=False, highlightOnOver=False ) self.__menuButton._qtWidget().setObjectName( "menuDownArrow" ) - self.__menuButton.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ), scoped=False ) + self.__menuButton.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ) ) self.addChild( row ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ), scoped=False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__showEditorFocusMenu ) ) @staticmethod def editorKeyPress( editor, event ) : diff --git a/python/GafferUI/CompoundNumericNoduleUI.py b/python/GafferUI/CompoundNumericNoduleUI.py index 39a51ec5263..8c4cb48dfc8 100644 --- a/python/GafferUI/CompoundNumericNoduleUI.py +++ b/python/GafferUI/CompoundNumericNoduleUI.py @@ -84,4 +84,4 @@ def __plugContextMenuSignal( graphEditor, plug, menuDefinition ) : } ) -GafferUI.GraphEditor.plugContextMenuSignal().connect( __plugContextMenuSignal, scoped = False ) +GafferUI.GraphEditor.plugContextMenuSignal().connect( __plugContextMenuSignal ) diff --git a/python/GafferUI/CompoundNumericPlugValueWidget.py b/python/GafferUI/CompoundNumericPlugValueWidget.py index 082c4e2e9f7..477e330da76 100644 --- a/python/GafferUI/CompoundNumericPlugValueWidget.py +++ b/python/GafferUI/CompoundNumericPlugValueWidget.py @@ -55,7 +55,7 @@ def __init__( self, plugs, **kw ) : GafferUI.PlugValueWidget.__init__( self, self.__row, plugs, **kw ) self.__ensureChildPlugValueWidgets() - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) def setPlugs( self, plugs ) : @@ -212,7 +212,7 @@ def __ensureChildPlugValueWidgets( self ) : w.setPlugs( { p[i] for p in self.getPlugs() } ) w.setVisible( i < visibleDimensions ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( CompoundNumericPlugValueWidget._popupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( CompoundNumericPlugValueWidget._popupMenu ) GafferUI.PlugValueWidget.registerType( Gaffer.V2fPlug, CompoundNumericPlugValueWidget ) GafferUI.PlugValueWidget.registerType( Gaffer.V3fPlug, CompoundNumericPlugValueWidget ) diff --git a/python/GafferUI/CompoundPathPreview.py b/python/GafferUI/CompoundPathPreview.py index d285662dc36..eab69ba3a8c 100644 --- a/python/GafferUI/CompoundPathPreview.py +++ b/python/GafferUI/CompoundPathPreview.py @@ -59,7 +59,7 @@ def __init__( self, path, childTypes=None, **kw ) : self.__labelsAndTabs.append( ( type, widget ) ) self.__currentTabChangedConnection = self.__tabbedContainer.currentChangedSignal().connect( - Gaffer.WeakMethod( self.__currentTabChanged ), scoped = False + Gaffer.WeakMethod( self.__currentTabChanged ) ) self.__preferredTab = None diff --git a/python/GafferUI/ConnectionPlugValueWidget.py b/python/GafferUI/ConnectionPlugValueWidget.py index 5482e3eb072..a6abc8d936c 100644 --- a/python/GafferUI/ConnectionPlugValueWidget.py +++ b/python/GafferUI/ConnectionPlugValueWidget.py @@ -60,10 +60,10 @@ def __init__( self, plug, **kw ) : row.append( self.__inputLabel, horizontalAlignment = GafferUI.HorizontalAlignment.Center, expand = True ) self.__frame.setChild( row ) - self.__frame.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) - self.__inputLabel.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) - self.__frame.enterSignal().connect( functools.partial( GafferUI.Frame.setHighlighted, highlighted=True ), scoped = False ) - self.__frame.leaveSignal().connect( functools.partial( GafferUI.Frame.setHighlighted, highlighted=False ), scoped = False ) + self.__frame.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) + self.__inputLabel.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) + self.__frame.enterSignal().connect( functools.partial( GafferUI.Frame.setHighlighted, highlighted=True ) ) + self.__frame.leaveSignal().connect( functools.partial( GafferUI.Frame.setHighlighted, highlighted=False ) ) self._addPopupMenu( self.__frame ) diff --git a/python/GafferUI/ContextQueryUI.py b/python/GafferUI/ContextQueryUI.py index 9269ff8dd06..aa50886b318 100644 --- a/python/GafferUI/ContextQueryUI.py +++ b/python/GafferUI/ContextQueryUI.py @@ -304,8 +304,7 @@ def __init__( self, plug ) : GafferUI.Spacer( imath.V2i( 1 ), imath.V2i( 999999, 1 ), parenting = { "expand": True } ) plug.node().plugSetSignal().connect( - Gaffer.WeakMethod( self.__updateQueryMetadata ), - scoped = False + Gaffer.WeakMethod( self.__updateQueryMetadata ) ) def _updateFromEditable( self ) : @@ -439,4 +438,4 @@ def __plugPopupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) diff --git a/python/GafferUI/DotUI.py b/python/GafferUI/DotUI.py index 5e5297ebe8c..763e24546bf 100644 --- a/python/GafferUI/DotUI.py +++ b/python/GafferUI/DotUI.py @@ -175,7 +175,7 @@ def __connectionContextMenu( graphEditor, destinationPlug, menuDefinition ) : } ) -GafferUI.GraphEditor.connectionContextMenuSignal().connect( __connectionContextMenu, scoped = False ) +GafferUI.GraphEditor.connectionContextMenuSignal().connect( __connectionContextMenu ) def __setPlugMetadata( plug, key, value ) : @@ -202,4 +202,4 @@ def __graphEditorPlugContextMenu( graphEditor, plug, menuDefinition ) : } ) -GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu, scoped = False ) +GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu ) diff --git a/python/GafferUI/EditScopeUI.py b/python/GafferUI/EditScopeUI.py index 2013fd9e134..0a8468267c8 100644 --- a/python/GafferUI/EditScopeUI.py +++ b/python/GafferUI/EditScopeUI.py @@ -143,14 +143,14 @@ def __init__( self, plug, **kw ) : ) GafferUI.Spacer( imath.V2i( 4, 1 ), imath.V2i( 4, 1 ) ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) # We connect to the front, and unconditionally return True to ensure that we never # run the default dropSignal handler from PlugValueWidget. - self.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ) ) self.__updatePlugInputChangedConnection() self.__acquireContextTracker() @@ -589,7 +589,7 @@ def __init__( self, processor, **kw ) : _acquireSummaryWidgetClass( self._summary )( processor["out"] ) textColor = QtGui.QColor( *_styleColors["foregroundInfo"] ).name() showLabel = GafferUI.Label( f"Show" ) - showLabel.linkActivatedSignal().connect( Gaffer.WeakMethod( self.__show ), scoped = False ) + showLabel.linkActivatedSignal().connect( Gaffer.WeakMethod( self.__show ) ) GafferUI.Divider() ## Called to retrieve the text for the summary label, so must be overridden @@ -655,7 +655,7 @@ def __init__( self, plug, **kw ) : with row : self.__errorImage = GafferUI.Image( "errorSmall.png" ) self.__label = GafferUI.Label() - self.__label.linkActivatedSignal().connect( Gaffer.WeakMethod( self.__linkActivated ), scoped = False ) + self.__label.linkActivatedSignal().connect( Gaffer.WeakMethod( self.__linkActivated ) ) GafferUI.Spacer( size = imath.V2i( 1, 20 ) ) self.__busyWidget = GafferUI.BusyWidget( size = 20 ) @@ -705,8 +705,8 @@ def __init__( self, editScope, **kw ) : self.__editScope = editScope self.__processorWidgets = {} - editScope.childAddedSignal().connect( Gaffer.WeakMethod( self.__editScopeChildAdded ), scoped = False ) - editScope.childRemovedSignal().connect( Gaffer.WeakMethod( self.__editScopeChildRemoved ), scoped = False ) + editScope.childAddedSignal().connect( Gaffer.WeakMethod( self.__editScopeChildAdded ) ) + editScope.childRemovedSignal().connect( Gaffer.WeakMethod( self.__editScopeChildRemoved ) ) self.__update() diff --git a/python/GafferUI/Editor.py b/python/GafferUI/Editor.py index cec3de58217..5b170ec70b8 100644 --- a/python/GafferUI/Editor.py +++ b/python/GafferUI/Editor.py @@ -94,13 +94,13 @@ def __init__( self, topLevelWidget, scriptNode, **kw ) : self.__settings.setName( self.__class__.__name__ + "Settings" ) self.__settings["__scriptNode"].setInput( scriptNode["fileName"] ) Gaffer.NodeAlgo.applyUserDefaults( self.__settings ) - self.settings().plugDirtiedSignal().connect( Gaffer.WeakMethod( self._updateFromSettings ), scoped = False ) + self.settings().plugDirtiedSignal().connect( Gaffer.WeakMethod( self._updateFromSettings ) ) self.__title = "" self.__titleChangedSignal = GafferUI.WidgetSignal() - self.enterSignal().connect( Gaffer.WeakMethod( self.__enter ), scoped = False ) - self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ), scoped = False ) + self.enterSignal().connect( Gaffer.WeakMethod( self.__enter ) ) + self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ) ) self.__contextChangedConnection = scriptNode.context().changedSignal().connect( Gaffer.WeakMethod( self.__contextChanged ), scoped = True diff --git a/python/GafferUI/EventLoop.py b/python/GafferUI/EventLoop.py index 341bb7141d4..2eaf360af05 100644 --- a/python/GafferUI/EventLoop.py +++ b/python/GafferUI/EventLoop.py @@ -316,7 +316,7 @@ def __pump( self, thrusts=1 ) : for thrust in range( 0, thrusts ) : self.__qtEventLoop.processEvents() -GafferUI.Gadget._idleSignalAccessedSignal().connect( EventLoop._gadgetIdleSignalAccessed, scoped = False ) +GafferUI.Gadget._idleSignalAccessedSignal().connect( EventLoop._gadgetIdleSignalAccessed ) # Internal implementation for `EventLoop.executeOnUIThread()`. There are # multiple ways of achieving this in Qt, but they all boil down to scheduling an diff --git a/python/GafferUI/ExpressionUI.py b/python/GafferUI/ExpressionUI.py index 4378e3da712..c0549069c0e 100644 --- a/python/GafferUI/ExpressionUI.py +++ b/python/GafferUI/ExpressionUI.py @@ -125,7 +125,7 @@ def __popupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu ) # ExpressionWidget ########################################################################## @@ -150,14 +150,14 @@ def __init__( self, node, **kw ) : self.__textWidget = GafferUI.CodeWidget() self.__textWidget.setEditable( not Gaffer.MetadataAlgo.readOnly( node ) ) - self.__textWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__editingFinished ), scoped = False ) - self.__textWidget.dropTextSignal().connect( Gaffer.WeakMethod( self.__dropText ), scoped = False ) - self.__textWidget.contextMenuSignal().connect( Gaffer.WeakMethod( self.__expressionContextMenu ), scoped = False ) + self.__textWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__editingFinished ) ) + self.__textWidget.dropTextSignal().connect( Gaffer.WeakMethod( self.__dropText ) ) + self.__textWidget.contextMenuSignal().connect( Gaffer.WeakMethod( self.__expressionContextMenu ) ) self.__messageWidget = GafferUI.MessageWidget() - self.__node.expressionChangedSignal().connect( Gaffer.WeakMethod( self.__expressionChanged ), scoped = False ) - self.__node.errorSignal().connect( Gaffer.WeakMethod( self.__error ), scoped = False ) + self.__node.expressionChangedSignal().connect( Gaffer.WeakMethod( self.__expressionChanged ) ) + self.__node.errorSignal().connect( Gaffer.WeakMethod( self.__error ) ) self.__update() diff --git a/python/GafferUI/FileSequencePathFilterWidget.py b/python/GafferUI/FileSequencePathFilterWidget.py index b52a63c603b..107e30534f6 100644 --- a/python/GafferUI/FileSequencePathFilterWidget.py +++ b/python/GafferUI/FileSequencePathFilterWidget.py @@ -45,7 +45,7 @@ def __init__( self, pathFilter, **kw ) : GafferUI.PathFilterWidget.__init__( self, self.__checkBox, pathFilter, **kw ) - self.__checkBox.stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ), scoped = False ) + self.__checkBox.stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ) ) self._updateFromPathFilter() diff --git a/python/GafferUI/GLWidget.py b/python/GafferUI/GLWidget.py index b6a9d434215..015d7a3e6f0 100644 --- a/python/GafferUI/GLWidget.py +++ b/python/GafferUI/GLWidget.py @@ -102,7 +102,7 @@ def __init__( self, bufferOptions = set(), **kw ) : GafferUI.Widget.__init__( self, graphicsView, **kw ) self.__overlays = set() - self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ), scoped = False ) + self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ) ) ## Adds a widget to be overlaid on top of the GL rendering, # stretched to fill the frame. diff --git a/python/GafferUI/GadgetWidget.py b/python/GafferUI/GadgetWidget.py index 49fe3e19cbf..1dd898c1c1a 100644 --- a/python/GafferUI/GadgetWidget.py +++ b/python/GafferUI/GadgetWidget.py @@ -61,24 +61,24 @@ def __init__( self, gadget=None, **kw ) : self._qtWidget().setFocusPolicy( QtCore.Qt.ClickFocus ) - self.enterSignal().connect( Gaffer.WeakMethod( self.__enter ), scoped = False ) - self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ), scoped = False ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.keyReleaseSignal().connect( Gaffer.WeakMethod( self.__keyRelease ), scoped = False ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) - self.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ), scoped = False ) - self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) - self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) - - self.wheelSignal().connect( Gaffer.WeakMethod( self.__wheel ), scoped = False ) - - self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ), scoped = False ) + self.enterSignal().connect( Gaffer.WeakMethod( self.__enter ) ) + self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ) ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.keyReleaseSignal().connect( Gaffer.WeakMethod( self.__keyRelease ) ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) + self.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ) ) + self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) + self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) + + self.wheelSignal().connect( Gaffer.WeakMethod( self.__wheel ) ) + + self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ) ) self.__viewportGadget = None if isinstance( gadget, GafferUI.ViewportGadget ) : @@ -106,7 +106,7 @@ def setViewportGadget( self, viewportGadget ) : self.__viewportGadget.setVisible( False ) self.__viewportGadget = viewportGadget - self.__viewportGadget.renderRequestSignal().connect( Gaffer.WeakMethod( self.__renderRequest ), scoped = False ) + self.__viewportGadget.renderRequestSignal().connect( Gaffer.WeakMethod( self.__renderRequest ) ) size = self.size() if size.x and size.y : self.__viewportGadget.setViewport( size ) diff --git a/python/GafferUI/GraphBookmarksUI.py b/python/GafferUI/GraphBookmarksUI.py index 6595c6932bb..0502aa37f17 100644 --- a/python/GafferUI/GraphBookmarksUI.py +++ b/python/GafferUI/GraphBookmarksUI.py @@ -163,7 +163,7 @@ def assignFocus( i, menu ) : def connectToEditor( editor ) : - editor.keyPressSignal().connect( __editorKeyPress, scoped = False ) + editor.keyPressSignal().connect( __editorKeyPress ) ########################################################################## # Internal implementation diff --git a/python/GafferUI/GraphEditor.py b/python/GafferUI/GraphEditor.py index 48ee92649d2..efc99c83024 100644 --- a/python/GafferUI/GraphEditor.py +++ b/python/GafferUI/GraphEditor.py @@ -58,20 +58,20 @@ def __init__( self, scriptNode, **kw ) : GafferUI.Editor.__init__( self, self.__gadgetWidget, scriptNode, **kw ) graphGadget = GafferUI.GraphGadget( self.scriptNode() ) - graphGadget.rootChangedSignal().connect( Gaffer.WeakMethod( self.__rootChanged ), scoped = False ) + graphGadget.rootChangedSignal().connect( Gaffer.WeakMethod( self.__rootChanged ) ) self.__gadgetWidget.getViewportGadget().setPrimaryChild( graphGadget ) self.__gadgetWidget.getViewportGadget().setDragTracking( GafferUI.ViewportGadget.DragTracking.XDragTracking | GafferUI.ViewportGadget.DragTracking.YDragTracking ) self.__frame( scriptNode.selection() ) - self.__gadgetWidget.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.__gadgetWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.__gadgetWidget.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ), scoped = False ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.__gadgetWidget.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.__gadgetWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.__gadgetWidget.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ) ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) self.__dragEnterPointer = None - self.__gadgetWidget.getViewportGadget().preRenderSignal().connect( Gaffer.WeakMethod( self.__preRender ), scoped = False ) + self.__gadgetWidget.getViewportGadget().preRenderSignal().connect( Gaffer.WeakMethod( self.__preRender ) ) with GafferUI.ListContainer( borderWidth = 8, spacing = 0 ) as overlay : with GafferUI.ListContainer( @@ -311,7 +311,7 @@ def _nodeMenu( self ) : if self.__nodeMenu is None : self.__nodeMenu = GafferUI.Menu( GafferUI.NodeMenu.acquire( self.scriptNode().applicationRoot() ).definition(), searchable=True ) - self.__nodeMenu.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__nodeMenuVisibilityChanged ), scoped = False ) + self.__nodeMenu.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__nodeMenuVisibilityChanged ) ) return self.__nodeMenu diff --git a/python/GafferUI/InfoPathFilterWidget.py b/python/GafferUI/InfoPathFilterWidget.py index 210fa636bde..bc3026fb47f 100644 --- a/python/GafferUI/InfoPathFilterWidget.py +++ b/python/GafferUI/InfoPathFilterWidget.py @@ -54,13 +54,13 @@ def __init__( self, pathFilter, **kw ) : with self.__row : filterButton = GafferUI.Button( image="collapsibleArrowDown.png", hasFrame=False ) - filterButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + filterButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__filterText = GafferUI.TextWidget() self.__filterText.setPlaceholderText( "Filter..." ) - self.__filterText.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__filterEditingFinished ), scoped = False ) - self.__filterText.textChangedSignal().connect( Gaffer.WeakMethod( self.__filterTextChanged ), scoped = False ) + self.__filterText.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__filterEditingFinished ) ) + self.__filterText.textChangedSignal().connect( Gaffer.WeakMethod( self.__filterTextChanged ) ) def _updateFromPathFilter( self ) : diff --git a/python/GafferUI/LabelPlugValueWidget.py b/python/GafferUI/LabelPlugValueWidget.py index cff0769b3f8..f2cf09f5c4e 100644 --- a/python/GafferUI/LabelPlugValueWidget.py +++ b/python/GafferUI/LabelPlugValueWidget.py @@ -89,8 +89,8 @@ def __init__( self, plug, horizontalAlignment=GafferUI.Label.HorizontalAlignment # Connecting at front so we're called before the slots # connected by the NameLabel class. - self.__label.dragBeginSignal().connectFront( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.__label.dragEndSignal().connectFront( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + self.__label.dragBeginSignal().connectFront( Gaffer.WeakMethod( self.__dragBegin ) ) + self.__label.dragEndSignal().connectFront( Gaffer.WeakMethod( self.__dragEnd ) ) self._addPopupMenu( self.__label ) @@ -244,7 +244,7 @@ def __labelDoubleClicked( self, label, event ) : self.__editableLabel._qtWidget().setMinimumSize( self.label()._qtWidget().minimumSize() ) self.__editableLabel._qtWidget().setMaximumSize( self.label()._qtWidget().maximumSize() ) # Connect at front so we're called before the NameWidget's own slots. - self.__editableLabel.editingFinishedSignal().connectFront( Gaffer.WeakMethod( self.__labelEditingFinished ), scoped = False ) + self.__editableLabel.editingFinishedSignal().connectFront( Gaffer.WeakMethod( self.__labelEditingFinished ) ) self._qtWidget().layout().insertWidget( 0, self.__editableLabel._qtWidget() ) self.__label.setVisible( False ) diff --git a/python/GafferUI/LoopUI.py b/python/GafferUI/LoopUI.py index c360f24a639..cad325a23d7 100644 --- a/python/GafferUI/LoopUI.py +++ b/python/GafferUI/LoopUI.py @@ -180,4 +180,4 @@ def __graphEditorPlugContextMenu( graphEditor, plug, menuDefinition ) : } ) -GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu, scoped = False ) +GafferUI.GraphEditor.plugContextMenuSignal().connect( __graphEditorPlugContextMenu ) diff --git a/python/GafferUI/MatchPatternPathFilterWidget.py b/python/GafferUI/MatchPatternPathFilterWidget.py index 98711314fa9..5022d2fffe1 100644 --- a/python/GafferUI/MatchPatternPathFilterWidget.py +++ b/python/GafferUI/MatchPatternPathFilterWidget.py @@ -48,12 +48,12 @@ def __init__( self, pathFilter, **kw ) : self.__row = GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing=2, borderWidth=0 ) GafferUI.PathFilterWidget.__init__( self, self.__row, pathFilter, **kw ) - pathFilter.changedSignal().connect( Gaffer.WeakMethod( self.__updatePlaceholderText ), scoped = False ) + pathFilter.changedSignal().connect( Gaffer.WeakMethod( self.__updatePlaceholderText ) ) with self.__row : self.__enabledWidget = GafferUI.BoolWidget() - self.__enabledWidget.stateChangedSignal().connect( Gaffer.WeakMethod( self.__enabledStateChanged ), scoped = False ) + self.__enabledWidget.stateChangedSignal().connect( Gaffer.WeakMethod( self.__enabledStateChanged ) ) self.__propertyButton = GafferUI.MenuButton( image = "collapsibleArrowDown.png", @@ -63,8 +63,8 @@ def __init__( self, pathFilter, **kw ) : self.__patternWidget = GafferUI.TextWidget() - self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ), scoped = False ) - self.__patternWidget.textChangedSignal().connect( Gaffer.WeakMethod( self.__patternTextChanged ), scoped = False ) + self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ) ) + self.__patternWidget.textChangedSignal().connect( Gaffer.WeakMethod( self.__patternTextChanged ) ) self.__updatePlaceholderText( pathFilter ) self._updateFromPathFilter() diff --git a/python/GafferUI/MenuBar.py b/python/GafferUI/MenuBar.py index e277e8e994d..2bbfa45a5c1 100644 --- a/python/GafferUI/MenuBar.py +++ b/python/GafferUI/MenuBar.py @@ -59,8 +59,8 @@ def __init__( self, definition, **kw ) : self.__shortcutEventFilter = None self.definition = definition - self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ), scoped = False ) - self.parentChangedSignal().connect( Gaffer.WeakMethod( self.__parentChanged ), scoped = False ) + self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ) ) + self.parentChangedSignal().connect( Gaffer.WeakMethod( self.__parentChanged ) ) self.__setupShortcutEventFilter() ## Adds a listener to the supplied gaffer widget to action any menu items diff --git a/python/GafferUI/MessageWidget.py b/python/GafferUI/MessageWidget.py index ab8ffcfb26d..bf5cd2e0ec4 100644 --- a/python/GafferUI/MessageWidget.py +++ b/python/GafferUI/MessageWidget.py @@ -82,7 +82,7 @@ def __init__( self, messageLevel = IECore.MessageHandler.Level.Info, role = Role GafferUI.Label( "Show" ) self.__levelWidget = _MessageLevelWidget() - self.__levelWidget.messageLevelChangedSignal().connect( Gaffer.WeakMethod( self.__messageLevelChanged ), scoped = False ) + self.__levelWidget.messageLevelChangedSignal().connect( Gaffer.WeakMethod( self.__messageLevelChanged ) ) GafferUI.Spacer( imath.V2i( 6 ), preferredSize = imath.V2i( 100, 0 ) ) @@ -96,13 +96,13 @@ def __init__( self, messageLevel = IECore.MessageHandler.Level.Info, role = Role toolTips = { l : "Click to jump to next {} message [{}]".format( l, shortcuts[l] ) for l in _messageLevels } self.__summaryWidget = MessageSummaryWidget( displayLevel = IECore.MessageHandler.Level.Debug, hideUnusedLevels = False, buttonToolTip = toolTips ) - self.__summaryWidget.levelButtonClickedSignal().connect( Gaffer.WeakMethod( self.__levelButtonClicked ), scoped = False ) + self.__summaryWidget.levelButtonClickedSignal().connect( Gaffer.WeakMethod( self.__levelButtonClicked ) ) GafferUI.Spacer( imath.V2i( 0 ) ) self.__toEndButton = GafferUI.Button( image = "scrollToBottom.png", hasFrame = False ) self.__toEndButton.setToolTip( "Scroll to bottom and follow new messages [B]" ) - self.__toEndButton.buttonPressSignal().connect( Gaffer.WeakMethod( self.__table.scrollToLatest ), scoped = False ) + self.__toEndButton.buttonPressSignal().connect( Gaffer.WeakMethod( self.__table.scrollToLatest ) ) GafferUI.Spacer( imath.V2i( 3 ), imath.V2i( 3 ) ) @@ -110,15 +110,15 @@ def __init__( self, messageLevel = IECore.MessageHandler.Level.Info, role = Role upperToolbar.addChild( self.__table.searchWidget() ) - self.__table.messageLevelChangedSignal().connect( Gaffer.WeakMethod( self.__messageLevelChanged ), scoped = False ) - self.__table.messagesChangedSignal().connect( Gaffer.WeakMethod( self.__messagesChanged ), scoped = False ) + self.__table.messageLevelChangedSignal().connect( Gaffer.WeakMethod( self.__messageLevelChanged ) ) + self.__table.messagesChangedSignal().connect( Gaffer.WeakMethod( self.__messagesChanged ) ) if follow : # When following, we manage the enabled state of the toEndButton based on the auto-scroll # state of the table view. If we're not, then it should remain active the whole time. self.__isFollowingMessagesChanged( self.__table ) - self.__table.isFollowingMessagesChangedSignal().connect( Gaffer.WeakMethod( self.__isFollowingMessagesChanged ), scoped = False ) + self.__table.isFollowingMessagesChangedSignal().connect( Gaffer.WeakMethod( self.__isFollowingMessagesChanged ) ) self.__messageHandler = _MessageHandler( self ) @@ -305,7 +305,7 @@ def __init__( self, displayLevel = IECore.MessageHandler.Level.Warning, hideUnus break button = GafferUI.Button( image = str(level).lower() + "Small.png", hasFrame = False ) - button.clickedSignal().connect( functools.partial( lambda l, _ : buttonSignal( l ), level ), scoped = False ) + button.clickedSignal().connect( functools.partial( lambda l, _ : buttonSignal( l ), level ) ) if isinstance( buttonToolTip, dict ) : button.setToolTip( buttonToolTip[ level ] ) @@ -407,19 +407,19 @@ def __init__( self, tableView, **kw ) : self.__resultCount = GafferUI.Label() self.__prevButton = GafferUI.Button( image = "arrowLeft10.png", hasFrame = False ) - self.__prevButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__prevButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__nextButton = GafferUI.Button( image = "arrowRight10.png", hasFrame = False ) - self.__nextButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__nextButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__focusButton = GafferUI.Button( image = "searchFocusOff.png", hasFrame = False ) - self.__focusButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__focusButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__searchField = GafferUI.TextWidget() # Edited catches focus-out and makes sure we update the search text - self.__searchField.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__textEdited ), scoped = False ) + self.__searchField.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__textEdited ) ) # Activated allows to repeatedly jump to the next search result - self.__searchField.activatedSignal().connect( Gaffer.WeakMethod( self.__textActivated ), scoped = False ) + self.__searchField.activatedSignal().connect( Gaffer.WeakMethod( self.__textActivated ) ) self.__searchField._qtWidget().setObjectName( "gafferSearchField" ) self.__searchField.setPlaceholderText( "Search" ) self.__searchField._qtWidget().setMaximumWidth( 250 ) @@ -435,9 +435,9 @@ def __init__( self, tableView, **kw ) : self.__searchField._qtWidget().addAction( self.__clearAction, QtWidgets.QLineEdit.TrailingPosition ) self.__table = weakref.ref( tableView ) - tableView.searchTextChangedSignal().connect( Gaffer.WeakMethod( self.__searchTextChanged ), scoped = False ) - tableView.focusSearchResultsChangedSignal().connect( Gaffer.WeakMethod( self.__focusSearchResultsChanged ), scoped = False ) - tableView.searchResultsChangedSignal().connect( Gaffer.WeakMethod( self.__searchResultsChanged ), scoped = False ) + tableView.searchTextChangedSignal().connect( Gaffer.WeakMethod( self.__searchTextChanged ) ) + tableView.focusSearchResultsChangedSignal().connect( Gaffer.WeakMethod( self.__focusSearchResultsChanged ) ) + tableView.searchResultsChangedSignal().connect( Gaffer.WeakMethod( self.__searchResultsChanged ) ) self.__searchTextChanged( tableView ) self.__focusSearchResultsChanged( tableView ) @@ -539,7 +539,7 @@ def __init__( self, follow = False, expandRows = True, **kw ) : self.__userSetScrollPosition( False ) self.__setFollowMessages( follow ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) self.setMessageLevel( IECore.MessageHandler.Level.Info ) diff --git a/python/GafferUI/MetadataWidget.py b/python/GafferUI/MetadataWidget.py index 447a8926489..1f59350cc32 100644 --- a/python/GafferUI/MetadataWidget.py +++ b/python/GafferUI/MetadataWidget.py @@ -166,7 +166,7 @@ def __init__( self, key, target = None, defaultValue = False, **kw ) : MetadataWidget.__init__( self, self.__boolWidget, key, target, defaultValue = defaultValue, **kw ) self.__boolWidget.stateChangedSignal().connect( - Gaffer.WeakMethod( self.__stateChanged ), scoped = False + Gaffer.WeakMethod( self.__stateChanged ) ) def _updateFromValue( self, value ) : @@ -187,7 +187,7 @@ def __init__( self, key, target = None, defaultValue = "", acceptEmptyString = T self.__acceptEmptyString = acceptEmptyString self.__textWidget.editingFinishedSignal().connect( - Gaffer.WeakMethod( self.__editingFinished ), scoped = False + Gaffer.WeakMethod( self.__editingFinished ) ) def textWidget( self ) : @@ -214,7 +214,7 @@ def __init__( self, key, target = None, defaultValue = "", role = GafferUI.Multi MetadataWidget.__init__( self, self.__textWidget, key, target, defaultValue = defaultValue, **kw ) self.__textWidget.editingFinishedSignal().connect( - Gaffer.WeakMethod( self.__editingFinished ), scoped = False + Gaffer.WeakMethod( self.__editingFinished ) ) def textWidget( self ) : @@ -240,7 +240,7 @@ def __init__( self, key, target = None, defaultValue = imath.Color4f( 0, 0, 0, 0 self.__swatch._qtWidget().setFixedHeight( 18 ) self.__swatch._qtWidget().setMaximumWidth( 40 ) - self.__swatch.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) + self.__swatch.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) def _updateFromValue( self, value ) : @@ -315,13 +315,13 @@ def __init__( self, key, target = None, acceptEmptyString = True, defaultValue = self.__row.append( self.__pathWidget ) button = GafferUI.Button( image = "pathChooser.png", hasFrame=False ) - button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__row.append( button ) self.__acceptEmptyString = acceptEmptyString self.__pathWidget.editingFinishedSignal().connect( - Gaffer.WeakMethod( self.__editingFinished ), scoped = False + Gaffer.WeakMethod( self.__editingFinished ) ) def _updateFromValue( self, value ) : @@ -362,7 +362,7 @@ def __init__( self, key, target = None, defaultValue = 0, **kw ) : MetadataWidget.__init__( self, self.__numericWidget, key, target, defaultValue = defaultValue, **kw ) self.__numericWidget.valueChangedSignal().connect( - Gaffer.WeakMethod( self.__valueChanged ), scoped = False + Gaffer.WeakMethod( self.__valueChanged ) ) def numericWidget( self ) : diff --git a/python/GafferUI/MultiLineStringPlugValueWidget.py b/python/GafferUI/MultiLineStringPlugValueWidget.py index e5e62bcfa0b..27d0b58ede7 100644 --- a/python/GafferUI/MultiLineStringPlugValueWidget.py +++ b/python/GafferUI/MultiLineStringPlugValueWidget.py @@ -54,7 +54,7 @@ def __init__( self, plug, **kw ) : self._addPopupMenu( self.__textWidget ) - self.__textWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.__textWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) def textWidget( self ) : diff --git a/python/GafferUI/MultiLineTextWidget.py b/python/GafferUI/MultiLineTextWidget.py index ea4492e00df..81ed08ee941 100644 --- a/python/GafferUI/MultiLineTextWidget.py +++ b/python/GafferUI/MultiLineTextWidget.py @@ -78,11 +78,11 @@ def __init__( self, text="", editable=True, wrapMode=WrapMode.WordOrCharacter, f self.setRole( role ) self.setPlaceholderText( placeholderText ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) self._qtWidget().setTabStopWidth( 20 ) # pixels @@ -314,8 +314,8 @@ def linkActivatedSignal( self ) : return self.__linkActivatedSignal except : self.__linkActivatedSignal = GafferUI.WidgetEventSignal() - self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ), scoped = False ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) + self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ) ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) return self.__linkActivatedSignal diff --git a/python/GafferUI/NameLabel.py b/python/GafferUI/NameLabel.py index 5e47cec459a..5be475db817 100644 --- a/python/GafferUI/NameLabel.py +++ b/python/GafferUI/NameLabel.py @@ -63,9 +63,9 @@ def __init__( self, graphComponent, horizontalAlignment=GafferUI.Label.Horizonta self.__graphComponents = None # force setGraphComponent() to update no matter what self.setGraphComponents( graphComponents ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) ## Calling setText() disables the name tracking behaviour. ## \deprecated. Use a custom formatter to override the text. diff --git a/python/GafferUI/NameSwitchUI.py b/python/GafferUI/NameSwitchUI.py index 30833a6a3aa..aacefe6b570 100644 --- a/python/GafferUI/NameSwitchUI.py +++ b/python/GafferUI/NameSwitchUI.py @@ -179,12 +179,12 @@ def __init__( self, plug, **kw ) : self.__plugLayout = GafferUI.PlugLayout( plug ) self.__addButton = GafferUI.Button( image = "plus.png", hasFrame = False ) - self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addButtonClicked ), scoped = False ) + self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addButtonClicked ) ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ) ) self.__currentDragTarget = None @@ -320,10 +320,10 @@ def __init__( self, **kw ) : GafferUI.Image.__init__( self, "reorderVertically.png", **kw ) - self.enterSignal().connect( Gaffer.WeakMethod( self.__enter ), scoped = False ) - self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ), scoped = False ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) + self.enterSignal().connect( Gaffer.WeakMethod( self.__enter ) ) + self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ) ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) def __enter( self, widget ) : diff --git a/python/GafferUI/NameValuePlugValueWidget.py b/python/GafferUI/NameValuePlugValueWidget.py index 073cd59e60c..c12c1903dae 100644 --- a/python/GafferUI/NameValuePlugValueWidget.py +++ b/python/GafferUI/NameValuePlugValueWidget.py @@ -67,7 +67,7 @@ def __init__( self, childPlug ) : horizontalAlignment = GafferUI.Label.HorizontalAlignment.Right, ) nameWidget.label()._qtWidget().setFixedWidth( GafferUI.PlugWidget.labelWidth() ) - nameWidget.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ), scoped = False ) + nameWidget.dropSignal().connectFront( Gaffer.WeakMethod( self.__drop ) ) else : nameWidget = GafferUI.StringPlugValueWidget( { plug["name"] for plug in self.getPlugs() } ) nameWidget.textWidget()._qtWidget().setFixedWidth( GafferUI.PlugWidget.labelWidth() ) diff --git a/python/GafferUI/NameWidget.py b/python/GafferUI/NameWidget.py index 950070522d9..e56fe38e25f 100644 --- a/python/GafferUI/NameWidget.py +++ b/python/GafferUI/NameWidget.py @@ -54,7 +54,7 @@ def __init__( self, graphComponent, **kw ) : self.__graphComponent = False # Sentinel that forces `setGraphComponent()` to update self.setGraphComponent( graphComponent ) - self.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setName ), scoped = False ) + self.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setName ) ) def setGraphComponent( self, graphComponent ) : diff --git a/python/GafferUI/NodeEditor.py b/python/GafferUI/NodeEditor.py index 20394c0bb88..35489e697c2 100644 --- a/python/GafferUI/NodeEditor.py +++ b/python/GafferUI/NodeEditor.py @@ -72,7 +72,7 @@ def __init__( self, scriptNode, **kw ) : self.__typeLabel = GafferUI.Label() infoButton = GafferUI.Button( image = "info.png", hasFrame = False ) - infoButton.clickedSignal().connect( Gaffer.WeakMethod( self.__infoButtonClicked ), scoped = False ) + infoButton.clickedSignal().connect( Gaffer.WeakMethod( self.__infoButtonClicked ) ) GafferUI.MenuButton( image = "gear.png", diff --git a/python/GafferUI/NodeFinderDialogue.py b/python/GafferUI/NodeFinderDialogue.py index e8f35c72083..5f35ff61c62 100644 --- a/python/GafferUI/NodeFinderDialogue.py +++ b/python/GafferUI/NodeFinderDialogue.py @@ -77,9 +77,9 @@ def __init__( self, scope, **kw ) : self.__matchPattern = GafferUI.TextWidget( parenting = { "index" : ( 1, 2 ) } ) self.__matchPattern.setToolTip( "Use * to match any text and ? to match any single character.\nDrag a node here to get the text for selecting similar nodes." ) - self.__matchPattern.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.__matchPattern.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.__matchPattern.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.__matchPattern.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.__matchPattern.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.__matchPattern.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) self._setWidget( grid ) @@ -87,13 +87,13 @@ def __init__( self, scope, **kw ) : self.__selectNextButton = self._addButton( "Select Next" ) self.__selectAllButton = self._addButton( "Select All" ) - self.__matchPattern.activatedSignal().connect( Gaffer.WeakMethod( self.__activated ), scoped = False ) + self.__matchPattern.activatedSignal().connect( Gaffer.WeakMethod( self.__activated ) ) - self.__cancelButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) - self.__selectNextButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) - self.__selectAllButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__cancelButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) + self.__selectNextButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) + self.__selectAllButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) - self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ), scoped = False ) + self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ) ) self.__scope = None self.setScope( scope ) diff --git a/python/GafferUI/NodeSetEditor.py b/python/GafferUI/NodeSetEditor.py index a66e80f4c9a..b89e34066b0 100644 --- a/python/GafferUI/NodeSetEditor.py +++ b/python/GafferUI/NodeSetEditor.py @@ -289,8 +289,8 @@ def __init__( self, parentWindow, editor, **kw ) : self.setChild( editor ) - editor.titleChangedSignal().connect( Gaffer.WeakMethod( self.__updateTitle ), scoped = False ) - editor.getNodeSet().memberRemovedSignal().connect( Gaffer.WeakMethod( self.__nodeSetMemberRemoved ), scoped = False ) + editor.titleChangedSignal().connect( Gaffer.WeakMethod( self.__updateTitle ) ) + editor.getNodeSet().memberRemovedSignal().connect( Gaffer.WeakMethod( self.__nodeSetMemberRemoved ) ) parentWindow.addChildWindow( self, removeOnClose=True ) diff --git a/python/GafferUI/NotificationMessageHandler.py b/python/GafferUI/NotificationMessageHandler.py index ae456ae68ce..e5daf81b342 100644 --- a/python/GafferUI/NotificationMessageHandler.py +++ b/python/GafferUI/NotificationMessageHandler.py @@ -63,7 +63,7 @@ def handle( self, level, context, msg ) : if self.__window is None : self.__window = _Window( self.__windowTitle, self.__widgetKw ) - self.__window.closedSignal().connect( NotificationMessageHandler.__windowClosed, scoped = False ) + self.__window.closedSignal().connect( NotificationMessageHandler.__windowClosed ) NotificationMessageHandler.__windows.add( self.__window ) self.__window.appendMessage( level, context, msg ) diff --git a/python/GafferUI/NumericPlugValueWidget.py b/python/GafferUI/NumericPlugValueWidget.py index cbdc03fd563..4327343ac9e 100644 --- a/python/GafferUI/NumericPlugValueWidget.py +++ b/python/GafferUI/NumericPlugValueWidget.py @@ -57,8 +57,8 @@ def __init__( self, plugs, **kw ) : self.__lastChangedReason = None self.__mergeGroupId = 0 - self.__numericWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.__valueChangedConnection = self.__numericWidget.valueChangedSignal().connect( Gaffer.WeakMethod( self.__valueChanged ), scoped = False ) + self.__numericWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.__valueChangedConnection = self.__numericWidget.valueChangedSignal().connect( Gaffer.WeakMethod( self.__valueChanged ) ) def numericWidget( self ) : diff --git a/python/GafferUI/NumericWidget.py b/python/GafferUI/NumericWidget.py index 2ed1f2811f9..66f878a0220 100644 --- a/python/GafferUI/NumericWidget.py +++ b/python/GafferUI/NumericWidget.py @@ -59,13 +59,13 @@ def __init__( self, value, **kw ) : self.__dragValue = None self.__dragStart = None - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) - self.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__editingFinished ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) + self.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__editingFinished ) ) self.setPreferredCharacterWidth( 10 ) diff --git a/python/GafferUI/PathChooserDialogue.py b/python/GafferUI/PathChooserDialogue.py index 26800d20adc..ddb3bb09bb9 100644 --- a/python/GafferUI/PathChooserDialogue.py +++ b/python/GafferUI/PathChooserDialogue.py @@ -66,13 +66,13 @@ def __init__( self, path, title=None, cancelLabel="Cancel", confirmLabel="OK", a self.__pathChooserWidget = GafferUI.PathChooserWidget( path, allowMultipleSelection=allowMultipleSelection, bookmarks=bookmarks ) self._setWidget( self.__pathChooserWidget ) - self.__pathChooserWidget.pathSelectedSignal().connect( Gaffer.WeakMethod( self.__pathChooserSelected ), scoped = False ) - self.__pathChooserWidget.pathListingWidget().selectionChangedSignal().connect( Gaffer.WeakMethod( self.__updateButtonState ), scoped = False ) + self.__pathChooserWidget.pathSelectedSignal().connect( Gaffer.WeakMethod( self.__pathChooserSelected ) ) + self.__pathChooserWidget.pathListingWidget().selectionChangedSignal().connect( Gaffer.WeakMethod( self.__updateButtonState ) ) self.__cancelButton = self._addButton( cancelLabel ) - self.__cancelButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__cancelButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__confirmButton = self._addButton( confirmLabel ) - self.__confirmButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + self.__confirmButton.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__pathSelectedSignal = Gaffer.Signals.Signal1() diff --git a/python/GafferUI/PathChooserWidget.py b/python/GafferUI/PathChooserWidget.py index cd53a5cf81e..92b27199d0d 100644 --- a/python/GafferUI/PathChooserWidget.py +++ b/python/GafferUI/PathChooserWidget.py @@ -67,7 +67,7 @@ def __init__( self, path, previewTypes=[], allowMultipleSelection=False, bookmar self.__displayModeButton = GafferUI.Button( image = "pathListingTree.png", hasFrame=False ) self.__displayModeButton.setToolTip( "Toggle between list and tree views" ) - self.__displayModeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__displayModeButtonClicked ), scoped = False ) + self.__displayModeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__displayModeButtonClicked ) ) self.__bookmarksButton = GafferUI.MenuButton( image = "bookmarks.png", @@ -75,17 +75,17 @@ def __init__( self, path, previewTypes=[], allowMultipleSelection=False, bookmar menu = GafferUI.Menu( Gaffer.WeakMethod( self.__bookmarksMenuDefinition ) ), ) self.__bookmarksButton.setToolTip( "Bookmarks" ) - self.__bookmarksButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__bookmarksButtonDragEnter ), scoped = False ) - self.__bookmarksButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__bookmarksButtonDragLeave ), scoped = False ) - self.__bookmarksButton.dropSignal().connect( Gaffer.WeakMethod( self.__bookmarksButtonDrop ), scoped = False ) + self.__bookmarksButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__bookmarksButtonDragEnter ) ) + self.__bookmarksButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__bookmarksButtonDragLeave ) ) + self.__bookmarksButton.dropSignal().connect( Gaffer.WeakMethod( self.__bookmarksButtonDrop ) ) reloadButton = GafferUI.Button( image = "refresh.png", hasFrame=False ) reloadButton.setToolTip( "Refresh view" ) - reloadButton.clickedSignal().connect( Gaffer.WeakMethod( self.__reloadButtonClicked ), scoped = False ) + reloadButton.clickedSignal().connect( Gaffer.WeakMethod( self.__reloadButtonClicked ) ) upButton = GafferUI.Button( image = "pathUpArrow.png", hasFrame=False ) upButton.setToolTip( "Up one level" ) - upButton.clickedSignal().connect( Gaffer.WeakMethod( self.__upButtonClicked ), scoped = False ) + upButton.clickedSignal().connect( Gaffer.WeakMethod( self.__upButtonClicked ) ) GafferUI.Spacer( imath.V2i( 2, 2 ) ) @@ -101,7 +101,7 @@ def __init__( self, path, previewTypes=[], allowMultipleSelection=False, bookmar tmpPath, selectionMode = GafferUI.PathListingWidget.SelectionMode.Rows if allowMultipleSelection else GafferUI.PathListingWidget.SelectionMode.Row ) - self.__directoryListing.displayModeChangedSignal().connect( Gaffer.WeakMethod( self.__displayModeChanged ), scoped = False ) + self.__directoryListing.displayModeChangedSignal().connect( Gaffer.WeakMethod( self.__displayModeChanged ) ) if len( previewTypes ) : self.__previewWidget = GafferUI.CompoundPathPreview( tmpPath, childTypes=previewTypes ) else : @@ -120,9 +120,9 @@ def __init__( self, path, previewTypes=[], allowMultipleSelection=False, bookmar self.__pathSelectedSignal = GafferUI.WidgetSignal() - self.__directoryListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__listingSelectionChanged ), scoped = False ) - self.__directoryListing.pathSelectedSignal().connect( Gaffer.WeakMethod( self.__pathSelected ), scoped = False ) - self.__pathWidget.activatedSignal().connect( Gaffer.WeakMethod( self.__pathSelected ), scoped = False ) + self.__directoryListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__listingSelectionChanged ) ) + self.__directoryListing.pathSelectedSignal().connect( Gaffer.WeakMethod( self.__pathSelected ) ) + self.__pathWidget.activatedSignal().connect( Gaffer.WeakMethod( self.__pathSelected ) ) self.__path = None self.setPath( path ) diff --git a/python/GafferUI/PathFilterWidget.py b/python/GafferUI/PathFilterWidget.py index 7e48689f602..c0ce8580fd1 100644 --- a/python/GafferUI/PathFilterWidget.py +++ b/python/GafferUI/PathFilterWidget.py @@ -47,7 +47,7 @@ def __init__( self, topLevelWidget, pathFilter, **kw ) : GafferUI.Widget.__init__( self, topLevelWidget, **kw ) self.__pathFilter = pathFilter - self.__pathFilterChangedConnection = self.__pathFilter.changedSignal().connect( Gaffer.WeakMethod( self.__pathFilterChanged ), scoped = False ) + self.__pathFilterChangedConnection = self.__pathFilter.changedSignal().connect( Gaffer.WeakMethod( self.__pathFilterChanged ) ) ## Returns the PathFilter object this UI represents. def pathFilter( self ) : @@ -111,7 +111,7 @@ def __init__( self, pathFilter ) : PathFilterWidget.__init__( self, self.__checkBox, pathFilter ) - self.__checkBox.stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ), scoped = False ) + self.__checkBox.stateChangedSignal().connect( Gaffer.WeakMethod( self.__stateChanged ) ) self._updateFromPathFilter() diff --git a/python/GafferUI/PathListingWidget.py b/python/GafferUI/PathListingWidget.py index 51bdc22789c..9091349c095 100644 --- a/python/GafferUI/PathListingWidget.py +++ b/python/GafferUI/PathListingWidget.py @@ -151,14 +151,14 @@ def __init__( self.__columnContextMenuSignal = Gaffer.Signal3() # Connections for implementing selection and drag and drop. - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) - self.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ), scoped = False ) - self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) - self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) + self.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ) ) + self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) + self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ) ) self.__dragPointer = "paths" self.__path = None diff --git a/python/GafferUI/PathPlugValueWidget.py b/python/GafferUI/PathPlugValueWidget.py index 87b7ed49e32..ea2cc725a89 100644 --- a/python/GafferUI/PathPlugValueWidget.py +++ b/python/GafferUI/PathPlugValueWidget.py @@ -72,10 +72,10 @@ def __init__( self, plug, path=None, pathChooserDialogueKeywords=None, **kw ) : self.__row.append( pathWidget ) button = GafferUI.Button( image = "pathChooser.png", hasFrame=False ) - button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) self.__row.append( button ) - pathWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValue ), scoped = False ) + pathWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValue ) ) def path( self ) : diff --git a/python/GafferUI/PathVectorDataPlugValueWidget.py b/python/GafferUI/PathVectorDataPlugValueWidget.py index 3d4fdf23a3f..e0db8129278 100644 --- a/python/GafferUI/PathVectorDataPlugValueWidget.py +++ b/python/GafferUI/PathVectorDataPlugValueWidget.py @@ -58,7 +58,7 @@ def __init__( self, plug, path, pathChooserDialogueKeywords={}, **kw ) : GafferUI.PlugValueWidget.__init__( self, self.__dataWidget, plug, **kw ) - self.__dataWidget.dataChangedSignal().connect( Gaffer.WeakMethod( self.__dataChanged ), scoped = False ) + self.__dataWidget.dataChangedSignal().connect( Gaffer.WeakMethod( self.__dataChanged ) ) self.__deprecatedPathChooserDialogueKeywords = pathChooserDialogueKeywords def path( self ) : diff --git a/python/GafferUI/PathVectorDataWidget.py b/python/GafferUI/PathVectorDataWidget.py index f1b31e9f3d9..099693e718f 100644 --- a/python/GafferUI/PathVectorDataWidget.py +++ b/python/GafferUI/PathVectorDataWidget.py @@ -58,7 +58,7 @@ def __init__( self, data=None, editable=True, header=False, showIndices=True, pa self.__path = path if path is not None else Gaffer.FileSystemPath( "/" ) self.__pathChooserDialogueKeywords = pathChooserDialogueKeywords - self.editSignal().connect( Gaffer.WeakMethod( self.__edit ), scoped = False ) + self.editSignal().connect( Gaffer.WeakMethod( self.__edit ) ) def path( self ) : @@ -111,7 +111,7 @@ def __init__( self, path ) : with self : GafferUI.PathWidget( path ) button = GafferUI.Button( image = "pathChooser.png", hasFrame = False ) - button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ), scoped = False ) + button.clickedSignal().connect( Gaffer.WeakMethod( self.__buttonClicked ) ) GafferUI.Spacer( imath.V2i( 2 ) ) @@ -119,7 +119,7 @@ def __init__( self, path ) : self._qtWidget().setFocusProxy( self.__pathWidget()._qtWidget() ) self.__dialogue = None - GafferUI.Widget.focusChangedSignal().connect( Gaffer.WeakMethod( self.__focusChanged ), scoped = False ) + GafferUI.Widget.focusChangedSignal().connect( Gaffer.WeakMethod( self.__focusChanged ) ) def setValue( self, value ) : diff --git a/python/GafferUI/PathWidget.py b/python/GafferUI/PathWidget.py index f18faba1be5..8cc9d70237c 100644 --- a/python/GafferUI/PathWidget.py +++ b/python/GafferUI/PathWidget.py @@ -57,10 +57,10 @@ def __init__( self, path, **kw ) : # than the other things that go in TextWidgets. self.setPreferredCharacterWidth( 60 ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.selectingFinishedSignal().connect( Gaffer.WeakMethod( self.__selectingFinished ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.selectingFinishedSignal().connect( Gaffer.WeakMethod( self.__selectingFinished ) ) - self.textChangedSignal().connect( Gaffer.WeakMethod( self.__textChanged ), scoped = False ) + self.textChangedSignal().connect( Gaffer.WeakMethod( self.__textChanged ) ) self.__popupMenu = None diff --git a/python/GafferUI/PlugLayout.py b/python/GafferUI/PlugLayout.py index 2192843c3af..22cba4b2166 100644 --- a/python/GafferUI/PlugLayout.py +++ b/python/GafferUI/PlugLayout.py @@ -109,20 +109,20 @@ def __init__( self, parent, orientation = GafferUI.ListContainer.Orientation.Ver # we need to connect to the childAdded/childRemoved signals on # the parent so we can update the ui when plugs are added and removed. - parent.childAddedSignal().connect( Gaffer.WeakMethod( self.__childAddedOrRemoved ), scoped = False ) - parent.childRemovedSignal().connect( Gaffer.WeakMethod( self.__childAddedOrRemoved ), scoped = False ) + parent.childAddedSignal().connect( Gaffer.WeakMethod( self.__childAddedOrRemoved ) ) + parent.childRemovedSignal().connect( Gaffer.WeakMethod( self.__childAddedOrRemoved ) ) # since our layout is driven by metadata, we must respond dynamically # to changes in that metadata. - Gaffer.Metadata.plugValueChangedSignal( self.__node() ).connect( Gaffer.WeakMethod( self.__plugMetadataChanged ), scoped = False ) + Gaffer.Metadata.plugValueChangedSignal( self.__node() ).connect( Gaffer.WeakMethod( self.__plugMetadataChanged ) ) if isinstance( self.__parent, Gaffer.Node ) : Gaffer.Metadata.nodeValueChangedSignal( self.__parent ).connect( - Gaffer.WeakMethod( self.__nodeMetadataChanged ), scoped = False + Gaffer.WeakMethod( self.__nodeMetadataChanged ) ) # and since our activations are driven by plug values, we must respond # when the plugs are dirtied. - self.__node().plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__plugDirtied ), scoped = False ) + self.__node().plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__plugDirtied ) ) # frequently events that trigger a ui update come in batches, so we # perform the update lazily using a LazyMethod. the dirty variables @@ -628,8 +628,7 @@ def __init__( self, orientation, embedded = False, **kw ) : self.__tabbedContainer._qtWidget().setSizePolicy( QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Expanding ) ) self.__currentTabChangedConnection = self.__tabbedContainer.currentChangedSignal().connect( - Gaffer.WeakMethod( self.__currentTabChanged ), - scoped = False + Gaffer.WeakMethod( self.__currentTabChanged ) ) def update( self, section ) : @@ -725,8 +724,7 @@ def update( self, section ) : collapsible.setCollapsed( False ) collapsible.stateChangedSignal().connect( - functools.partial( Gaffer.WeakMethod( self.__collapsibleStateChanged ), subsection = subsection ), - scoped = False + functools.partial( Gaffer.WeakMethod( self.__collapsibleStateChanged ), subsection = subsection ) ) self.__collapsibles[name] = collapsible diff --git a/python/GafferUI/PlugPopup.py b/python/GafferUI/PlugPopup.py index d948264e789..63cea1cf79a 100644 --- a/python/GafferUI/PlugPopup.py +++ b/python/GafferUI/PlugPopup.py @@ -115,8 +115,8 @@ def __init__( self, plugs, title = None, warning = None, **kw ) : if colorPlugValueWidget is not None : colorPlugValueWidget.setColorChooserVisible( True ) - self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ), scoped = False ) - self.focusChangedSignal().connect( Gaffer.WeakMethod( self.__focusChanged ), scoped = False ) + self.visibilityChangedSignal().connect( Gaffer.WeakMethod( self.__visibilityChanged ) ) + self.focusChangedSignal().connect( Gaffer.WeakMethod( self.__focusChanged ) ) def popup( self, center = None, parent = None ) : diff --git a/python/GafferUI/PlugValueWidget.py b/python/GafferUI/PlugValueWidget.py index af9bf22dd12..aa6ce3aae41 100644 --- a/python/GafferUI/PlugValueWidget.py +++ b/python/GafferUI/PlugValueWidget.py @@ -81,13 +81,12 @@ def __init__( self, topLevelWidget, plugs, **kw ) : # classes haven't constructed. We'll do that in `_postConstructor()`. self.__setPlugsInternal( plugs, callUpdateMethods=False ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) Gaffer.Metadata.nodeValueChangedSignal().connect( - Gaffer.WeakMethod( self.__nodeMetadataChanged ), - scoped = False + Gaffer.WeakMethod( self.__nodeMetadataChanged ) ) ## Changes the plugs displayed by this widget. May be overridden by derived classes, @@ -430,10 +429,10 @@ def _addPopupMenu( self, widget = None, buttons = GafferUI.ButtonEvent.Buttons.R # it's unclear under what circumstances we get given a right-click vs a context menu event, # but we try to cover all our bases by connecting to both. - widget.buttonPressSignal().connect( functools.partial( Gaffer.WeakMethod( self.__buttonPress ), buttonMask = buttons ), scoped = False ) + widget.buttonPressSignal().connect( functools.partial( Gaffer.WeakMethod( self.__buttonPress ), buttonMask = buttons ) ) if buttons & GafferUI.ButtonEvent.Buttons.Right : - widget.contextMenuSignal().connect( functools.partial( Gaffer.WeakMethod( self.__contextMenu ) ), scoped = False ) + widget.contextMenuSignal().connect( functools.partial( Gaffer.WeakMethod( self.__contextMenu ) ) ) ## Returns a definition for the popup menu - this is called each time the menu is displayed # to allow for dynamic menus. Subclasses may override this method to customise the menu, but diff --git a/python/GafferUI/PlugWidget.py b/python/GafferUI/PlugWidget.py index d448232a744..9c2ce650908 100644 --- a/python/GafferUI/PlugWidget.py +++ b/python/GafferUI/PlugWidget.py @@ -101,9 +101,9 @@ def __init__( self, plugOrWidget, label=None, description=None, **kw ) : # because it has specialised PlugValueWidget._convertValue(). It's also more meaningful to the # user if we highlight the plugValueWidget() on dragEnter rather than the label. So we # forward the dragEnter/dragLeave/drop signals from the labelPlugValueWidget() to the plugValueWidget(). - self.__label.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__labelDragEnter ), scoped = False ) - self.__label.dragLeaveSignal().connectFront( Gaffer.WeakMethod( self.__labelDragLeave ), scoped = False ) - self.__label.dropSignal().connectFront( Gaffer.WeakMethod( self.__labelDrop ), scoped = False ) + self.__label.dragEnterSignal().connectFront( Gaffer.WeakMethod( self.__labelDragEnter ) ) + self.__label.dragLeaveSignal().connectFront( Gaffer.WeakMethod( self.__labelDragLeave ) ) + self.__label.dropSignal().connectFront( Gaffer.WeakMethod( self.__labelDrop ) ) def plugValueWidget( self ) : diff --git a/python/GafferUI/PopupWindow.py b/python/GafferUI/PopupWindow.py index 1550fcbfa33..4813a3b6d19 100644 --- a/python/GafferUI/PopupWindow.py +++ b/python/GafferUI/PopupWindow.py @@ -56,7 +56,7 @@ def __init__( self, title = "GafferUI.Window", borderWidth = 8, child = None, ** self._qtWidget().setAttribute( QtCore.Qt.WA_TranslucentBackground ) self._qtWidget().paintEvent = Gaffer.WeakMethod( self.__paintEvent ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) ## Note : A valid `parent` widget must be supplied if widgets in the PopupWindow # are to inherit a display transform from the main UI. diff --git a/python/GafferUI/PythonEditor.py b/python/GafferUI/PythonEditor.py index 1c6c7603ce3..86078531ad4 100644 --- a/python/GafferUI/PythonEditor.py +++ b/python/GafferUI/PythonEditor.py @@ -68,7 +68,7 @@ def __init__( self, scriptNode, **kw ) : ) self.__outputWidget._qtWidget().setObjectName( "gafferPythonEditorOutputWidget" ) self.__outputWidget.contextMenuSignal().connect( - Gaffer.WeakMethod( self.__contextMenu ), scoped = False + Gaffer.WeakMethod( self.__contextMenu ) ) self.__inputWidget = GafferUI.CodeWidget() @@ -76,10 +76,10 @@ def __init__( self, scriptNode, **kw ) : self.__splittable.append( self.__outputWidget ) self.__splittable.append( self.__inputWidget ) - self.__inputWidget.activatedSignal().connect( Gaffer.WeakMethod( self.__activated ), scoped = False ) - self.__inputWidget.dropTextSignal().connect( Gaffer.WeakMethod( self.__dropText ), scoped = False ) + self.__inputWidget.activatedSignal().connect( Gaffer.WeakMethod( self.__activated ) ) + self.__inputWidget.dropTextSignal().connect( Gaffer.WeakMethod( self.__dropText ) ) self.__inputWidget.contextMenuSignal().connect( - Gaffer.WeakMethod( self.__contextMenu ), scoped = False + Gaffer.WeakMethod( self.__contextMenu ) ) GafferUI.WidgetAlgo.joinEdges( [ self.__outputWidget, self.__inputWidget ], diff --git a/python/GafferUI/RampPlugValueWidget.py b/python/GafferUI/RampPlugValueWidget.py index 45f6b33be3f..f7dbd41ba7d 100644 --- a/python/GafferUI/RampPlugValueWidget.py +++ b/python/GafferUI/RampPlugValueWidget.py @@ -57,7 +57,7 @@ def __init__( self, plug, **kw ) : drawModeWidget.append( "Ramp" ) drawModeWidget.append( "Curves" ) drawModeWidget.setSelection( "Ramp" ) - drawModeWidget.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__drawModeChanged ), scoped = False ) + drawModeWidget.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__drawModeChanged ) ) GafferUI.Spacer( imath.V2i( 0 ), parenting = { "expand" : True } ) GafferUI.PlugWidget( GafferUI.PlugValueWidget.create( plug["interpolation"] ) ) @@ -71,9 +71,9 @@ def __init__( self, plug, **kw ) : self.__slider = GafferUI.Slider() self.__slider.setMinimumSize( 2 ) - self.__positionsChangedConnection = self.__slider.valueChangedSignal().connect( Gaffer.WeakMethod( self.__positionsChanged ), scoped = False ) - self.__slider.indexRemovedSignal().connect( Gaffer.WeakMethod( self.__indexRemoved ), scoped = False ) - self.__slider.selectedIndexChangedSignal().connect( Gaffer.WeakMethod( self.__selectedIndexChanged ), scoped = False ) + self.__positionsChangedConnection = self.__slider.valueChangedSignal().connect( Gaffer.WeakMethod( self.__positionsChanged ) ) + self.__slider.indexRemovedSignal().connect( Gaffer.WeakMethod( self.__indexRemoved ) ) + self.__slider.selectedIndexChangedSignal().connect( Gaffer.WeakMethod( self.__selectedIndexChanged ) ) self.__lastPositionChangedReason = None self.__positionsMergeGroupId = 0 diff --git a/python/GafferUI/RandomChoiceUI.py b/python/GafferUI/RandomChoiceUI.py index 0a4704cbac7..a364c24b8eb 100644 --- a/python/GafferUI/RandomChoiceUI.py +++ b/python/GafferUI/RandomChoiceUI.py @@ -258,4 +258,4 @@ def __popupMenu( menuDefinition, plugValueWidget ) : menuDefinition.prepend( "/RandomiseDivider", { "divider" : True } ) menuDefinition.prepend( "/Randomise...", item ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu ) diff --git a/python/GafferUI/RandomUI.py b/python/GafferUI/RandomUI.py index 6ecde4939b7..4db4d3aa9a7 100644 --- a/python/GafferUI/RandomUI.py +++ b/python/GafferUI/RandomUI.py @@ -261,4 +261,4 @@ def __popupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __popupMenu ) diff --git a/python/GafferUI/ReferenceUI.py b/python/GafferUI/ReferenceUI.py index 7cbffb53ab0..74de005c28c 100644 --- a/python/GafferUI/ReferenceUI.py +++ b/python/GafferUI/ReferenceUI.py @@ -110,13 +110,13 @@ def __init__( self, node, **kw ) : loadButton = GafferUI.Button( image = "pathChooser.png", hasFrame=False ) loadButton.setToolTip( "Load" ) - loadButton.clickedSignal().connect( Gaffer.WeakMethod( self.__loadClicked ), scoped = False ) + loadButton.clickedSignal().connect( Gaffer.WeakMethod( self.__loadClicked ) ) self.__reloadButton = GafferUI.Button( image = "refresh.png", hasFrame=False ) self.__reloadButton.setToolTip( "Reload" ) - self.__reloadButton.clickedSignal().connect( Gaffer.WeakMethod( self.__reloadClicked ), scoped = False ) + self.__reloadButton.clickedSignal().connect( Gaffer.WeakMethod( self.__reloadClicked ) ) - node.referenceLoadedSignal().connect( Gaffer.WeakMethod( self.__referenceLoaded ), scoped = False ) + node.referenceLoadedSignal().connect( Gaffer.WeakMethod( self.__referenceLoaded ) ) def __loadClicked( self, button ) : @@ -207,4 +207,4 @@ def __graphEditorNodeContextMenu( graphEditor, node, menuDefinition ) : } ) -GafferUI.GraphEditor.nodeContextMenuSignal().connect( __graphEditorNodeContextMenu, scoped = False ) +GafferUI.GraphEditor.nodeContextMenuSignal().connect( __graphEditorNodeContextMenu ) diff --git a/python/GafferUI/RefreshPlugValueWidget.py b/python/GafferUI/RefreshPlugValueWidget.py index e40c859886d..e9b80ceb11b 100644 --- a/python/GafferUI/RefreshPlugValueWidget.py +++ b/python/GafferUI/RefreshPlugValueWidget.py @@ -47,7 +47,7 @@ def __init__( self, plug, **kw ) : GafferUI.PlugValueWidget.__init__( self, self.__button, plug, **kw ) - self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ), scoped = False ) + self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ) ) def __clicked( self, widget ) : diff --git a/python/GafferUI/ScriptWindow.py b/python/GafferUI/ScriptWindow.py index aa7393df199..f11753f6183 100644 --- a/python/GafferUI/ScriptWindow.py +++ b/python/GafferUI/ScriptWindow.py @@ -70,7 +70,7 @@ def __init__( self, script, **kw ) : else : self.setLayout( GafferUI.CompoundEditor( script ) ) - self.closedSignal().connect( Gaffer.WeakMethod( self.__closed ), scoped = False ) + self.closedSignal().connect( Gaffer.WeakMethod( self.__closed ) ) ScriptWindow.__instances.append( weakref.ref( self ) ) @@ -182,8 +182,8 @@ def menuDefinition( applicationOrApplicationRoot ) : @classmethod def connect( cls, applicationRoot ) : - applicationRoot["scripts"].childAddedSignal().connectFront( ScriptWindow.__scriptAdded, scoped = False ) - applicationRoot["scripts"].childRemovedSignal().connect( ScriptWindow.__staticScriptRemoved, scoped = False ) + applicationRoot["scripts"].childAddedSignal().connectFront( ScriptWindow.__scriptAdded ) + applicationRoot["scripts"].childRemovedSignal().connect( ScriptWindow.__staticScriptRemoved ) __automaticallyCreatedInstances = [] # strong references to instances made by __scriptAdded() @staticmethod diff --git a/python/GafferUI/ShufflePlugValueWidget.py b/python/GafferUI/ShufflePlugValueWidget.py index 070b8c5250c..c9c58d61e8c 100644 --- a/python/GafferUI/ShufflePlugValueWidget.py +++ b/python/GafferUI/ShufflePlugValueWidget.py @@ -176,7 +176,7 @@ def __init__( self, plug ) : self.__plugLayout = GafferUI.PlugLayout( plug ) self.__addButton = GafferUI.Button( image = "plus.png", hasFrame = False ) - self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addButtonClicked ), scoped = False ) + self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addButtonClicked ) ) def hasLabel( self ) : diff --git a/python/GafferUI/Slider.py b/python/GafferUI/Slider.py index b401af5f6e5..2419d57846e 100644 --- a/python/GafferUI/Slider.py +++ b/python/GafferUI/Slider.py @@ -82,14 +82,14 @@ def __init__( self, values=0.5, min=0, max=1, hardMin=None, hardMax=None, **kw ) self.__hoverPositionVisible = False self.__hoverEvent = None # The mouseMove event that gives us hover status - self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ), scoped = False ) - self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ), scoped = False ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.leaveSignal().connect( Gaffer.WeakMethod( self.__leave ) ) + self.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ) ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) self.__values = [] if isinstance( values, ( int, float ) ) : diff --git a/python/GafferUI/SplinePlugValueWidget.py b/python/GafferUI/SplinePlugValueWidget.py index 25300fd57cd..a41d05c4b8b 100644 --- a/python/GafferUI/SplinePlugValueWidget.py +++ b/python/GafferUI/SplinePlugValueWidget.py @@ -50,7 +50,7 @@ def __init__( self, plug, **kw ) : self.__splineWidget._qtWidget().setFixedHeight( 20 ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) self.__editorWindow = None @@ -122,8 +122,8 @@ def __init__( self, plug ) : # `acquire()` should even be responsible for building the # dialogues, so it's able to build a dialogue around any # PlugValueWidget? - plug.parentChangedSignal().connect( Gaffer.WeakMethod( self.__destroy ), scoped = False ) - plug.node().parentChangedSignal().connect( Gaffer.WeakMethod( self.__destroy ), scoped = False ) + plug.parentChangedSignal().connect( Gaffer.WeakMethod( self.__destroy ) ) + plug.node().parentChangedSignal().connect( Gaffer.WeakMethod( self.__destroy ) ) @classmethod def acquire( cls, plug ) : diff --git a/python/GafferUI/SpreadsheetUI/_Menus.py b/python/GafferUI/SpreadsheetUI/_Menus.py index 5a71e1475b6..380fa4dbc30 100644 --- a/python/GafferUI/SpreadsheetUI/_Menus.py +++ b/python/GafferUI/SpreadsheetUI/_Menus.py @@ -184,7 +184,7 @@ def __plugPopupMenu( menuDefinition, plugValueWidget ) : # over this ordering. __prependSpreadsheetCreationMenuItems( menuDefinition, plugValueWidget ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) for plugType in ( Gaffer.TransformPlug, Gaffer.Transform2DPlug ) : Gaffer.Metadata.registerValue( plugType, "spreadsheet:plugMenu:includeAsAncestor", True ) @@ -238,4 +238,4 @@ def __nodeEditorToolMenu( nodeEditor, node, menuDefinition ) : } ) -GafferUI.NodeEditor.toolMenuSignal().connect( __nodeEditorToolMenu, scoped = False ) +GafferUI.NodeEditor.toolMenuSignal().connect( __nodeEditorToolMenu ) diff --git a/python/GafferUI/SpreadsheetUI/_PlugTableView.py b/python/GafferUI/SpreadsheetUI/_PlugTableView.py index 00b6ac662a7..757760a15bb 100755 --- a/python/GafferUI/SpreadsheetUI/_PlugTableView.py +++ b/python/GafferUI/SpreadsheetUI/_PlugTableView.py @@ -82,7 +82,7 @@ def __init__( self, selectionModel, mode, **kw ) : self.__horizontalHeader = GafferUI.Widget( QtWidgets.QHeaderView( QtCore.Qt.Horizontal, tableView ) ) self.__horizontalHeader._qtWidget().setDefaultAlignment( QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter ) tableView.setHorizontalHeader( self.__horizontalHeader._qtWidget() ) - self.__horizontalHeader.buttonPressSignal().connect( Gaffer.WeakMethod( self.__headerButtonPress ), scoped = False ) + self.__horizontalHeader.buttonPressSignal().connect( Gaffer.WeakMethod( self.__headerButtonPress ) ) if mode in ( self.Mode.Cells, self.Mode.Defaults ) : @@ -111,14 +111,14 @@ def __init__( self, selectionModel, mode, **kw ) : tableView.setProperty( "gafferToggleIndicator", True ) self.__plugMetadataChangedConnection = Gaffer.Metadata.plugValueChangedSignal( tableView.model().rowsPlug().node() ).connect( - Gaffer.WeakMethod( self.__plugMetadataChanged ), scoped = False + Gaffer.WeakMethod( self.__plugMetadataChanged ) ) - Gaffer.Metadata.nodeValueChangedSignal().connect( Gaffer.WeakMethod( self.__nodeMetadataChanged ), scoped = False ) + Gaffer.Metadata.nodeValueChangedSignal().connect( Gaffer.WeakMethod( self.__nodeMetadataChanged ) ) - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) if mode != self.Mode.Defaults : tableView.horizontalHeader().setVisible( False ) @@ -142,9 +142,9 @@ def __init__( self, selectionModel, mode, **kw ) : tableView.setEditTriggers( tableView.NoEditTriggers ) tableView.setSelectionMode( tableView.ExtendedSelection ) tableView.setSelectionBehavior( tableView.SelectItems ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ), scoped = False ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.buttonDoubleClickSignal().connect( Gaffer.WeakMethod( self.__buttonDoubleClick ) ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) # Drawing diff --git a/python/GafferUI/SpreadsheetUI/_RowsPlugValueWidget.py b/python/GafferUI/SpreadsheetUI/_RowsPlugValueWidget.py index 2cd00196eb7..5529610710d 100755 --- a/python/GafferUI/SpreadsheetUI/_RowsPlugValueWidget.py +++ b/python/GafferUI/SpreadsheetUI/_RowsPlugValueWidget.py @@ -77,7 +77,7 @@ def __init__( self, plug ) : "index" : ( 1, 0 ), } ) - self.__sectionChooser.currentSectionChangedSignal().connect( Gaffer.WeakMethod( self.__currentSectionChanged ), scoped = False ) + self.__sectionChooser.currentSectionChangedSignal().connect( Gaffer.WeakMethod( self.__currentSectionChanged ) ) with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, @@ -91,17 +91,17 @@ def __init__( self, plug ) : ) : self.__toggleFilterButton = GafferUI.Button( image = "search.png", hasFrame = False ) - self.__toggleFilterButton.clickedSignal().connect( Gaffer.WeakMethod( self.__toggleFilterButtonClicked ), scoped = False ) + self.__toggleFilterButton.clickedSignal().connect( Gaffer.WeakMethod( self.__toggleFilterButtonClicked ) ) self.__patternWidget = GafferUI.TextWidget( toolTip = "Row filter pattern" ) self.__patternWidget.setText( Gaffer.Metadata.value( plug, "spreadsheet:rowFilter" ) ) self.__patternWidget.setPlaceholderText( "Filter..." ) # Ignore the width in X so that the widget is sized based on the width dictated by `rowNamesTable`. self.__patternWidget._qtWidget().setSizePolicy( QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed ) - self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ), scoped = False ) + self.__patternWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__patternEditingFinished ) ) self.__refreshFilterButton = GafferUI.Button( image = "refresh.png", hasFrame = False, toolTip = "Click to refresh row filter" ) - self.__refreshFilterButton.clickedSignal().connect( Gaffer.WeakMethod( self.__refreshFilterButtonClicked ), scoped = False ) + self.__refreshFilterButton.clickedSignal().connect( Gaffer.WeakMethod( self.__refreshFilterButtonClicked ) ) self.__defaultLabel = GafferUI.Label( "

Default

", horizontalAlignment = GafferUI.HorizontalAlignment.Right ) self.__defaultLabel._qtWidget().setObjectName( "gafferDefaultRowLabel" ) @@ -130,9 +130,9 @@ def __init__( self, plug ) : image="plus.png", hasFrame=False, toolTip = "Click to add column, or drop plug to connect", menu = GafferUI.Menu( Gaffer.WeakMethod( self.__addColumnMenuDefinition ) ) ) - self.__addColumnButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__addColumnButtonDragEnter ), scoped = False ) - self.__addColumnButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__addColumnButtonDragLeave ), scoped = False ) - self.__addColumnButton.dropSignal().connect( Gaffer.WeakMethod( self.__addColumnButtonDrop ), scoped = False ) + self.__addColumnButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__addColumnButtonDragEnter ) ) + self.__addColumnButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__addColumnButtonDragLeave ) ) + self.__addColumnButton.dropSignal().connect( Gaffer.WeakMethod( self.__addColumnButtonDrop ) ) self.__rowNamesTable = _PlugTableView( selectionModel, _PlugTableView.Mode.RowNames, @@ -185,10 +185,10 @@ def __init__( self, plug ) : "alignment" : ( GafferUI.HorizontalAlignment.Left, GafferUI.VerticalAlignment.Top ), } ) - self.__addRowButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addRowButtonClicked ), scoped = False ) - self.__addRowButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__addRowButtonDragEnter ), scoped = False ) - self.__addRowButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__addRowButtonDragLeave ), scoped = False ) - self.__addRowButton.dropSignal().connect( Gaffer.WeakMethod( self.__addRowButtonDrop ), scoped = False ) + self.__addRowButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addRowButtonClicked ) ) + self.__addRowButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__addRowButtonDragEnter ) ) + self.__addRowButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__addRowButtonDragLeave ) ) + self.__addRowButton.dropSignal().connect( Gaffer.WeakMethod( self.__addRowButtonDrop ) ) if isinstance( plug.node(), Gaffer.Reference ) : # Currently we only allow new rows to be added to references @@ -210,14 +210,14 @@ def __init__( self, plug ) : self.__addColumnButton.setVisible( False ) for widget in [ self.__addRowButton, self.__addColumnButton, self.__patternWidget, self.__refreshFilterButton, self.__toggleFilterButton ] : - widget.enterSignal().connect( Gaffer.WeakMethod( self.__enterToolTippedWidget ), scoped = False ) - widget.leaveSignal().connect( Gaffer.WeakMethod( self.__leaveToolTippedWidget ), scoped = False ) + widget.enterSignal().connect( Gaffer.WeakMethod( self.__enterToolTippedWidget ) ) + widget.leaveSignal().connect( Gaffer.WeakMethod( self.__leaveToolTippedWidget ) ) for widget in [ self.__defaultTable, self.__cellsTable ] : - widget.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__cellsMouseMove ), scoped = False ) - widget.leaveSignal().connect( Gaffer.WeakMethod( self.__cellsLeave ), scoped = False ) + widget.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__cellsMouseMove ) ) + widget.leaveSignal().connect( Gaffer.WeakMethod( self.__cellsLeave ) ) - Gaffer.Metadata.plugValueChangedSignal( plug.node() ).connect( Gaffer.WeakMethod( self.__plugMetadataChanged ), scoped = False ) + Gaffer.Metadata.plugValueChangedSignal( plug.node() ).connect( Gaffer.WeakMethod( self.__plugMetadataChanged ) ) self.__rowFilterEnabled = Gaffer.Metadata.value( plug, "spreadsheet:rowFilterEnabled" ) diff --git a/python/GafferUI/SpreadsheetUI/_SectionChooser.py b/python/GafferUI/SpreadsheetUI/_SectionChooser.py index 1ee83a29af1..002222e1b42 100644 --- a/python/GafferUI/SpreadsheetUI/_SectionChooser.py +++ b/python/GafferUI/SpreadsheetUI/_SectionChooser.py @@ -68,11 +68,10 @@ def __init__( self, rowsPlug, **kw ) : self.__ignoreCurrentChanged = False tabBar.tabMoved.connect( Gaffer.WeakMethod( self.__tabMoved ) ) self.__plugMetadataChangedConnection = Gaffer.Metadata.plugValueChangedSignal( self.__rowsPlug.node() ).connect( - Gaffer.WeakMethod( self.__plugMetadataChanged ), - scoped = False + Gaffer.WeakMethod( self.__plugMetadataChanged ) ) - self.__rowsPlug.defaultRow()["cells"].childAddedSignal().connect( Gaffer.WeakMethod( self.__columnAdded ), scoped = False ) - self.__rowsPlug.defaultRow()["cells"].childRemovedSignal().connect( Gaffer.WeakMethod( self.__columnRemoved ), scoped = False ) + self.__rowsPlug.defaultRow()["cells"].childAddedSignal().connect( Gaffer.WeakMethod( self.__columnAdded ) ) + self.__rowsPlug.defaultRow()["cells"].childRemovedSignal().connect( Gaffer.WeakMethod( self.__columnRemoved ) ) self.__updateTabs() diff --git a/python/GafferUI/SpreadsheetUI/__init__.py b/python/GafferUI/SpreadsheetUI/__init__.py index 53ef31a496c..616ace90863 100644 --- a/python/GafferUI/SpreadsheetUI/__init__.py +++ b/python/GafferUI/SpreadsheetUI/__init__.py @@ -102,7 +102,7 @@ def addRowButtonMenuSignal() : # menuDefinition.append( "/CustomDivider", { "divider" : True } ) # menuDefinition.append( "/Custom", { "command" : functools.partial( addColumn, widget.getPlug() ) } ) # -# GafferUI.SpreadsheetUI.addColumnButtonMenuSignal().connect( customAddColumnMenu, scoped = False ) +# GafferUI.SpreadsheetUI.addColumnButtonMenuSignal().connect( customAddColumnMenu ) # ``` # # > Tip : The `menuDefinition` will already contain a set of default diff --git a/python/GafferUI/StringPlugValueWidget.py b/python/GafferUI/StringPlugValueWidget.py index 1b9ddca6961..4c7afaeb163 100644 --- a/python/GafferUI/StringPlugValueWidget.py +++ b/python/GafferUI/StringPlugValueWidget.py @@ -58,9 +58,9 @@ def __init__( self, plugs, **kw ) : self._addPopupMenu( self.__textWidget ) - self.__textWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.__textWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__editingFinished ), scoped = False ) - self.__textChangedConnection = self.__textWidget.textChangedSignal().connect( Gaffer.WeakMethod( self.__textChanged ), scoped = False ) + self.__textWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.__textWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__editingFinished ) ) + self.__textChangedConnection = self.__textWidget.textChangedSignal().connect( Gaffer.WeakMethod( self.__textChanged ) ) def textWidget( self ) : diff --git a/python/GafferUI/TabbedContainer.py b/python/GafferUI/TabbedContainer.py index 37416b6696c..8da50c18aca 100644 --- a/python/GafferUI/TabbedContainer.py +++ b/python/GafferUI/TabbedContainer.py @@ -62,9 +62,9 @@ def __init__( self, cornerWidget=None, **kw ) : self.__tabBar = GafferUI.Widget( QtWidgets.QTabBar() ) self.__tabBar._qtWidget().setDrawBase( False ) self.__tabBar._qtWidget().tabMoved.connect( Gaffer.WeakMethod( self.__moveWidget ) ) - self.__tabBar.dragEnterSignal().connect( Gaffer.WeakMethod( self.__tabBarDragEnter ), scoped = False ) - self.__tabBar.dragMoveSignal().connect( Gaffer.WeakMethod( self.__tabBarDragMove ), scoped = False ) - self.__tabBar.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__tabBarDragLeave ), scoped = False ) + self.__tabBar.dragEnterSignal().connect( Gaffer.WeakMethod( self.__tabBarDragEnter ) ) + self.__tabBar.dragMoveSignal().connect( Gaffer.WeakMethod( self.__tabBarDragMove ) ) + self.__tabBar.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__tabBarDragLeave ) ) self.__tabBarDragState = self.__DragState.None_ # See comments in Button.py diff --git a/python/GafferUI/TextInputDialogue.py b/python/GafferUI/TextInputDialogue.py index 2fd064f21ad..45dc79f0bc3 100644 --- a/python/GafferUI/TextInputDialogue.py +++ b/python/GafferUI/TextInputDialogue.py @@ -51,7 +51,7 @@ def __init__( self, initialText="", title="Enter text", cancelLabel="Cancel", co self.__textWidget.setSelection( None, None ) # all text self._setWidget( self.__textWidget ) - self.__textWidget.activatedSignal().connect( Gaffer.WeakMethod( self.__textActivated ), scoped = False ) + self.__textWidget.activatedSignal().connect( Gaffer.WeakMethod( self.__textActivated ) ) self.__cancelButton = self._addButton( cancelLabel ) self.__confirmButton = self._addButton( confirmLabel ) diff --git a/python/GafferUI/TextWidget.py b/python/GafferUI/TextWidget.py index 71470355e8e..888a5aec41e 100644 --- a/python/GafferUI/TextWidget.py +++ b/python/GafferUI/TextWidget.py @@ -261,10 +261,10 @@ def selectingFinishedSignal( self ) : return self.__selectingFinishedSignal except : self.__selectingFinishedSignal = GafferUI.WidgetSignal() - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.keyReleaseSignal().connect( Gaffer.WeakMethod( self.__keyRelease ), scoped = False ) - self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.keyReleaseSignal().connect( Gaffer.WeakMethod( self.__keyRelease ) ) + self.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) self.__lastSelection = self.getSelection() self.__numSelectionPossiblyFinishedEvents = 0 diff --git a/python/GafferUI/Timeline.py b/python/GafferUI/Timeline.py index a28d3a45f81..579d8d817ee 100644 --- a/python/GafferUI/Timeline.py +++ b/python/GafferUI/Timeline.py @@ -57,7 +57,7 @@ def __init__( self, scriptNode, **kw ) : with self.__row : self.__visibilityButton = GafferUI.Button( image="timeline3.png", hasFrame=False ) - self.__visibilityButton.clickedSignal().connect( Gaffer.WeakMethod( self.__visibilityButtonClicked ), scoped = False ) + self.__visibilityButton.clickedSignal().connect( Gaffer.WeakMethod( self.__visibilityButtonClicked ) ) self.__scriptRangeStart = GafferUI.NumericPlugValueWidget( scriptNode["frameRange"]["start"] ) self.__scriptRangeStart.numericWidget().setFixedCharacterWidth( 4 ) @@ -66,7 +66,7 @@ def __init__( self, scriptNode, **kw ) : self.__sliderRangeStart = GafferUI.NumericWidget( scriptNode["frameRange"]["start"].getValue() ) self.__sliderRangeStart.setFixedCharacterWidth( 4 ) self.__sliderRangeStart.setToolTip( "Slider minimum" ) - self.__sliderRangeStartChangedConnection = self.__sliderRangeStart.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__sliderRangeChanged ), scoped = False ) + self.__sliderRangeStartChangedConnection = self.__sliderRangeStart.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__sliderRangeChanged ) ) self.__slider = _TimelineSlider( value = self.context().getFrame(), @@ -77,32 +77,32 @@ def __init__( self, scriptNode, **kw ) : self.__slider.setIncrement( 0 ) # disable so the slider doesn't mask our global frame increment shortcut self.__slider.setSnapIncrement( 1 ) self.__slider.setHoverPositionVisible( True ) - self.__sliderValueChangedConnection = self.__slider.valueChangedSignal().connect( Gaffer.WeakMethod( self.__valueChanged ), scoped = False ) + self.__sliderValueChangedConnection = self.__slider.valueChangedSignal().connect( Gaffer.WeakMethod( self.__valueChanged ) ) self.__startButton = GafferUI.Button( image = "timelineStart.png", hasFrame=False ) - self.__startButton.clickedSignal().connect( Gaffer.WeakMethod( self.__startOrEndButtonClicked ), scoped = False ) + self.__startButton.clickedSignal().connect( Gaffer.WeakMethod( self.__startOrEndButtonClicked ) ) self.__playPauseButton = GafferUI.Button( image = "timelinePlay.png", hasFrame=False ) - self.__playPauseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__playPauseClicked ), scoped = False ) + self.__playPauseButton.clickedSignal().connect( Gaffer.WeakMethod( self.__playPauseClicked ) ) self.__endButton = GafferUI.Button( image = "timelineEnd.png", hasFrame=False ) - self.__endButton.clickedSignal().connect( Gaffer.WeakMethod( self.__startOrEndButtonClicked ), scoped = False ) + self.__endButton.clickedSignal().connect( Gaffer.WeakMethod( self.__startOrEndButtonClicked ) ) self.__frame = GafferUI.NumericWidget( self.context().getFrame() ) self.__frame.setFixedCharacterWidth( 5 ) self.__frame.setToolTip( "Current frame" ) - self.__frameChangedConnection = self.__frame.valueChangedSignal().connect( Gaffer.WeakMethod( self.__valueChanged ), scoped = False ) + self.__frameChangedConnection = self.__frame.valueChangedSignal().connect( Gaffer.WeakMethod( self.__valueChanged ) ) self.__sliderRangeEnd = GafferUI.NumericWidget( scriptNode["frameRange"]["end"].getValue() ) self.__sliderRangeEnd.setFixedCharacterWidth( 4 ) self.__sliderRangeEnd.setToolTip( "Slider maximum" ) - self.__sliderRangeEndChangedConnection = self.__sliderRangeEnd.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__sliderRangeChanged ), scoped = False ) + self.__sliderRangeEndChangedConnection = self.__sliderRangeEnd.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__sliderRangeChanged ) ) self.__scriptRangeEnd = GafferUI.NumericPlugValueWidget( scriptNode["frameRange"]["end"] ) self.__scriptRangeEnd.numericWidget().setFixedCharacterWidth( 4 ) self.__scriptRangeEnd.setToolTip( self.__scriptRangeEnd.getPlug().fullName() ) - scriptNode.plugSetSignal().connect( Gaffer.WeakMethod( self.__scriptNodePlugSet ), scoped = False ) + scriptNode.plugSetSignal().connect( Gaffer.WeakMethod( self.__scriptNodePlugSet ) ) frameIncrementShortcut = QtWidgets.QShortcut( QtGui.QKeySequence( "Right" ), self._qtWidget() ) frameIncrementShortcut.activated.connect( Gaffer.WeakMethod( self.__incrementFrame ) ) @@ -119,10 +119,10 @@ def __init__( self, scriptNode, **kw ) : self.__playback = GafferUI.Playback.acquire( self.context() ) self.__playback.setFrameRange( self.__sliderRangeStart.getValue(), self.__sliderRangeEnd.getValue() ) self.__playback.stateChangedSignal().connect( - Gaffer.WeakMethod( self.__playbackStateChanged ), scoped = False + Gaffer.WeakMethod( self.__playbackStateChanged ) ) self.__playback.frameRangeChangedSignal().connect( - Gaffer.WeakMethod( self.__playbackFrameRangeChanged ), scoped = False + Gaffer.WeakMethod( self.__playbackFrameRangeChanged ) ) self._updateFromContext( { "frame" } ) diff --git a/python/GafferUI/UIEditor.py b/python/GafferUI/UIEditor.py index 53263895b09..da4059acf79 100644 --- a/python/GafferUI/UIEditor.py +++ b/python/GafferUI/UIEditor.py @@ -132,13 +132,13 @@ def __init__( self, scriptNode, **kw ) : with GafferUI.SplitContainer( orientation=GafferUI.SplitContainer.Orientation.Horizontal, borderWidth = 8, parenting = { "label" : "Plugs" } ) as self.__plugTab : self.__plugListing = _PlugListing() - self.__plugListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__plugListingSelectionChanged ), scoped = False ) + self.__plugListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__plugListingSelectionChanged ) ) with GafferUI.TabbedContainer() as self.__plugAndSectionEditorsContainer : self.__plugEditor = _PlugEditor() self.__sectionEditor = _SectionEditor() - self.__sectionEditor.nameChangedSignal().connect( Gaffer.WeakMethod( self.__sectionEditorNameChanged ), scoped = False ) + self.__sectionEditor.nameChangedSignal().connect( Gaffer.WeakMethod( self.__sectionEditorNameChanged ) ) self.__plugAndSectionEditorsContainer.setTabsVisible( False ) @@ -384,7 +384,7 @@ def __plugPopupMenu( menuDefinition, plugValueWidget ) : } ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) ########################################################################## # Simple fixed width label and row classes @@ -612,17 +612,17 @@ def __init__( self, **kw ) : ) self.__deleteButton = GafferUI.Button( image = "minus.png", hasFrame = False ) - self.__deleteButton.clickedSignal().connect( Gaffer.WeakMethod( self.__deleteButtonClicked ), scoped = False ) + self.__deleteButton.clickedSignal().connect( Gaffer.WeakMethod( self.__deleteButtonClicked ) ) self.__parent = None # the parent of the plugs we're listing self.__dragItem = None self.__selectionChangedSignal = Gaffer.Signals.Signal1() - self.__pathListing.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.__pathListing.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.__pathListing.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) - self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ), scoped = False ) - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.__pathListing.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.__pathListing.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.__pathListing.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) + self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ) ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) def setPlugParent( self, parent ) : @@ -1094,25 +1094,25 @@ def __init__( self, **kw ) : self.__pathListing._qtWidget().setFixedWidth( 200 ) self.__pathListing._qtWidget().setFixedHeight( 200 ) - self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ), scoped = False ) - self.__pathListing.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - self.__pathListing.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ), scoped = False ) - self.__pathListing.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + self.__pathListing.selectionChangedSignal().connect( Gaffer.WeakMethod( self.__selectionChanged ) ) + self.__pathListing.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + self.__pathListing.dragMoveSignal().connect( Gaffer.WeakMethod( self.__dragMove ) ) + self.__pathListing.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) : self.__addButton = GafferUI.Button( image = "plus.png", hasFrame = False ) - self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addButtonClicked ), scoped = False ) + self.__addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addButtonClicked ) ) self.__deleteButton = GafferUI.Button( image = "minus.png", hasFrame = False ) - self.__deleteButton.clickedSignal().connect( Gaffer.WeakMethod( self.__deleteButtonClicked ), scoped = False ) + self.__deleteButton.clickedSignal().connect( Gaffer.WeakMethod( self.__deleteButtonClicked ) ) with GafferUI.ListContainer( spacing = 4 ) as self.__editingColumn : GafferUI.Label( "Name" ) self.__nameWidget = GafferUI.TextWidget() - self.__nameWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__nameEditingFinished ), scoped = False ) + self.__nameWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__nameEditingFinished ) ) GafferUI.Spacer( imath.V2i( 4 ), maximumSize = imath.V2i( 4 ) ) @@ -1122,7 +1122,7 @@ def __init__( self, **kw ) : # onto this node and then making a PlugValueWidget for it. self.__valueNode = Gaffer.Node( "PresetEditor" ) self.__valuePlugSetConnection = self.__valueNode.plugSetSignal().connect( - Gaffer.WeakMethod( self.__valuePlugSet ), scoped = False + Gaffer.WeakMethod( self.__valuePlugSet ) ) def setPlug( self, plug ) : @@ -1632,7 +1632,7 @@ def __init__( self, **kw ) : _Label( "Name" ) self.__nameWidget = GafferUI.TextWidget() - self.__nameWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__nameWidgetEditingFinished ), scoped = False ) + self.__nameWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__nameWidgetEditingFinished ) ) with _Row() : @@ -1764,7 +1764,7 @@ def __init__( self, target = None, **kw ) : self.__codeWidget.setHighlighter( GafferUI.CodeWidget.PythonHighlighter() ) self.__codeWidget.editingFinishedSignal().connect( - Gaffer.WeakMethod( self.__editingFinished ), scoped = False + Gaffer.WeakMethod( self.__editingFinished ) ) def setTarget( self, target ) : diff --git a/python/GafferUI/UserPlugs.py b/python/GafferUI/UserPlugs.py index 30de2a130fd..b3869824a26 100644 --- a/python/GafferUI/UserPlugs.py +++ b/python/GafferUI/UserPlugs.py @@ -121,11 +121,11 @@ def __init__( self, plugParent, **kw ) : self.__plugParent = plugParent Gaffer.Metadata.nodeValueChangedSignal().connect( - Gaffer.WeakMethod( self.__nodeMetadataChanged ), scoped = False + Gaffer.WeakMethod( self.__nodeMetadataChanged ) ) if isinstance( plugParent, Gaffer.Plug ) : Gaffer.Metadata.plugValueChangedSignal( plugParent.node() ).connect( - Gaffer.WeakMethod( self.__plugMetadataChanged ), scoped = False + Gaffer.WeakMethod( self.__plugMetadataChanged ) ) self.__updateReadOnly() diff --git a/python/GafferUI/VectorDataPlugValueWidget.py b/python/GafferUI/VectorDataPlugValueWidget.py index a546021baa3..753e577e00a 100644 --- a/python/GafferUI/VectorDataPlugValueWidget.py +++ b/python/GafferUI/VectorDataPlugValueWidget.py @@ -68,7 +68,7 @@ def __init__( self, plug, **kw ) : ] ) self.__dataWidget.setToolTips( [ Gaffer.Metadata.value( p, "description" ) or "" for p in dataPlugs ] ) - self.__dataWidget.dataChangedSignal().connect( Gaffer.WeakMethod( self.__dataChanged ), scoped = False ) + self.__dataWidget.dataChangedSignal().connect( Gaffer.WeakMethod( self.__dataChanged ) ) def vectorDataWidget( self ) : diff --git a/python/GafferUI/VectorDataWidget.py b/python/GafferUI/VectorDataWidget.py index d4a6978dc6b..31b340e6358 100644 --- a/python/GafferUI/VectorDataWidget.py +++ b/python/GafferUI/VectorDataWidget.py @@ -120,11 +120,11 @@ def __init__( self.__buttonRow = GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) addButton = GafferUI.Button( image="plus.png", hasFrame=False ) - addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addRows ), scoped = False ) + addButton.clickedSignal().connect( Gaffer.WeakMethod( self.__addRows ) ) self.__buttonRow.append( addButton ) removeButton = GafferUI.Button( image="minus.png", hasFrame=False ) - removeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__removeSelection ), scoped = False ) + removeButton.clickedSignal().connect( Gaffer.WeakMethod( self.__removeSelection ) ) self.__buttonRow.append( removeButton ) self.__buttonRow.append( GafferUI.Spacer( size = imath.V2i( 0 ), maximumSize = imath.V2i( 100000, 1 ) ), expand=1 ) @@ -132,32 +132,32 @@ def __init__( # stuff for drag enter/leave and drop - self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - addButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) - removeButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ), scoped = False ) + self.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + addButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) + removeButton.dragEnterSignal().connect( Gaffer.WeakMethod( self.__dragEnter ) ) - self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - addButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) - removeButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ), scoped = False ) + self.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + addButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) + removeButton.dragLeaveSignal().connect( Gaffer.WeakMethod( self.__dragLeave ) ) - self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) - addButton.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) - removeButton.dropSignal().connect( Gaffer.WeakMethod( self.__drop ), scoped = False ) + self.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) + addButton.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) + removeButton.dropSignal().connect( Gaffer.WeakMethod( self.__drop ) ) self.__dragPointer = "values" # stuff for drag begin self.__borrowedButtonPress = None self.__emittingButtonPress = False - self.__tableViewHolder.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ), scoped = False ) - self.__tableViewHolder.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ), scoped = False ) - self.__tableViewHolder.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ), scoped = False ) - self.__tableViewHolder.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ), scoped = False ) - self.__tableViewHolder.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ), scoped = False ) + self.__tableViewHolder.buttonPressSignal().connect( Gaffer.WeakMethod( self.__buttonPress ) ) + self.__tableViewHolder.buttonReleaseSignal().connect( Gaffer.WeakMethod( self.__buttonRelease ) ) + self.__tableViewHolder.mouseMoveSignal().connect( Gaffer.WeakMethod( self.__mouseMove ) ) + self.__tableViewHolder.dragBeginSignal().connect( Gaffer.WeakMethod( self.__dragBegin ) ) + self.__tableViewHolder.dragEndSignal().connect( Gaffer.WeakMethod( self.__dragEnd ) ) # key handling - self.__tableViewHolder.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.__tableViewHolder.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) # popup menu for data diff --git a/python/GafferUI/ViewUI.py b/python/GafferUI/ViewUI.py index dd6188e1ce1..4ebe8d5304c 100644 --- a/python/GafferUI/ViewUI.py +++ b/python/GafferUI/ViewUI.py @@ -260,7 +260,7 @@ def __init__( self, plug, **kw ) : with row : self.__button = GafferUI.Button( "", self.__imagePrefix + "Off.png", hasFrame=False ) - self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ), scoped = False ) + self.__button.clickedSignal().connect( Gaffer.WeakMethod( self.__clicked ) ) if not isinstance( plug, Gaffer.BoolPlug ) : plugValueWidget = GafferUI.PlugValueWidget.create( plug, typeMetadata = None ) diff --git a/python/GafferUI/Viewer.py b/python/GafferUI/Viewer.py index 1194a6c7e43..66cc5580a3c 100644 --- a/python/GafferUI/Viewer.py +++ b/python/GafferUI/Viewer.py @@ -111,7 +111,7 @@ def __init__( self, scriptNode, **kw ) : self.__toolChooser = _ToolChooser() self.__toolChooser.primaryToolChangedSignal().connect( - Gaffer.WeakMethod( self.__primaryToolChanged ), scoped = False + Gaffer.WeakMethod( self.__primaryToolChanged ) ) for toolbarContainer in [ self.__viewToolbars, self.__nodeToolbars, self.__toolToolbars ] : @@ -136,9 +136,9 @@ def __init__( self, scriptNode, **kw ) : self.__views = [] self.__currentView = None - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) - self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ), scoped = False ) - self.nodeSetChangedSignal().connect( Gaffer.WeakMethod( self.__updateViewportMessage ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) + self.contextMenuSignal().connect( Gaffer.WeakMethod( self.__contextMenu ) ) + self.nodeSetChangedSignal().connect( Gaffer.WeakMethod( self.__updateViewportMessage ) ) self._updateFromSet() @@ -355,7 +355,7 @@ def __init__( self, view ) : self.tools.sort( key = lambda v : Gaffer.Metadata.value( v, "order" ) if Gaffer.Metadata.value( v, "order" ) is not None else 999 ) for t in self.tools : - t.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__toolPlugDirtied, fallbackResult = lambda plug : None ), scoped = False ) + t.plugDirtiedSignal().connect( Gaffer.WeakMethod( self.__toolPlugDirtied, fallbackResult = lambda plug : None ) ) with GafferUI.ListContainer( spacing = 1 ) as self.widgets : diff --git a/python/GafferUI/Window.py b/python/GafferUI/Window.py index b0b0f6872c8..35ca1f905b7 100644 --- a/python/GafferUI/Window.py +++ b/python/GafferUI/Window.py @@ -74,7 +74,7 @@ def __init__( self, title="GafferUI.Window", borderWidth=0, resizeable=None, chi if len( self.__caughtKeys() ): # set up a key press handler, so we can catch various key presses and stop them being handled by the # host application - self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False ) + self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ) ) # \todo Does this hurt performance? Maybe keyPressSignal() should set this up when it's called? @@ -217,7 +217,7 @@ def remove( childWindow ) : assert( not childWindow.visible() ) GafferUI.WidgetAlgo.keepUntilIdle( childWindow ) - childWindow.closedSignal().connect( remove, scoped = False ) + childWindow.closedSignal().connect( remove ) ## Returns a list of all the windows parented to this one. def childWindows( self ) : diff --git a/python/GafferUI/_PlugAdder.py b/python/GafferUI/_PlugAdder.py index 0171b3d8327..68fd0b597b1 100644 --- a/python/GafferUI/_PlugAdder.py +++ b/python/GafferUI/_PlugAdder.py @@ -61,7 +61,7 @@ def choosePlug( plug ) : return chosenPlugs[0] if chosenPlugs else None -GafferUI.PlugAdder.plugMenuSignal().connect( __plugMenu, scoped = False ) +GafferUI.PlugAdder.plugMenuSignal().connect( __plugMenu ) def __menu( title, names ) : @@ -93,4 +93,4 @@ def chooseName( name ) : return chosenNames[0] if chosenNames else "" -GafferUI.PlugAdder.menuSignal().connect( __menu, scoped = False ) +GafferUI.PlugAdder.menuSignal().connect( __menu ) diff --git a/python/GafferUI/_Pointer.py b/python/GafferUI/_Pointer.py index 58b89d4af9d..f0e6d6e748d 100644 --- a/python/GafferUI/_Pointer.py +++ b/python/GafferUI/_Pointer.py @@ -63,4 +63,4 @@ def __pointerChanged() : application.setOverrideCursor( cursor ) __cursorOverridden = True -GafferUI.Pointer.changedSignal().connect( __pointerChanged, scoped = False ) +GafferUI.Pointer.changedSignal().connect( __pointerChanged ) diff --git a/python/GafferUITest/AnnotationsGadgetTest.py b/python/GafferUITest/AnnotationsGadgetTest.py index ff668774d17..be3f8744bd7 100644 --- a/python/GafferUITest/AnnotationsGadgetTest.py +++ b/python/GafferUITest/AnnotationsGadgetTest.py @@ -144,7 +144,7 @@ def testComputedText( self ) : def error( *unused ) : with errorCondition : errorCondition.notify() - script["errorNode"].errorSignal().connect( error, scoped = False ) + script["errorNode"].errorSignal().connect( error ) with GafferTest.ParallelAlgoTest.UIThreadCallHandler() as callHandler : diff --git a/python/GafferUITest/BoolWidgetTest.py b/python/GafferUITest/BoolWidgetTest.py index 916960d7d09..07d83807638 100644 --- a/python/GafferUITest/BoolWidgetTest.py +++ b/python/GafferUITest/BoolWidgetTest.py @@ -60,7 +60,7 @@ def f( w ) : self.emissions += 1 w = GafferUI.BoolWidget() - w.stateChangedSignal().connect( f, scoped = False ) + w.stateChangedSignal().connect( f ) w.setState( True ) self.assertEqual( w.getState(), True ) diff --git a/python/GafferUITest/CollapsibleTest.py b/python/GafferUITest/CollapsibleTest.py index 0b80ec2f690..c6ddffea365 100644 --- a/python/GafferUITest/CollapsibleTest.py +++ b/python/GafferUITest/CollapsibleTest.py @@ -66,7 +66,7 @@ def stateChanged( widget ) : self.__states.append( widget.getCollapsed( ) ) c = GafferUI.Collapsible( collapsed=True ) - c.stateChangedSignal().connect( stateChanged, scoped = False ) + c.stateChangedSignal().connect( stateChanged ) c.setCollapsed( False ) self.assertEqual( self.__states, [ False ] ) diff --git a/python/GafferUITest/ContextTrackerTest.py b/python/GafferUITest/ContextTrackerTest.py index 6603c0a135a..bd369bc03dd 100644 --- a/python/GafferUITest/ContextTrackerTest.py +++ b/python/GafferUITest/ContextTrackerTest.py @@ -851,7 +851,7 @@ def slot( tracker ) : raise RuntimeError( "Bad callback" ) for i in range( 0, 10 ) : - tracker.changedSignal().connect( slot, scoped = False ) + tracker.changedSignal().connect( slot ) with IECore.CapturingMessageHandler() as mh : with self.UpdateHandler() : diff --git a/python/GafferUITest/EventSignalCombinerTest.py b/python/GafferUITest/EventSignalCombinerTest.py index de93a2f89f3..44cc057b5dc 100644 --- a/python/GafferUITest/EventSignalCombinerTest.py +++ b/python/GafferUITest/EventSignalCombinerTest.py @@ -70,8 +70,8 @@ def setUp( self ) : def testShortCutting( self ) : s = GafferUI.Gadget.ButtonSignal() - s.connect( self.trueSlot, scoped = False ) - s.connect( self.falseSlot, scoped = False ) + s.connect( self.trueSlot ) + s.connect( self.falseSlot ) self.assertEqual( self.trueSlotCalled, False ) self.assertEqual( self.falseSlotCalled, False ) @@ -84,8 +84,8 @@ def testShortCutting( self ) : def testNoShortCutting( self ) : s = GafferUI.Gadget.ButtonSignal() - s.connect( self.falseSlot, scoped = False ) - s.connect( self.trueSlot, scoped = False ) + s.connect( self.falseSlot ) + s.connect( self.trueSlot ) self.assertEqual( self.trueSlotCalled, False ) self.assertEqual( self.falseSlotCalled, False ) @@ -102,8 +102,8 @@ def testExceptionHandling( self ) : # those slots to be printed as warnings. s = GafferUI.Gadget.ButtonSignal() - s.connect( self.exceptionSlot, scoped = False ) - s.connect( self.trueSlot, scoped = False ) + s.connect( self.exceptionSlot ) + s.connect( self.trueSlot ) self.assertEqual( self.exceptionSlotCalled, False ) self.assertEqual( self.trueSlotCalled, False ) diff --git a/python/GafferUITest/GadgetTest.py b/python/GafferUITest/GadgetTest.py index 073f0f9e2cc..048c9e4f21d 100644 --- a/python/GafferUITest/GadgetTest.py +++ b/python/GafferUITest/GadgetTest.py @@ -300,10 +300,10 @@ def visibilityChanged( gadget ) : events.append( ( gadget, gadget.visible() ) ) - g.visibilityChangedSignal().connect( visibilityChanged, scoped = False ) - g["a"].visibilityChangedSignal().connect( visibilityChanged, scoped = False ) - g["a"]["c"].visibilityChangedSignal().connect( visibilityChanged, scoped = False ) - g["b"].visibilityChangedSignal().connect( visibilityChanged, scoped = False ) + g.visibilityChangedSignal().connect( visibilityChanged ) + g["a"].visibilityChangedSignal().connect( visibilityChanged ) + g["a"]["c"].visibilityChangedSignal().connect( visibilityChanged ) + g["b"].visibilityChangedSignal().connect( visibilityChanged ) g["b"].setVisible( True ) self.assertEqual( len( events ), 0 ) diff --git a/python/GafferUITest/GraphEditorTest.py b/python/GafferUITest/GraphEditorTest.py index 65cf7d6513f..4e82f9db3a1 100644 --- a/python/GafferUITest/GraphEditorTest.py +++ b/python/GafferUITest/GraphEditorTest.py @@ -102,7 +102,7 @@ def testTitle( self ) : def titleChangedHandler( widget ) : self.__signalUpdatedTitle = widget.getTitle() - g.titleChangedSignal().connect( titleChangedHandler, scoped = False ) + g.titleChangedSignal().connect( titleChangedHandler ) g.graphGadget().setRoot( b1 ) self.assertEqual( self.__signalUpdatedTitle, "Graph Editor : a" ) diff --git a/python/GafferUITest/GraphGadgetTest.py b/python/GafferUITest/GraphGadgetTest.py index 7c6cc7512ee..af8468b4d46 100644 --- a/python/GafferUITest/GraphGadgetTest.py +++ b/python/GafferUITest/GraphGadgetTest.py @@ -571,7 +571,7 @@ def f( gg, previousRoot ) : previousRoots.append( previousRoot ) g = GafferUI.GraphGadget( s ) - g.rootChangedSignal().connect( f, scoped = False ) + g.rootChangedSignal().connect( f ) self.assertEqual( len( roots ), 0 ) self.assertEqual( len( previousRoots ), 0 ) diff --git a/python/GafferUITest/NodeSetEditorTest.py b/python/GafferUITest/NodeSetEditorTest.py index 8c5ce0c27b7..d76656f0c69 100644 --- a/python/GafferUITest/NodeSetEditorTest.py +++ b/python/GafferUITest/NodeSetEditorTest.py @@ -87,8 +87,8 @@ def nodeSetChangedCallback( editor ) : else : signalData['ne2nodeSetMirror'] = d - ne1.nodeSetChangedSignal().connect( nodeSetChangedCallback, scoped = False ) - ne2.nodeSetChangedSignal().connect( nodeSetChangedCallback, scoped = False ) + ne1.nodeSetChangedSignal().connect( nodeSetChangedCallback ) + ne2.nodeSetChangedSignal().connect( nodeSetChangedCallback ) ne1.setNodeSet( n1 ) ne2.setNodeSet( n2 ) diff --git a/python/GafferUITest/ScriptWindowTest.py b/python/GafferUITest/ScriptWindowTest.py index 64df292793f..eac295f0fc2 100644 --- a/python/GafferUITest/ScriptWindowTest.py +++ b/python/GafferUITest/ScriptWindowTest.py @@ -100,7 +100,7 @@ def testTitleChangedSignal( self ) : def grabTitle( window, newTitle ) : self.__title = newTitle - w.titleChangedSignal().connect( grabTitle, scoped = False ) + w.titleChangedSignal().connect( grabTitle ) w.setTitle( "b" ) self.assertEqual( self.__title, "b" ) diff --git a/python/GafferUITest/SelectionMenuTest.py b/python/GafferUITest/SelectionMenuTest.py index be5a9eec8ae..db907cab1eb 100644 --- a/python/GafferUITest/SelectionMenuTest.py +++ b/python/GafferUITest/SelectionMenuTest.py @@ -99,7 +99,7 @@ def testCurrentIndexChangedSignal( self ): def f( w ) : self.emissions += 1 - s.currentIndexChangedSignal().connect( f, scoped = False ) + s.currentIndexChangedSignal().connect( f ) s.addItem("Test1") s.addItem("Test2") diff --git a/python/GafferUITest/TextWidgetTest.py b/python/GafferUITest/TextWidgetTest.py index 8305f12135b..4c4ce8e25a4 100644 --- a/python/GafferUITest/TextWidgetTest.py +++ b/python/GafferUITest/TextWidgetTest.py @@ -62,7 +62,7 @@ def f( w ) : self.emissions += 1 w = GafferUI.TextWidget() - w.textChangedSignal().connect( f, scoped = False ) + w.textChangedSignal().connect( f ) w.setText( "hello" ) self.assertEqual( w.getText(), "hello" ) diff --git a/python/GafferUITest/WidgetSignalTest.py b/python/GafferUITest/WidgetSignalTest.py index 0900aa6d4cc..e1ff6f65cef 100644 --- a/python/GafferUITest/WidgetSignalTest.py +++ b/python/GafferUITest/WidgetSignalTest.py @@ -59,7 +59,7 @@ def f( ww ) : self.__widget = ww return True - s.connect( f, scoped = False ) + s.connect( f ) self.assertEqual( s( w ), True ) self.assertTrue( self.__widget is w ) diff --git a/python/GafferUITest/WidgetTest.py b/python/GafferUITest/WidgetTest.py index 71700d3d5af..d98b9583c4e 100644 --- a/python/GafferUITest/WidgetTest.py +++ b/python/GafferUITest/WidgetTest.py @@ -179,7 +179,7 @@ def f( w, event ) : WidgetTest.signalsEmitted += 1 - w.buttonPressSignal().connect( f, scoped = False ) + w.buttonPressSignal().connect( f ) WidgetTest.signalsEmitted = 0 @@ -615,7 +615,7 @@ def f( w, event ) : self.assertEqual( event.line.p1.x - int( event.line.p1.x ), 0.5 ) self.assertEqual( event.line.p1.y - int( event.line.p1.y ), 0.5 ) - w.buttonPressSignal().connect( f, scoped = False ) + w.buttonPressSignal().connect( f ) event = QtGui.QMouseEvent( QtCore.QEvent.MouseButtonPress, QtCore.QPoint( 10, 10 ), QtCore.Qt.LeftButton, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier ) diff --git a/python/GafferUITest/WindowTest.py b/python/GafferUITest/WindowTest.py index aac7ce9d96e..480bf96dbd8 100644 --- a/python/GafferUITest/WindowTest.py +++ b/python/GafferUITest/WindowTest.py @@ -184,7 +184,7 @@ def closeFn( w ) : w.setVisible( True ) self.assertEqual( w.getVisible(), True ) - w.closedSignal().connect( closeFn, scoped = False ) + w.closedSignal().connect( closeFn ) self.assertEqual( w.close(), True ) self.assertEqual( w.getVisible(), False ) @@ -201,7 +201,7 @@ def closeFn( w ) : w.setVisible( True ) self.assertEqual( w.getVisible(), True ) - w.closedSignal().connect( closeFn, scoped = False ) + w.closedSignal().connect( closeFn ) # simulate user clicking on the x w._qtWidget().close() @@ -230,7 +230,7 @@ def _acceptsClose( self ) : w.setVisible( True ) self.assertEqual( w.getVisible(), True ) - w.closedSignal().connect( closeFn, scoped = False ) + w.closedSignal().connect( closeFn ) self.assertEqual( w.close(), False ) self.assertEqual( w.getVisible(), True ) @@ -471,7 +471,7 @@ def preCloseSlot( w ) : nonlocal preCloseSlotResult return preCloseSlotResult - window.preCloseSignal().connect( preCloseSlot, scoped = False ) + window.preCloseSignal().connect( preCloseSlot ) preCloseCapturingSlot = GafferTest.CapturingSlot( window.preCloseSignal() ) closedSlot = GafferTest.CapturingSlot( window.closedSignal() ) diff --git a/startup/GafferImage/createViewsCompatibility.py b/startup/GafferImage/createViewsCompatibility.py index 8fc6afd1715..2cb8d9ab281 100644 --- a/startup/GafferImage/createViewsCompatibility.py +++ b/startup/GafferImage/createViewsCompatibility.py @@ -53,9 +53,7 @@ def __initWrapper( originalInit ) : def init( self, *args, **kw ) : originalInit( self, *args, **kw ) - self["views"].childAddedSignal().connect( - __viewsChildAdded, scoped = False - ) + self["views"].childAddedSignal().connect( __viewsChildAdded ) return init diff --git a/startup/gui/editor.py b/startup/gui/editor.py index 18985a161b4..4a62c090467 100644 --- a/startup/gui/editor.py +++ b/startup/gui/editor.py @@ -43,5 +43,5 @@ def __editorCreated( editor ) : GafferUI.GraphBookmarksUI.connectToEditor( editor ) GafferSceneUI.SceneHistoryUI.connectToEditor( editor ) -GafferUI.Editor.instanceCreatedSignal().connect( __editorCreated, scoped = False ) -GafferUI.CompoundEditor.nodeSetMenuSignal().connect( GafferUI.GraphBookmarksUI.appendNodeSetMenuDefinitions, scoped = False ) +GafferUI.Editor.instanceCreatedSignal().connect( __editorCreated ) +GafferUI.CompoundEditor.nodeSetMenuSignal().connect( GafferUI.GraphBookmarksUI.appendNodeSetMenuDefinitions ) diff --git a/startup/gui/graphEditor.py b/startup/gui/graphEditor.py index c7b870fd65e..18716a17c0b 100644 --- a/startup/gui/graphEditor.py +++ b/startup/gui/graphEditor.py @@ -95,7 +95,7 @@ def __nodeDoubleClick( graphEditor, node ) : GafferUI.NodeEditor.acquire( node, floating = True ) return True -GafferUI.GraphEditor.nodeDoubleClickSignal().connect( __nodeDoubleClick, scoped = False ) +GafferUI.GraphEditor.nodeDoubleClickSignal().connect( __nodeDoubleClick ) def __nodeContextMenu( graphEditor, node, menuDefinition ) : @@ -110,20 +110,20 @@ def __nodeContextMenu( graphEditor, node, menuDefinition ) : GafferSceneUI.CryptomatteUI.appendNodeContextMenuDefinitions( graphEditor, node, menuDefinition ) GafferUI.GraphBookmarksUI.appendNodeContextMenuDefinitions( graphEditor, node, menuDefinition ) -GafferUI.GraphEditor.nodeContextMenuSignal().connect( __nodeContextMenu, scoped = False ) +GafferUI.GraphEditor.nodeContextMenuSignal().connect( __nodeContextMenu ) def __plugContextMenu( graphEditor, plug, menuDefinition ) : GafferUI.GraphBookmarksUI.appendPlugContextMenuDefinitions( graphEditor, plug, menuDefinition ) GafferUI.NodeUI.appendPlugDeletionMenuDefinitions( plug, menuDefinition ) -GafferUI.GraphEditor.plugContextMenuSignal().connect( __plugContextMenu, scoped = False ) +GafferUI.GraphEditor.plugContextMenuSignal().connect( __plugContextMenu ) def __connectionContextMenu( graphEditor, destinationPlug, menuDefinition ) : GafferUI.GraphEditor.appendConnectionNavigationMenuDefinitions( graphEditor, destinationPlug, menuDefinition ) -GafferUI.GraphEditor.connectionContextMenuSignal().connect( __connectionContextMenu, scoped = False ) +GafferUI.GraphEditor.connectionContextMenuSignal().connect( __connectionContextMenu ) ########################################################################## # File drop handler @@ -315,11 +315,11 @@ def __locationDrop( graphGadget, event, graphEditor ) : def __graphEditorCreated( graphEditor ) : - graphEditor.graphGadget().dragEnterSignal().connect( __fileDragEnter, scoped = False ) - graphEditor.graphGadget().dropSignal().connect( __fileDrop, scoped = False ) + graphEditor.graphGadget().dragEnterSignal().connect( __fileDragEnter ) + graphEditor.graphGadget().dropSignal().connect( __fileDrop ) - graphEditor.graphGadget().dragEnterSignal().connect( __locationDragEnter, scoped = False ) - graphEditor.graphGadget().dragLeaveSignal().connect( __locationDragLeave, scoped = False ) - graphEditor.graphGadget().dropSignal().connect( functools.partial( __locationDrop, graphEditor = weakref.ref( graphEditor ) ), scoped = False ) + graphEditor.graphGadget().dragEnterSignal().connect( __locationDragEnter ) + graphEditor.graphGadget().dragLeaveSignal().connect( __locationDragLeave ) + graphEditor.graphGadget().dropSignal().connect( functools.partial( __locationDrop, graphEditor = weakref.ref( graphEditor ) ) ) -GafferUI.GraphEditor.instanceCreatedSignal().connect( __graphEditorCreated, scoped = False ) +GafferUI.GraphEditor.instanceCreatedSignal().connect( __graphEditorCreated ) diff --git a/startup/gui/localDispatcher.py b/startup/gui/localDispatcher.py index f5f0a061b6c..b1cca47cabb 100644 --- a/startup/gui/localDispatcher.py +++ b/startup/gui/localDispatcher.py @@ -82,6 +82,6 @@ def __scriptAdded( container, script ) : if window is None : return - window.preCloseSignal().connect( __scriptWindowPreClose, scoped = False ) + window.preCloseSignal().connect( __scriptWindowPreClose ) -application.root()["scripts"].childAddedSignal().connect( __scriptAdded, scoped = False ) +application.root()["scripts"].childAddedSignal().connect( __scriptAdded ) diff --git a/startup/gui/nodeEditor.py b/startup/gui/nodeEditor.py index d1ffa8756ab..6ab97091908 100644 --- a/startup/gui/nodeEditor.py +++ b/startup/gui/nodeEditor.py @@ -44,10 +44,10 @@ def __toolMenu( nodeEditor, node, menuDefinition ) : GafferSceneUI.FilteredSceneProcessorUI.appendNodeEditorToolMenuDefinitions( nodeEditor, node, menuDefinition ) GafferSceneUI.CryptomatteUI.appendNodeEditorToolMenuDefinitions( nodeEditor, node, menuDefinition ) -GafferUI.NodeEditor.toolMenuSignal().connect( __toolMenu, scoped = False ) +GafferUI.NodeEditor.toolMenuSignal().connect( __toolMenu ) def __plugPopupMenu( menuDefinition, plugValueWidget ) : GafferUI.NodeUI.appendPlugDeletionMenuDefinitions( plugValueWidget, menuDefinition ) -GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu, scoped = False ) +GafferUI.PlugValueWidget.popupMenuSignal().connect( __plugPopupMenu ) diff --git a/startup/gui/ocio.py b/startup/gui/ocio.py index 37232b9d52b..53beb43655a 100644 --- a/startup/gui/ocio.py +++ b/startup/gui/ocio.py @@ -49,7 +49,7 @@ def __scriptAdded( container, script ) : GafferImageUI.OpenColorIOConfigPlugUI.connect( script ) -application.root()["scripts"].childAddedSignal().connect( __scriptAdded, scoped = False ) +application.root()["scripts"].childAddedSignal().connect( __scriptAdded ) Gaffer.Metadata.registerValue( GafferUI.View, "displayTransform.name", "plugValueWidget:type", "GafferImageUI.OpenColorIOConfigPlugUI.DisplayTransformPlugValueWidget" ) Gaffer.Metadata.registerValue( GafferUI.View, "displayTransform.name", "layout:minimumWidth", 150 ) diff --git a/startup/gui/outputs.py b/startup/gui/outputs.py index 9f10e6ee823..c6c4ae40506 100644 --- a/startup/gui/outputs.py +++ b/startup/gui/outputs.py @@ -455,7 +455,7 @@ def __scriptAdded( parent, script ) : portNumberPlug["value"].setValue( GafferImage.Catalogue.displayDriverServer().portNumber() ) -application.root()["scripts"].childAddedSignal().connect( __scriptAdded, scoped = False ) +application.root()["scripts"].childAddedSignal().connect( __scriptAdded ) Gaffer.Metadata.registerValue( Gaffer.ScriptNode, "variables.imageCataloguePort", "plugValueWidget:type", "" ) diff --git a/startup/gui/performanceMonitor.py b/startup/gui/performanceMonitor.py index 8627abe8f79..f4cccfb1cc3 100644 --- a/startup/gui/performanceMonitor.py +++ b/startup/gui/performanceMonitor.py @@ -253,4 +253,4 @@ def __graphEditorCreated( graphEditor ) : annotationsGadget.setVisibleAnnotations( " ".join( visibleAnnotations ) ) -GafferUI.GraphEditor.instanceCreatedSignal().connect( __graphEditorCreated, scoped = False ) +GafferUI.GraphEditor.instanceCreatedSignal().connect( __graphEditorCreated ) diff --git a/startup/gui/project.py b/startup/gui/project.py index 74d614b540e..da3f6e00987 100644 --- a/startup/gui/project.py +++ b/startup/gui/project.py @@ -67,7 +67,7 @@ def __scriptAdded( container, script ) : GafferImage.FormatPlug.acquireDefaultFormatPlug( script ) -application.root()["scripts"].childAddedSignal().connect( __scriptAdded, scoped = False ) +application.root()["scripts"].childAddedSignal().connect( __scriptAdded ) ########################################################################## # Bookmarks diff --git a/startup/gui/pythonEditor.py b/startup/gui/pythonEditor.py index 163bad83e53..6f08584adb4 100644 --- a/startup/gui/pythonEditor.py +++ b/startup/gui/pythonEditor.py @@ -46,4 +46,4 @@ def __pythonEditorCreated( editor ) : if "." not in name and ( name.startswith( "Gaffer" ) or name.startswith( "IECore" ) ) : editor.namespace()[name] = module -GafferUI.PythonEditor.instanceCreatedSignal().connect( __pythonEditorCreated, scoped = False ) +GafferUI.PythonEditor.instanceCreatedSignal().connect( __pythonEditorCreated ) diff --git a/startup/gui/viewer.py b/startup/gui/viewer.py index d8b2e36521d..46581a18600 100644 --- a/startup/gui/viewer.py +++ b/startup/gui/viewer.py @@ -77,7 +77,7 @@ def __viewContextMenu( viewer, view, menuDefinition ) : GafferSceneUI.LightUI.appendViewContextMenuItems( viewer, view, menuDefinition ) GafferSceneUI.SceneHistoryUI.appendViewContextMenuItems( viewer, view, menuDefinition ) -GafferUI.Viewer.viewContextMenuSignal().connect( __viewContextMenu, scoped = False ) +GafferUI.Viewer.viewContextMenuSignal().connect( __viewContextMenu ) # register shading modes @@ -261,6 +261,6 @@ def __loadRendererSettings( fileName ) : ) # Add catalogue hotkeys to viewers, eg: up/down navigation -GafferUI.Editor.instanceCreatedSignal().connect( GafferImageUI.CatalogueUI.addCatalogueHotkeys, scoped = False ) -GafferUI.Editor.instanceCreatedSignal().connect( GafferSceneUI.EditScopeUI.addPruningActions, scoped = False ) -GafferUI.Editor.instanceCreatedSignal().connect( GafferSceneUI.EditScopeUI.addVisibilityActions, scoped = False ) +GafferUI.Editor.instanceCreatedSignal().connect( GafferImageUI.CatalogueUI.addCatalogueHotkeys ) +GafferUI.Editor.instanceCreatedSignal().connect( GafferSceneUI.EditScopeUI.addPruningActions ) +GafferUI.Editor.instanceCreatedSignal().connect( GafferSceneUI.EditScopeUI.addVisibilityActions )