本文整理汇总了Python中pandatools.Client.queryFilesInDataset方法的典型用法代码示例。如果您正苦于以下问题:Python Client.queryFilesInDataset方法的具体用法?Python Client.queryFilesInDataset怎么用?Python Client.queryFilesInDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandatools.Client
的用法示例。
在下文中一共展示了Client.queryFilesInDataset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getDBDatasets
# 需要导入模块: from pandatools import Client [as 别名]
# 或者: from pandatools.Client import queryFilesInDataset [as 别名]
def getDBDatasets(jobO,trf,dbrelease):
from pandatools import Client
# get DB datasets
dbrFiles = {}
dbrDsList = []
if trf or dbrelease != '':
if trf:
# parse jobO for TRF
tmpItems = jobO.split()
else:
# mimic a trf parameter to reuse following algorithm
tmpItems = ['%DB='+dbrelease]
# look for DBRelease
for tmpItem in tmpItems:
match = re.search('%DB=([^:]+):(.+)$',tmpItem)
if match:
tmpDbrDS = match.group(1)
tmpDbrLFN = match.group(2)
# get files in the dataset
if not tmpDbrDS in dbrDsList:
logger.info("Querying files in dataset:%s" % tmpDbrDS)
try:
tmpList = Client.queryFilesInDataset(tmpDbrDS,False)
except:
raise ApplicationConfigurationError("ERROR : error while looking up dataset %s. Perhaps this dataset does not exist?"%tmpDbrDS)
# append
for tmpLFN,tmpVal in tmpList.iteritems():
dbrFiles[tmpLFN] = tmpVal
dbrDsList.append(tmpDbrDS)
# check
if tmpDbrLFN not in dbrFiles:
raise ApplicationConfigurationError("ERROR : %s is not in %s"%(tmpDbrLFN,tmpDbrDS))
return dbrFiles,dbrDsList