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


Python Job._getParameters方法代码示例

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


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

示例1: execute

# 需要导入模块: from DIRAC.Interfaces.API.Job import Job [as 别名]
# 或者: from DIRAC.Interfaces.API.Job.Job import _getParameters [as 别名]
  def execute(self):
    """ Execute it.
    """
    jobDescription = self.paramDict['Job']
    prodID = self.paramDict['TransformationID']
    jobID = self.paramDict['TaskID']
    inputData = self.paramDict['InputData']
    
    job = Job(jobDescription)
    commons = job._getParameters() #pylint: disable=protected-access
    code = job.workflow.createCode()
    outputList = []
    for line in code.split("\n"):
      if line.count("listoutput"):
        outputList += eval(line.split("#")[0].split("=")[-1]) #pylint: disable=eval-used

    commons['outputList'] = outputList
    commons['PRODUCTION_ID'] = prodID
    commons['JOB_ID'] = jobID
    if inputData:
      commons['InputData'] = inputData

    result = constructProductionLFNs(commons)
    if not result['OK']:
      LOG.error(result['Message'])
      return result

    if commons['JobType'] in ILDJOBTYPES and commons['InputData']:
      for index, outputFile in enumerate( result['Value']['ProductionOutputData'] ):
        outputFileILD = getProdFilenameFromInput( commons['InputData'], outputFile, prodID, jobID )
        result['Value']['ProductionOutputData'][index] = outputFileILD
        LOG.debug("Changed output file name from '%s' to '%s' " % (outputFile, outputFileILD))


    return result
开发者ID:LCDsoft,项目名称:ILCDIRAC,代码行数:37,代码来源:OutputDataPolicy.py

示例2: execute

# 需要导入模块: from DIRAC.Interfaces.API.Job import Job [as 别名]
# 或者: from DIRAC.Interfaces.API.Job.Job import _getParameters [as 别名]
  def execute(self):
    """ Execute it.
    """
    jobDescription = self.paramDict['Job']
    prodID = self.paramDict['TransformationID']
    jobID = self.paramDict['TaskID']
    inputData = self.paramDict['InputData']
    
    job = Job(jobDescription)
    commons = job._getParameters()
    code = job.workflow.createCode()
    outputList = []
    for line in code.split("\n"):
      if line.count("listoutput"):
        outputList += eval(line.split("#")[0].split("=")[-1])

    commons['outputList'] = outputList
    commons['PRODUCTION_ID'] = prodID
    commons['JOB_ID'] = jobID
    if inputData:
      commons['InputData'] = inputData

    gLogger.debug(commons)
    result = constructProductionLFNs(commons)
    if not result['OK']:
      gLogger.error(result['Message'])
    return result
开发者ID:akiyamiyamoto,项目名称:ilddirac,代码行数:29,代码来源:OutputDataPolicy.py


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