def demoLoadFromFile():
    """Demonstrate loading database connection config from config file.

    This method can be used to change default connection at runtime,
    but only before instantiating a DbObject.
    """
    config = BaseCatalogConfig()
    configFilename = os.path.join(getPackageDir("sims_catUtils"), "config", "db.py")
    config.load(configFilename)
    starDB = StarObj(**config.toDict())
Ejemplo n.º 2
0
def demoLoadFromFile():
    """Demonstrate loading database connection config from config file.

    This method can be used to change default connection at runtime,
    but only before instantiating a DbObject.
    """
    config = BaseCatalogConfig()
    configFilename = os.path.join(getPackageDir("sims_catUtils"), "config",
                                  "db.py")
    config.load(configFilename)
    starDB = StarObj(**config.toDict())