Example #1
0
    def _read_config(self,
                     options,
                     create=False,
                     register_station=True,
                     check_schema=True,
                     load_plugins=True):
        from stoqlib.lib.configparser import StoqConfig
        from stoq.lib.startup import setup
        config = StoqConfig()
        if options.load_config and options.filename:
            config.load(options.filename)
        else:
            config.load_default()
        if create:
            config.create()

        # FIXME: This should be removed and we should just import
        #        the global settings after fixing StoqConfig to
        #        only update the global settings.
        self._db_settings = config.get_settings()
        setup(config,
              options,
              register_station=register_station,
              check_schema=check_schema,
              load_plugins=load_plugins)
        return config
Example #2
0
    def _read_config(self, options, create=False, register_station=True, check_schema=True, load_plugins=True):
        from stoqlib.lib.configparser import StoqConfig
        from stoq.lib.startup import setup

        config = StoqConfig()
        if options.load_config and options.filename:
            config.load(options.filename)
        else:
            config.load_default()
        if create:
            config.create()

        # FIXME: This should be removed and we should just import
        #        the global settings after fixing StoqConfig to
        #        only update the global settings.
        self._db_settings = config.get_settings()
        setup(config, options, register_station=register_station, check_schema=check_schema, load_plugins=load_plugins)
        return config