From b5de482797c13c7d5be9beb185f53b651a14314f Mon Sep 17 00:00:00 2001 From: tmaeno Date: Wed, 24 May 2023 10:38:17 +0200 Subject: [PATCH] 1.5.52 --- ChangeLog.txt | 3 +++ pandaclient/PandaToolsPkgInfo.py | 2 +- pandaclient/PrunScript.py | 38 +++++++++++++++++++------------- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 357c23dd..7ab4e0b5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,8 @@ ** Release Notes +1.5.53 + * regex in outputs of prun + 1.5.52 * added pyproject.toml * introduced panda-client-light diff --git a/pandaclient/PandaToolsPkgInfo.py b/pandaclient/PandaToolsPkgInfo.py index 7d6d2ed0..9d6a2e71 100644 --- a/pandaclient/PandaToolsPkgInfo.py +++ b/pandaclient/PandaToolsPkgInfo.py @@ -1 +1 @@ -release_version = "1.5.52" +release_version = "1.5.53" diff --git a/pandaclient/PrunScript.py b/pandaclient/PrunScript.py index 9b8ce829..575d0fd4 100644 --- a/pandaclient/PrunScript.py +++ b/pandaclient/PrunScript.py @@ -1491,30 +1491,38 @@ def _onExit(dir, files, del_command): if options.outputs != '': outMap = {} dsSuffix = [] + dsIndex = 0 for tmpLFN in options.outputs.split(','): tmpDsSuffix = '' if ':' in tmpLFN: - tmpDsSuffix,tmpLFN = tmpLFN.split(':') + tmpDsSuffix, tmpLFN = tmpLFN.split(':') if tmpDsSuffix in dsSuffix: - tmpErrMsg = "dataset name suffix '%s' is used for multiple files in --outputs. " % tmpDsSuffix + tmpErrMsg = "dataset name suffix '%s' is used for multiple files in --outputs. " % tmpDsSuffix tmpErrMsg += 'each output must have a unique suffix.' tmpLog.error(tmpErrMsg) sys.exit(EC_Config) dsSuffix.append(tmpDsSuffix) - tmpNewLFN = tmpLFN - # change * to XYZ and add .tgz - if '*' in tmpNewLFN: - tmpNewLFN = tmpNewLFN.replace('*','XYZ') - tmpNewLFN += '.tgz' - if len(outDatasetName.split('.')) > 2: - lfn = '{0}.{1}'.format(*outDatasetName.split('.')[:2]) + if tmpLFN.startswith('regex|'): + # regex + lfn = tmpLFN + if not tmpDsSuffix: + tmpDsSuffix = dsIndex + dsIndex += 1 else: - lfn = outDatasetName[:-1] - if options.addNthFieldOfInDSToLFN != '' or options.addNthFieldOfInFileToLFN != '': - lfn += '${MIDDLENAME}' - lfn += '.$JEDITASKID._${{SN/P}}.{0}'.format(tmpNewLFN) - if tmpDsSuffix == '': - tmpDsSuffix = tmpNewLFN + tmpNewLFN = tmpLFN + # change * to XYZ and add .tgz + if '*' in tmpNewLFN: + tmpNewLFN = tmpNewLFN.replace('*','XYZ') + tmpNewLFN += '.tgz' + if len(outDatasetName.split('.')) > 2: + lfn = '{0}.{1}'.format(*outDatasetName.split('.')[:2]) + else: + lfn = outDatasetName[:-1] + if options.addNthFieldOfInDSToLFN != '' or options.addNthFieldOfInFileToLFN != '': + lfn += '${MIDDLENAME}' + lfn += '.$JEDITASKID._${{SN/P}}.{0}'.format(tmpNewLFN) + if tmpDsSuffix == '': + tmpDsSuffix = tmpNewLFN dataset = '{0}_{1}/'.format(outDatasetName[:-1],tmpDsSuffix) taskParamMap['jobParameters'] += MiscUtils.makeJediJobParam(lfn,dataset,'output',hidden=True, destination=options.destSE,