Ejemplo n.º 1
0
 def late_init(self, early_ns):
     """
     Initialize with early command line arguments being already parsed
     """
     adjust_logging(
         level=early_ns.log_level, trace_list=early_ns.trace,
         debug_console=early_ns.debug_console)
     # Load plainbox configuration
     self._config = self.get_config_cls().get()
     # Load and initialize checkbox provider
     # TODO: rename to provider, switch to plugins
     all_providers.load()
     # If the default value of 'None' was set for the checkbox (provider)
     # argument then load the actual provider name from the configuration
     # object (default for that is 'auto').
     if early_ns.checkbox is None:
         early_ns.checkbox = self._config.default_provider
     assert early_ns.checkbox in ('auto', 'src', 'deb', 'stub', 'ihv')
     if early_ns.checkbox == 'auto':
         provider_name = 'checkbox-auto'
     elif early_ns.checkbox == 'src':
         provider_name = 'checkbox-src'
     elif early_ns.checkbox == 'deb':
         provider_name = 'checkbox-deb'
     elif early_ns.checkbox == 'stub':
         provider_name = 'stubbox'
     elif early_ns.checkbox == 'ihv':
         provider_name = 'ihv'
     self._provider = all_providers.get_by_name(
         provider_name).plugin_object()
     # Construct the full command line argument parser
     self._parser = self.construct_parser()
Ejemplo n.º 2
0
 def late_init(self, early_ns):
     """
     Initialize with early command line arguments being already parsed
     """
     adjust_logging(level=early_ns.log_level,
                    trace_list=early_ns.trace,
                    debug_console=early_ns.debug_console)
Ejemplo n.º 3
0
 def late_init(self, early_ns):
     """
     Initialize with early command line arguments being already parsed
     """
     adjust_logging(
         level=early_ns.log_level, trace_list=early_ns.trace,
         debug_console=early_ns.debug_console)
Ejemplo n.º 4
0
 def _setup_logging_from_environment(self):
     if not os.getenv("PLAINBOX_DEBUG", ""):
         return
     adjust_logging(level=os.getenv("PLAINBOX_LOG_LEVEL", "DEBUG"),
                    trace_list=os.getenv("PLAINBOX_TRACE", "").split(","),
                    debug_console=os.getenv("PLAINBOX_DEBUG",
                                            "") == "console")
     logger.debug(_("Activated early logging via environment variables"))