def load_config(config_file): """Loads the config file. The loaded config will be available via infogami.config. """ infogami.load_config(config_file) setup_infobase_config(config_file) # This sets web.config.db_parameters server.update_config(config.infobase)
def load_config(config_file): """Loads the config file. The loaded config will be available via infogami.config. """ if 'pytest' in sys.modules: # During pytest ensure we're not using like olsystem or something assert config_file == 'conf/openlibrary.yml' infogami.load_config(config_file) setup_infobase_config(config_file) # This sets web.config.db_parameters server.update_config(config.infobase)
def load_infogami(config_file): import web import infogami from infogami import config from infogami.utils import delegate config.plugin_path += ['openlibrary.plugins'] config.site = "openlibrary.org" infogami.load_config(config_file) setup_infobase_config(config_file) infogami._setup() delegate.fakeload()
def setup_ol_config(openlibrary_config_file): """Setup OL configuration. Required for storing counts in store. """ import infogami from infogami import config config.plugin_path += ['openlibrary.plugins'] config.site = "openlibrary.org" infogami.load_config(openlibrary_config_file) infogami.config.infobase_parameters = dict(type="ol") if config.get("infobase_config_file"): dir = os.path.dirname(openlibrary_config_file) path = os.path.join(dir, config.infobase_config_file) config.infobase = yaml.safe_load(open(path).read()) infogami._setup()
def setup_ol_config(openlibrary_config_file): """Setup OL configuration. Required for storing counts in store. """ import infogami from infogami import config from infogami.utils import delegate config.plugin_path += ['openlibrary.plugins'] config.site = "openlibrary.org" infogami.load_config(openlibrary_config_file) infogami.config.infobase_parameters = dict(type="ol") if config.get("infobase_config_file"): dir = os.path.dirname(openlibrary_config_file) path = os.path.join(dir, config.infobase_config_file) config.infobase = yaml.safe_load(open(path).read()) infogami._setup()