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


Python FileCatalogClient.getCompatibleMetadata方法代码示例

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


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

示例1: DiracILC

# 需要导入模块: from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient [as 别名]
# 或者: from DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient import getCompatibleMetadata [as 别名]
from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient
dirac = DiracILC()


meta = {}
meta[ 'ProdID' ] = prodID
if eventType:
  meta[ 'EvtType' ] = eventType
if energy:
  meta[ 'Energy'] = energy
if dataType:
  meta[ 'Datatype' ] = dataType


fc = FileCatalogClient()
res = fc.getCompatibleMetadata( meta )
if not res['OK']:
  print "Error looking up the catalog for metadata"
  exit(2)

metaValues = res['Value']
#print metaValues

print 'Meta data for production', prodID, ':'
for key, value in metaValues.iteritems():
  if not len(value) == 0:
    print '\t', key, ':', value[0]

if dataType:
  print '\t', 'Datatype :', dataType
开发者ID:akiyamiyamoto,项目名称:ilddirac,代码行数:32,代码来源:SIDProductionChain.py

示例2: exec

# 需要导入模块: from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient [as 别名]
# 或者: from DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient import getCompatibleMetadata [as 别名]
    exec(f.read())
if not bannedSites:
    bannedSites = ['']

if lcsimVer and overlayBX > 0:
    jobTitle += '_%sBXbackground'%(overlayBX)
repositoryFile = 'repositoryFiles/'+detector+'.'+jobTitle.replace('/', '.')+'.'

# create a repository file and generate list of lfns to process
if prodID:      # use a production id to define the lfnlist
    meta = {}
    meta[ 'ProdID' ] = prodID
    if dataType:
        meta['Datatype'] = dataType
    print 'Using production ID to define LFN list:'
    result = fileCatalog.getCompatibleMetadata( meta, lfnProdPath )
    if not result['OK']:
        print "Error looking up the file catalog for metadata"
        sys.exit(2)
    metaData = result['Value']
    print '  Found production ID %s. Associated meta data:'%( prodID )
    for key, value in metaData.iteritems():
        if not len(value) == 0:
            print '    %s: %s'%( key, value[0] )
    if metaData['Datatype'][0] == 'SIM':
        slicVer = ''        # data has been simulated, can skip SLIC step
    if metaData['EvtType'] and not process:
        process = metaData['EvtType'][0]
    if slicVer and metaData['NumberOfEvents']:
        if nEvts < 1:
            nEvts = int(metaData['NumberOfEvents'][0])
开发者ID:BrennanGit,项目名称:scripts,代码行数:33,代码来源:SiDChainJobOriginal.py


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