本文整理汇总了Python中hgu.Util.statusMessage方法的典型用法代码示例。如果您正苦于以下问题:Python Util.statusMessage方法的具体用法?Python Util.statusMessage怎么用?Python Util.statusMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hgu.Util
的用法示例。
在下文中一共展示了Util.statusMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __initialise
# 需要导入模块: from hgu import Util [as 别名]
# 或者: from hgu.Util import statusMessage [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: _relCmp
# 需要导入模块: from hgu import Util [as 别名]
# 或者: from hgu.Util import statusMessage [as 别名]
def _relCmp(rel1, rel2):
"""
Sort comparison routine to compare 2 relationships.
First sorts by rel sequence (if set), and then by
child component names if sequence is a tie.
"""
relType1 = rel1.getRelationshipType()
relType2 = rel2.getRelationshipType()
#if relType1 != relType2:
# Util.fatalError([
# "Attempting to sort relationships of two different types:",
# "Type 1: " + relType1 + " Type 2: " + relType2
# ])
if rel1.getParentOid() != rel2.getParentOid():
Util.fatalError([
"Attempting to sort relationships that have different parents."])
relProj1 = AnaRelationshipProjectDb.getByRelationShipFkAndProject(rel1.getOid(), _sortProject)
relProj2 = AnaRelationshipProjectDb.getByRelationShipFkAndProject(rel2.getOid(), _sortProject)
seq1 = relProj1.getSequence()
seq2 = relProj2.getSequence()
#if seq1 != None and seq2 != None:
#Util.statusMessage(["Relationship 1: " + str(rel1.getOid()) + "\n" +
# "Type 1: " + relType1 + "\n" +
# "Sequence 1: " + str(seq1) + "\n" +
# "Project: " + _sortProject])
#Util.statusMessage(["Relationship 2: " + str(rel2.getOid()) + "\n" +
# "Type 2: " + relType2 + "\n" +
# "Sequence 2: " + str(seq2) + "\n" +
# "Project: " + _sortProject])
if seq1 != seq2:
# sort based purely on sequence
if seq1 != None and seq2 != None:
if seq1 < seq2:
return -1
elif seq1 > seq2:
return +1
elif seq1 != None:
return -1
elif seq2 != None:
return +1
else:
# sequence same, sort based on name.
#if relType1 == IS_A:
#if relType1 == PART_OF or relType1 == IS_A or relType1 == DERIVES_FROM or relType1 == DEVELOPS_FROM or relType1 == LOCATED_IN or relType1 == DEVELOPS_IN or relType1 == DISJOINT_FROM or relType1 == ATTACHED_TO or relType1 == HAS_PART:
if relType1 == PART_OF or relType1 == IS_A or relType1 == DEVELOPS_FROM or relType1 == LOCATED_IN or relType1 == DEVELOPS_IN or relType1 == DISJOINT_FROM or relType1 == ATTACHED_TO or relType1 == HAS_PART:
#if relType1 == PART_OF or relType1 == DERIVES_FROM or relType1 == DEVELOPS_FROM or relType1 == LOCATED_IN or relType1 == DEVELOPS_IN or relType1 == DISJOINT_FROM or relType1 == ATTACHED_TO or relType1 == HAS_PART:
#Util.statusMessage(["HERE!"])
#Util.statusMessage(["Relationship 1: " + str(rel1.getOid()) + "\n" +
# "Type 1: " + relType1 + "\n" +
# "Sequence 1: " + str(seq1) + "\n" +
# "Project: " + _sortProject])
#Util.statusMessage(["Relationship 2: " + str(rel2.getOid()) + "\n" +
# "Type 2: " + relType2 + "\n" +
# "Sequence 2: " + str(seq2) + "\n" +
# "Project: " + _sortProject])
return cmp(Nodes.getByOid(rel1.getChildOid()).getComponentName(),
Nodes.getByOid(rel2.getChildOid()).getComponentName())
else:
# assume relationship is between timed nodes.
Util.statusMessage(["THERE"])
Util.statusMessage(["Relationship 1: " + str(rel1.getOid()) + "\n" +
"Type 1: " + relType1 + "\n" +
"Sequence 1: " + str(seq1) + "\n" +
"Project: " + _sortProject])
Util.statusMessage(["Relationship 2: " + str(rel2.getOid()) + "\n" +
"Type 2: " + relType2 + "\n" +
"Sequence 2: " + str(seq2) + "\n" +
"Project: " + _sortProject])
nodeOid1 = TimedNodes.getByOid(rel1.getChildOid()).getNodeOid()
nodeOid2 = TimedNodes.getByOid(rel2.getChildOid()).getNodeOid()
return cmp(Nodes.getByOid(nodeOid1).getComponentName(),
Nodes.getByOid(nodeOid2).getComponentName())
示例3:
# 需要导入模块: from hgu import Util [as 别名]
# 或者: from hgu.Util import statusMessage [as 别名]
"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"])
Util.statusMessage(["Generating SQL to repopulate derived tables."])
Anatomy.generateDerivedData()
DbAccess.finalise()
Util.statusMessage(["Done. SQL script is in " + config["OUTPUT_FILEPATH"]])
sys.exit(0)