def _pluginSetup(self, plugin):
        """get romeo configuration bound in order to update the instance

           This gets called by the factory below.

           Note: ROMEO configuration always overrides the ApplicationPlugin's
             default constructor!!!!
        """
        plugin.log('applying configuration from romeo')
        tmp = getattr(plugin, 'INSTANCES', 1) #allow constructor to set this up 
        plugin.INSTANCES = plugin.configuration.get('INSTANCES', tmp)
        #get the real settings from configuration
        plugin.STARTUP_INFO.update(plugin.configuration.get('STARTUP_INFO',{}))
        plugin.STARTUP_INFO['START_ARGS'] = tuple(plugin.STARTUP_INFO['START_ARGS'])
        plugin.SHUTDOWN_INFO.update(plugin.configuration.get('SHUTDOWN_INFO',{}))
        plugin.SHUTDOWN_INFO['STOP_ARGS'] = tuple(plugin.SHUTDOWN_INFO['STOP_ARGS'])
        #how long to wait before searching for a newly started process
        tmp = getattr(plugin, 'SEARCH_DELAY', 5.0) #allow constructor to set this up 
        plugin.SEARCH_DELAY = plugin.configuration.get('SEARCH_DELAY', tmp)
        #how long to wait on a command before timing out!!! Timeout implies failure!
        tmp = getattr(plugin, 'DEFAULT_TIMEOUT', 120) #allow constructor to set this up 
        plugin.DEFAULT_TIMEOUT = plugin.configuration.get('DEFAULT_TIMEOUT', tmp) #seconds
        #how to assimilate an application
        tmp = getattr(plugin, 'ASSIMILATION_PATTERN', None) #allow constructor to set this up 
        plugin.ASSIMILATION_PATTERN = plugin.configuration.get('ASSIMILATION_PATTERN', tmp)
        #prepare the process regular expression
        plugin.PROCESS_REGEX = None
        if plugin.ASSIMILATION_PATTERN:
            plugin.PROCESS_REGEX = re.compile(plugin.ASSIMILATION_PATTERN, re.I)
        #if you don't like the default behavior of addInstance override it
        for i in range(plugin.INSTANCES):
            try: plugin.getInstance(i)
            except __HOLE__:
                plugin.addInstance(i)
        tmp = getattr(plugin, 'AUTO_RECOVER', False) #allow constructor to set this up 
        #configure automatic restart after crash
        if plugin.configuration.get('AUTO_RECOVER', tmp):
            Event('instance-crashed').subscribe(plugin.recoverInstance)
        #allow romeo to hint that droned manages the daemonization of this app.
        if plugin.configuration.get('MANAGED', False):
            plugin.startProtoKwargs.update({'daemonize': True})
        plugin.log('plugin is configured and ready to be used')
dataset/ETHPy150Open OrbitzWorldwide/droned/droned/lib/droned/applications/__init__.py/_PluginFactory._pluginSetup