当前位置: 首页>>代码示例>>Python>>正文


Python Dirac.attributes方法代码示例

本文整理汇总了Python中DIRAC.Interfaces.API.Dirac.Dirac.attributes方法的典型用法代码示例。如果您正苦于以下问题:Python Dirac.attributes方法的具体用法?Python Dirac.attributes怎么用?Python Dirac.attributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.Interfaces.API.Dirac.Dirac的用法示例。


在下文中一共展示了Dirac.attributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import attributes [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.attributes( int(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 )
开发者ID:sbel,项目名称:bes3-jinr,代码行数:32,代码来源:dirac-wms-job-attributes.py

示例2: int

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import attributes [as 别名]
  if not result['OK']:
    errorList.append( ( gridID, result['Message'] ) )
    exitCode = 2
  else:
    res = result['Value'][ gridID ]
    if extendedPrint:
      tab = ''
      for key in ['PilotJobReference', 'Status', 'OwnerDN', 'OwnerGroup', 'SubmissionTime', 'DestinationSite', 'GridSite', ]:
        if key in res:
          diracAdmin.log.notice( '%s%s: %s' % ( tab, key, res[key] ) )
          if not tab:
            tab = '  '
      diracAdmin.log.notice( '' )
      for jobID in res['Jobs']:
        tab = '  '
        result = dirac.attributes( int( jobID ) )
        if not result['OK']:
          errorList.append( ( gridID, result['Message'] ) )
          exitCode = 2
        else:
          job = result['Value']
          diracAdmin.log.notice( '%sJob ID: %s' % ( tab, jobID ) )
          tab += '  '
          for key in [ 'OwnerDN', 'OwnerGroup', 'JobName', 'Status', 'StartExecTime', 'LastUpdateTime', 'EndExecTime' ]:
            if key in job:
              diracAdmin.log.notice( '%s%s:' % ( tab, key ) , job[key] )
      diracAdmin.log.notice( '' )
    else:
      print diracAdmin.pPrint.pformat( { gridID: res } )

开发者ID:DIRACGrid-test,项目名称:DIRAC,代码行数:31,代码来源:dirac-admin-get-pilot-info.py

示例3: int

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import attributes [as 别名]
        pass
    elif switch[0] == 'Job':
      try:
        job = int( switch[1] )
      except:
        print "Invalid jobID", switch[1]

  if not job:
    args = Script.getPositionalArgs()

    if len( args ) == 1:
      requestName = args[0]
  else:
    from DIRAC.Interfaces.API.Dirac                              import Dirac
    dirac = Dirac()
    res = dirac.attributes( job )
    if not res['OK']:
      print "Error getting job parameters", res['Message']
    else:
      jobName = res['Value'].get( 'JobName' )
      if not jobName:
        print 'Job %d not found' % job
      else:
        requestName = jobname + '_job_%d' % job

  requests = []
  if requestName:
    requests = [requestName]
  elif resetFailed:
    res = reqClient.getRequestNamesList( ['Failed'], maxReset );
    if not res['OK']:
开发者ID:afalabel,项目名称:DIRAC,代码行数:33,代码来源:dirac-dms-reset-request.py

示例4: len

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import attributes [as 别名]
    for day in days:
        try:
            [running_ids.add(id) for id in dirac.selectJobs(
                status=status, date=day,
                owner=username)['Value']]
        except KeyError:
            pass

n_jobs = len(running_ids)
if n_jobs > 0:
    print("getting names from {} running/waiting jobs... please wait..."
          .format(n_jobs))
    for i, id in enumerate(running_ids):
        if ((100 * i) / n_jobs) % 5 == 0:
            print("\r{} %".format(((20 * i) / n_jobs) * 5)),
        jobname = dirac.attributes(id)["Value"]["JobName"]
        running_names.append(jobname)
    else:
        print("\n... done")

# summary before submitting
print("\nrunning as:")
print(pilot_args_classify)
print("\nwith input_sandbox:")
print(input_sandbox)
print("\nwith output file:")
print(output_filename_template.format('{job_name}'))

for i, filelist in enumerate([
        prod3b_filelist_gamma,
        prod3b_filelist_proton,
开发者ID:tino-michael,项目名称:tino_cta,代码行数:33,代码来源:submit.py


注:本文中的DIRAC.Interfaces.API.Dirac.Dirac.attributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。