本文整理匯總了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