tools/cr/cr/plugin.py
def GetInstance(cls):
    """Gets an instance of this plugin.

    This looks in the plugin registry, and if an instance is not found a new
    one is built and registered.

    Returns:
        The registered plugin instance.
    """
    plugin = _plugins.get(cls, None)
    if plugin is None:
      # Run delayed class initialization
      cls.ClassInit()
      # Build a new instance of cls, and register it as the main instance.
      plugin = cls()
      _plugins[cls] = plugin
      # Wire up the hierarchy for Config objects.
      for name, value in cls.__dict__.items():
        if isinstance(value, cr.Config):
          for base in cls.__bases__:
            child = getattr(base, name, None)
            if child is not None:
              value.AddChild(child)
      plugin.Init()
    return plugin
Gets an instance of this plugin.

    This looks in the plugin registry, and if an instance is not found a new
    one is built and registered.

    Returns:
        The registered plugin instance.
    
Gets an instance of this plugin.
This looks in the plugin registry, and if an instance is not found a new
one is built and registered.
Gets an instance of this plugin . This looks in the plugin registry and if an instance is not found a new one is built and registered .
def GetInstance(cls):
    plugin = _plugins.get(cls, None)
    if plugin is None:
      cls.ClassInit()
      plugin = cls()
      _plugins[cls] = plugin
      for name, value in cls.__dict__.items():
        if isinstance(value, cr.Config):
          for base in cls.__bases__:
            child = getattr(base, name, None)
            if child is not None:
              value.AddChild(child)
      plugin.Init()
    return plugin
def GetInstance ( cls ) : plugin = _plugins . get ( cls , None ) if plugin is None : cls . ClassInit ( ) plugin = cls ( ) _plugins [ cls ] = plugin for name , value in cls . __dict__ . items ( ) : if isinstance ( value , cr . Config ) : for base in cls . __bases__ : child = getattr ( base , name , None ) if child is not None : value . AddChild ( child ) plugin . Init ( ) return plugin
Gets an instance of this plugin.
Gets an instance of this plugin .
"""Gets an instance of this plugin.

    This looks in the plugin registry, and if an instance is not found a new
    one is built and registered.

    Returns:
        The registered plugin instance.
    """ # Run delayed class initialization # Build a new instance of cls, and register it as the main instance. # Wire up the hierarchy for Config objects.
The registered plugin instance.
The registered plugin instance .
cls