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


Python Dirac.monitorRepository方法代码示例

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


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

示例1: _getOutputs

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import monitorRepository [as 别名]
def _getOutputs():
  repoLocation = ''
  clip = _Params()
  clip.registerSwitches()
  Script.parseCommandLine( ignoreErrors = False )
  repoLocation = clip.repo
  if not repoLocation:
    Script.showHelp()
    dexit(1)
  from DIRAC import gLogger
  from DIRAC.Interfaces.API.Dirac import Dirac

  dirac = Dirac(True, repoLocation)
  
  exitCode = 0
  res = dirac.monitorRepository(False)
  if not res['OK']:
    gLogger.error("Failed because %s" % res['Message'])
    dexit(1)
    
  res = dirac.retrieveRepositorySandboxes()
  if not res['OK']:
    gLogger.error("Failed because %s" % res['Message'])
    dexit(1)
  if clip.outputdata:
    res = dirac.retrieveRepositoryData()
    if not res['OK']:
      gLogger.error("Failed because %s" % res['Message'])
      exit(1)
  dexit(exitCode)
开发者ID:akiyamiyamoto,项目名称:ilddirac,代码行数:32,代码来源:dirac-repo-retrieve-jobs-output.py

示例2: _getOutputData

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import monitorRepository [as 别名]
def _getOutputData():
  cliParams = _Params()
  cliParams.registerSwitches()
  Script.parseCommandLine( ignoreErrors = False )
  if not cliParams.repo:
    Script.showHelp()
    dexit(2)
  from DIRAC.Interfaces.API.Dirac import Dirac
  
  dirac = Dirac(True, cliParams.repo)

  exitCode = 0
  dirac.monitorRepository(False)
  dirac.retrieveRepositoryData()

  dexit(exitCode)
开发者ID:LCDsoft,项目名称:ILCDIRAC,代码行数:18,代码来源:dirac-repo-retrieve-jobs-output-data.py

示例3: len

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import monitorRepository [as 别名]
  Monitor the jobs present in the repository
"""
__RCSID__ = "eab4069 (2011-11-16 10:51:49 +0100) Stephane Poss <[email protected]>"

import DIRAC
from DIRAC.Core.Base import Script
import os, sys

Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1],
                                     'Usage:',
                                     '  %s [option|cfgfile] ... RepoDir' % Script.scriptName,
                                     'Arguments:',
                                     '  RepoDir:  Location of Job Repository' ] ) )
Script.parseCommandLine( ignoreErrors = False )
args = Script.getPositionalArgs()

if len( args ) != 1:
  Script.showHelp()

repoLocation = args[0]
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac( withRepo = True, repoLocation = repoLocation )

exitCode = 0
result = dirac.monitorRepository( printOutput = True )
if not result['OK']:
  print 'ERROR: ', result['Message']
  exitCode = 2

DIRAC.exit( exitCode )
开发者ID:sbel,项目名称:bes3-jinr,代码行数:32,代码来源:dirac-repo-monitor.py

示例4: Params

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import monitorRepository [as 别名]
if __name__=="__main__":
  repoLocation = ''
  clip = Params()
  clip.registerSwitches()
  Script.parseCommandLine( ignoreErrors = False )
  repoLocation = clip.repo
  if not repoLocation:
    Script.showHelp()
    dexit(1)
  from DIRAC import gLogger
  from DIRAC.Interfaces.API.Dirac import Dirac

  dirac = Dirac(True, repoLocation)
  
  exitCode = 0
  res = dirac.monitorRepository(False)
  if not res['OK']:
    gLogger.error("Failed because %s" % res['Message'])
    dexit(1)
    
  res = dirac.retrieveRepositorySandboxes()
  if not res['OK']:
    gLogger.error("Failed because %s" % res['Message'])
    dexit(1)
  if clip.outputdata:
    res = dirac.retrieveRepositoryData()
    if not res['OK']:
      gLogger.error("Failed because %s" % res['Message'])
      exit(1)
  dexit(exitCode)
开发者ID:LCDgit,项目名称:ILCDIRAC,代码行数:32,代码来源:dirac-repo-retrieve-jobs-output.py


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