parameters: (self)
docstring: Call widget setup methods and connect signals and slots from plugins.
docstring_summary: Call widget setup methods and connect signals and slots from plugins.
docstring_tokens: Call widget setup methods and connect signals and slots from plugins .
function: def setup(self):
          """
          Call widget setup methods and connect signals and slots from plugins.
          """
          super(PluginManager, self).setup()
  
          # Create the plugins
          for plugin_class in self._plugin_classes:
  
              # Create the widget instance
              widget = plugin_class()
  
              # Check the type
              if not isinstance(widget, self._plugin_base):
                  mooseutils.MooseException("The supplied widget is of type '{}' but must be a direct child of a '{}'".format(widget.__class__.__name__, self._plugin_base.__name__))
  
              # Define the widget name
              name = widget.__class__.__name__
  
              # Store widget in a list if more than one exist
              if name in self._plugins:
                  if not isinstance(self._plugins[name], list):
                      self._plugins[name] = [self._plugins[name]]
                  self._plugins[name].append(widget)
  
              # Store widget directly if only one
              else:
                  self._plugins[name] = widget
  
              # Set the parent
              widget.setParent(self)
  
              # Add the widget
              self.addObject(widget)
  
              # Set the class attribute base on plugin name
              setattr(self, name, self._plugins[name])
              mooseutils.mooseDebug('Adding plugin as member: {}'.format(name))
  
              # Store in the temporary flat list
              self._all_plugins.append(widget)
  
          # Connect signal/slots of plugins
          for plugin0 in self._all_plugins:
              plugin0._plugin_manager = self
              for plugin1 in self._all_plugins:
                  plugin0.connect(plugin1)
function_tokens: def setup ( self ) : super ( PluginManager , self ) . setup ( ) # Create the plugins for plugin_class in self . _plugin_classes : # Create the widget instance widget = plugin_class ( ) # Check the type if not isinstance ( widget , self . _plugin_base ) : mooseutils . MooseException ( "The supplied widget is of type '{}' but must be a direct child of a '{}'" . format ( widget . __class__ . __name__ , self . _plugin_base . __name__ ) ) # Define the widget name name = widget . __class__ . __name__ # Store widget in a list if more than one exist if name in self . _plugins : if not isinstance ( self . _plugins [ name ] , list ) : self . _plugins [ name ] = [ self . _plugins [ name ] ] self . _plugins [ name ] . append ( widget ) # Store widget directly if only one else : self . _plugins [ name ] = widget # Set the parent widget . setParent ( self ) # Add the widget self . addObject ( widget ) # Set the class attribute base on plugin name setattr ( self , name , self . _plugins [ name ] ) mooseutils . mooseDebug ( 'Adding plugin as member: {}' . format ( name ) ) # Store in the temporary flat list self . _all_plugins . append ( widget ) # Connect signal/slots of plugins for plugin0 in self . _all_plugins : plugin0 . _plugin_manager = self for plugin1 in self . _all_plugins : plugin0 . connect ( plugin1 )