本文整理汇总了Python中NewTraceFac.NTRC.isProduction方法的典型用法代码示例。如果您正苦于以下问题:Python NTRC.isProduction方法的具体用法?Python NTRC.isProduction怎么用?Python NTRC.isProduction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewTraceFac.NTRC
的用法示例。
在下文中一共展示了NTRC.isProduction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from NewTraceFac import NTRC [as 别名]
# 或者: from NewTraceFac.NTRC import isProduction [as 别名]
def main():
'''
Process:
- Parse the CLI command into g.various data items.
- Validate user-supplied directories; get environment variables.
- Query the searchspace for the stream of instructions
- For each instruction from database selection, get dict for line
- Using dict args, construct plausible command lines, into file
- Check to see that there aren't too many similar processes
already running; if too many, then wait.
- Launch ListActor process to execute commands.
- Wait a polite interval before launching another.
'''
NTRC.ntracef(0, "MAIN", "Begin.")
NTRC.ntracef(0, "MAIN", "TRACE traceproduction|%s|" % NTRC.isProduction())
sBrokerCommand = fnsReconstituteCommand(sys.argv)
fnbMaybeLogCommand(sBrokerCommand)
NTRC.ntracef(0, "MAIN", "command=|%s|" % (sBrokerCommand.rstrip()))
# Get args from CLI and put them into the global data
dCliDict = brokercli.fndCliParse("")
# Carefully insert any new CLI values into the Global object.
dCliDictClean = {k:util.fnIntPlease(v) for k,v in dCliDict.items()
if v is not None}
g.__dict__.update(dCliDictClean)
# Validate that the user-specified directories exist.
if not fnbValidateDir(g.sFamilyDir):
raise ValueError("FamilyDir \"%s\" not found" % (g.sFamilyDir))
if not fnbValidateDir("%s/%s" % (g.sFamilyDir, g.sSpecificDir)):
raise ValueError("SpecificDir \"%s\" not found" % (g.sSpecificDir))
# Get command templates from external file.
fnGetCommandTemplates(g.sCommandListFilename)
# Construct database query for this invocation.
g.cFmt = brokerformat.CFormat()
dQuery = g.cFmt.fndFormatQuery(dCliDict, g)
# Look for overriding environment variables
fnvGetEnvironmentOverrides()
# Open the database to keep "done" records,
# and delete moldy, old in-progress records.
g.mdb = searchdatabasemongo.CSearchDatabase(g.sSearchDbMongoName,
g.sSearchDbProgressCollectionName,
g.sSearchDbDoneCollectionName)
g.mdb.fnvDeleteProgressCollection()
# Get the set of instructions for today from database.
NTRC.tracef(0,"MAIN","proc querydict2|%s|" % ((dQuery)))
itAllInstructions = searchspace.fndgGetSearchSpace(g.sInsDir, g.sInsTyp,
dQuery)
nRuns = fnnProcessAllInstructions(itAllInstructions)
# If this wasn't just a listonly run, do all the cases.
if not g.sListOnly.startswith("Y"):
NTRC.ntracef(3, "MAIN", "proc all instr|%s|" % (g.lGiantInstr))
nCases = nb.fntRunEverything(g, iter(g.lGiantInstr)
, g.nCoreTimer, g.nStuckLimit)
else:
nCases = len(g.lGiantInstr)
NTRC.ntracef(0, "MAIN", "End ncases|%s|" % (nCases,))