本文整理匯總了Python中hgu.Util.readConfiguration方法的典型用法代碼示例。如果您正苦於以下問題:Python Util.readConfiguration方法的具體用法?Python Util.readConfiguration怎麽用?Python Util.readConfiguration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hgu.Util
的用法示例。
在下文中一共展示了Util.readConfiguration方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __initialise
# 需要導入模塊: from hgu import Util [as 別名]
# 或者: from hgu.Util import readConfiguration [as 別名]
def __initialise(configFile, configParams):
"""
Initialise program. This includes establishing the database
connection, and setting debugging.
"""
Util.readConfiguration(configFile, config, printConfig = True)
if configParams["DEBUGGING"] == "ON":
Util.setDebugging(True)
else:
Util.setDebugging(False)
# Several of the parameters can be space separated lists.
# Convert these to python lists in configParams.
configParams["OUTPUT_FORMATS"] = configParams["OUTPUT_FORMATS"].split()
configParams["STAGE_FILES"] = configParams["STAGE_FILES"] .split()
if configParams["ABSTRACT_REPORTS"] == "NONE":
configParams["ABSTRACT_REPORTS"] = []
else:
configParams["ABSTRACT_REPORTS"] = configParams["ABSTRACT_REPORTS"].split()
if configParams["STAGE_REPORTS"] == "NONE":
configParams["STAGE_REPORTS"] = []
else:
configParams["STAGE_REPORTS"] = configParams["STAGE_REPORTS"].split()
if configParams["DEPTH_LIMIT"] == "NONE":
configParams["DEPTH_LIMIT"] = sys.maxint
else:
configParams["DEPTH_LIMIT"] = int(configParams["DEPTH_LIMIT"])
# process the PROJECT flag
if configParams["PROJECT"] not in ["EMAP", "GUDMAP"]:
Util.fatalError(["Unrecognised PROJECT parameter: " + configParams["PROJECT"]])
# Initialise Database and read the whole thing in.
Util.statusMessage(["Reading in anatomy database."])
Anatomy.initialise(
sortProject = config["PROJECT"],
dbHost = configParams["DB_HOST"],
dbName = configParams["DB_DATABASE"],
dbUser = configParams["DB_USER"],
dbPass = configParams["DB_PASSWORD"])
return None
示例2:
# 需要導入模塊: from hgu import Util [as 別名]
# 或者: from hgu.Util import readConfiguration [as 別名]
from hgu import Util
from hgu.db import DbAccess
from hgu.anatomyDb.version010 import Anatomy # High level anatomy DB access
# List of expected configuration parameters
config = {
"DB_HOST": None,
"DB_USER": None,
"DB_DATABASE": None,
"DB_PASSWORD": None,
"OUTPUT_FILEPATH": None,
"PROJECT": None
}
configFile = sys.argv[1]
Util.readConfiguration(configFile, config, printConfig=True)
# process the PROJECT flag
if config["PROJECT"].lower() not in ["emap", "gudmap"]:
Util.fatalError(["Unrecognised PROJECT parameter: " + config["PROJECT"]])
Util.statusMessage(["Reading in anatomy database."])
Anatomy.initialise(sortProject = config["PROJECT"],
dbHost = config["DB_HOST"],
dbName = config["DB_DATABASE"],
dbUser = config["DB_USER"],
dbPass = config["DB_PASSWORD"],
outputFilePath = config["OUTPUT_FILEPATH"])