本文整理汇总了Python中DIRAC.Interfaces.API.Dirac.Dirac.parameters方法的典型用法代码示例。如果您正苦于以下问题:Python Dirac.parameters方法的具体用法?Python Dirac.parameters怎么用?Python Dirac.parameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Interfaces.API.Dirac.Dirac
的用法示例。
在下文中一共展示了Dirac.parameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import parameters [as 别名]
import DIRAC
from DIRAC.Core.Base import Script
Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1],
'Usage:',
' %s [option|cfgfile] ... JobID ...' % Script.scriptName,
'Arguments:',
' JobID: DIRAC Job ID' ] ) )
Script.parseCommandLine( ignoreErrors = True )
args = Script.getPositionalArgs()
if len( args ) < 1:
Script.showHelp()
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac()
exitCode = 0
errorList = []
for job in args:
result = dirac.parameters( job, printOutput = True )
if not result['OK']:
errorList.append( ( job, result['Message'] ) )
exitCode = 2
for error in errorList:
print "ERROR %s: %s" % error
DIRAC.exit( exitCode )
示例2: gLogger
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import parameters [as 别名]
owner = owner)
if not res['OK']:
gLogger("ERROR retrieving jobs")
gLogger(res["Message"])
exitCode = 2
else:
conds = []
for n, v in conditions.items():
if v:
conds.append( '%s = %s' % ( n, v ) )
jobs = res['Value']
pilot_refs = {}
for job in jobs:
# next get pilot refs
key = job
res = dirac.parameters( job, printOutput = False )
if not res['OK']:
gLogger.error("ERROR retrieving job parameters")
gLogger.error(res['Message'])
exitCode = 3
else:
val = res['Value']['Pilot_Reference']
pilot_refs[key]=val
# next is to look through the pilots
pilot_info = {}
for i,job in enumerate(pilot_refs):
gLogger.info("Pilot for %s: %s"%(str(job),str(pilot_refs[job])))
pilotInfo = getPilotLoggingInfo(pilot_refs[job])
#gLogger.info("%s,%s"%(str(job),str(pilotInfo)))
gLogger.debug("Detailed Pilot Logging Info for %s below:"%pilot_refs[job])
for line in pilotInfo.split("\n"):