From 4a26df1512ab540230b8222be733fd280868011e Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 11:47:59 +0100 Subject: [PATCH 01/36] add github actions test --- .github/workflows/pr.yaml | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..9d87c0e --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,66 @@ +name: Test Pull Request + +on: [pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8'] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Cache .cache/pip + uses: actions/cache@v3 + id: cache-pip + with: + path: ~/.cache/pip + key: pip_cache_py_${{ matrix.python-version }} + - name: Install package + run: pip install -r requirements.txt black==23.3 flake8==6.0 + - name: Flake8 + run: flake8 --ignore=C901,W503 + - name: Black + uses: psf/black@23.3.0 + + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8'] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Cache .cache/pip + uses: actions/cache@v3 + id: cache-pip + with: + path: ~/.cache/pip + key: pip_cache_py_${{ matrix.python-version }} + - name: install package + run: python -m pip install . + - name: install packages for testing + run: pip install nose xmldiff + + - name: Run smoke test on example + run: | + python examples/example.py > tmp.xml + xmldiff --check tmp.xml examples/tool.xml + python examples/example_macros.py > tmp.xml + xmldiff --check tmp.xml examples/example_macros.xml + + - name: diff_pydocstyle_report + run: make diff_pydocstyle_report + - name: Test + run: make test + - name: Planemo lint tools + run: planemo l tests/test-data/ + # planemo test content of tests/test-data (this is OK, because the previous + # tests ensure equality of the xmls that are generated and those in the package) + - name: planemo test tools + run: export PATH=$(pwd)/tests/test-data:$PATH && planemo t tests/test-data/ \ No newline at end of file From 4a27897ef94ffc93504c77ee19bde390a3496ef7 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:21:11 +0100 Subject: [PATCH 02/36] force installation of requirements.txt for lint and remove copy paste remnants --- .github/workflows/pr.yaml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 9d87c0e..05e3344 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -20,7 +20,9 @@ jobs: path: ~/.cache/pip key: pip_cache_py_${{ matrix.python-version }} - name: Install package - run: pip install -r requirements.txt black==23.3 flake8==6.0 + run: | + touch requirements.txt + pip install -r requirements.txt black==23.3 flake8==6.0 - name: Flake8 run: flake8 --ignore=C901,W503 - name: Black @@ -42,18 +44,6 @@ jobs: with: path: ~/.cache/pip key: pip_cache_py_${{ matrix.python-version }} - - name: install package - run: python -m pip install . - - name: install packages for testing - run: pip install nose xmldiff - - - name: Run smoke test on example - run: | - python examples/example.py > tmp.xml - xmldiff --check tmp.xml examples/tool.xml - python examples/example_macros.py > tmp.xml - xmldiff --check tmp.xml examples/example_macros.xml - - name: diff_pydocstyle_report run: make diff_pydocstyle_report - name: Test From 5fc2afa103b6c0fa59c231323eb1f8b918a730ad Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:31:54 +0100 Subject: [PATCH 03/36] skip flake E501 and add requirements --- .github/workflows/pr.yaml | 6 +++++- requirements-dev.txt | 2 ++ requirements.txt | 0 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 05e3344..5de4f49 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -24,7 +24,7 @@ jobs: touch requirements.txt pip install -r requirements.txt black==23.3 flake8==6.0 - name: Flake8 - run: flake8 --ignore=C901,W503 + run: flake8 --ignore=C901,W503,E501 - name: Black uses: psf/black@23.3.0 @@ -44,6 +44,10 @@ jobs: with: path: ~/.cache/pip key: pip_cache_py_${{ matrix.python-version }} + - name: setup + run: | + pip install -r requirements.txt . + pip install -r requirements-dev.txt - name: diff_pydocstyle_report run: make diff_pydocstyle_report - name: Test diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..67d3b05 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +diff_cover +pydocstyle \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 From 412de93f56804922e5b2fb0219e7a5f396314651 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:34:00 +0100 Subject: [PATCH 04/36] also run on push --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5de4f49..0a04da9 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,6 +1,6 @@ name: Test Pull Request -on: [pull_request] +on: [pull_request, push] jobs: lint: From 55bcd75754b4422aa4dc4568852382808a28e9ef Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:37:22 +0100 Subject: [PATCH 05/36] disable black, fill requirements.txt --- .github/workflows/pr.yaml | 5 +++-- requirements-dev.txt | 1 + requirements.txt | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0a04da9..2e3b9fc 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,8 +25,9 @@ jobs: pip install -r requirements.txt black==23.3 flake8==6.0 - name: Flake8 run: flake8 --ignore=C901,W503,E501 - - name: Black - uses: psf/black@23.3.0 + # at the moment I would prefer not to enable this + # - name: Black + # uses: psf/black@23.3.0 test: runs-on: ubuntu-latest diff --git a/requirements-dev.txt b/requirements-dev.txt index 67d3b05..c8bbc23 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,3 @@ diff_cover +planemo pydocstyle \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e69de29..9efeead 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1,3 @@ +git+https://github.com/WorkflowConversion/CTDopts +lxml +ruamel.yaml \ No newline at end of file From f578653df8b045a3a999ccb21f15620dc5a46fb9 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:39:28 +0100 Subject: [PATCH 06/36] temp disable diff_pydocstyle_report --- .github/workflows/pr.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2e3b9fc..ee0130b 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -49,8 +49,9 @@ jobs: run: | pip install -r requirements.txt . pip install -r requirements-dev.txt - - name: diff_pydocstyle_report - run: make diff_pydocstyle_report + #TODO reenable: works only on branch? + # - name: diff_pydocstyle_report + # run: make diff_pydocstyle_report - name: Test run: make test - name: Planemo lint tools From ed78e484bd92514814ffd1d2f60572736944e2a7 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:45:37 +0100 Subject: [PATCH 07/36] galaxy: do not set name and argument --- ctdconverter/galaxy/converter.py | 16 +++- tests/test-data/bool.xml | 20 ++-- tests/test-data/float.xml | 32 +++---- tests/test-data/ifile.xml | 96 +++++++++---------- tests/test-data/integer.xml | 32 +++---- tests/test-data/label-help.xml | 16 ++-- tests/test-data/ofile-corresponding-input.xml | 6 +- tests/test-data/ofile-mult-typeparam.xml | 4 +- tests/test-data/ofile-mult.xml | 4 +- tests/test-data/ofile-typeparam.xml | 22 ++--- tests/test-data/repeat_test.xml | 80 ++++++++-------- tests/test-data/select_test.xml | 64 ++++++------- tests/test-data/string.xml | 16 ++-- 13 files changed, 210 insertions(+), 198 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index d074400..42fcbea 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1160,8 +1160,11 @@ def create_param_attribute_list(param_node, param, model, supported_file_formats # parameters need to be treated in cheetah. variable names are currently fixed back # to dashes in fill_ctd.py. currently there seems to be only a single tool # requiring this https://github.com/OpenMS/OpenMS/pull/4529 - param_node.attrib["name"] = get_galaxy_parameter_name(param) - param_node.attrib["argument"] = "-%s" % utils.extract_param_name(param) + argument = "-%s" % utils.extract_param_name(param) + name = get_galaxy_parameter_name(param) + if argument.lstrip("-").replace("-", "_") != name: + param_node.attrib["name"] = get_galaxy_parameter_name(param) + param_node.attrib["argument"] = argument param_type = TYPE_TO_GALAXY_TYPE[param.type] if param_type is None: raise ModelError("Unrecognized parameter type %(type)s for parameter %(name)s" @@ -1673,6 +1676,15 @@ def create_tests(parent, inputs=None, outputs=None, test_macros_prefix=None, nam test_node = add_child_node(tests_node, "test") strip_elements(inputs, "validator", "sanitizer") for node in inputs.iter(): + # params do not have a name if redundant with argument + # -> readd and restore attrib order + if node.tag == "param" and not node.attrib.get("name") and node.attrib.get("argument"): + attrib = copy.deepcopy(node.attrib) + node.attrib["name"] = node.attrib["argument"].lstrip("-").replace("-", "_") + for a in attrib: + del node.attrib[a] + node.attrib[a] = attrib[a] + if node.tag == "expand" and node.attrib["macro"] == ADVANCED_OPTIONS_NAME + "macro": node.tag = "conditional" node.attrib["name"] = ADVANCED_OPTIONS_NAME + "cond" diff --git a/tests/test-data/bool.xml b/tests/test-data/bool.xml index 89f1ed0..ea96da1 100644 --- a/tests/test-data/bool.xml +++ b/tests/test-data/bool.xml @@ -32,12 +32,12 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - - - - - + + + + + +
@@ -49,10 +49,10 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- - - - + + + + diff --git a/tests/test-data/float.xml b/tests/test-data/float.xml index abfa3a2..da0975d 100644 --- a/tests/test-data/float.xml +++ b/tests/test-data/float.xml @@ -32,14 +32,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - - - - - - - + + + + + + + +
@@ -59,14 +59,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- - - - - - - - + + + + + + + + diff --git a/tests/test-data/ifile.xml b/tests/test-data/ifile.xml index ec93a19..5f091a1 100644 --- a/tests/test-data/ifile.xml +++ b/tests/test-data/ifile.xml @@ -756,30 +756,30 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
@@ -831,30 +831,30 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub(
- - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test-data/integer.xml b/tests/test-data/integer.xml index 655678b..45e6aa4 100644 --- a/tests/test-data/integer.xml +++ b/tests/test-data/integer.xml @@ -32,14 +32,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - - - - - - - + + + + + + + +
@@ -59,14 +59,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- - - - - - - - + + + + + + + + diff --git a/tests/test-data/label-help.xml b/tests/test-data/label-help.xml index dae6c60..3eb8e4b 100644 --- a/tests/test-data/label-help.xml +++ b/tests/test-data/label-help.xml @@ -32,28 +32,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + - + - + - + diff --git a/tests/test-data/ofile-corresponding-input.xml b/tests/test-data/ofile-corresponding-input.xml index bb213ef..885012a 100644 --- a/tests/test-data/ofile-corresponding-input.xml +++ b/tests/test-data/ofile-corresponding-input.xml @@ -214,9 +214,9 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - - + + + diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index 8f03392..a1c365e 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -51,12 +51,12 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - + - +
diff --git a/tests/test-data/ofile-mult.xml b/tests/test-data/ofile-mult.xml index ae4ae58..c8732ae 100644 --- a/tests/test-data/ofile-mult.xml +++ b/tests/test-data/ofile-mult.xml @@ -60,8 +60,8 @@ ${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandato - - + + diff --git a/tests/test-data/ofile-typeparam.xml b/tests/test-data/ofile-typeparam.xml index 51f9ae5..cd96e83 100644 --- a/tests/test-data/ofile-typeparam.xml +++ b/tests/test-data/ofile-typeparam.xml @@ -170,33 +170,33 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - - - + + +
@@ -251,25 +251,25 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + diff --git a/tests/test-data/repeat_test.xml b/tests/test-data/repeat_test.xml index 4970fe5..ae9ac37 100644 --- a/tests/test-data/repeat_test.xml +++ b/tests/test-data/repeat_test.xml @@ -32,89 +32,89 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -299,89 +299,89 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/tests/test-data/select_test.xml b/tests/test-data/select_test.xml index 02429e2..c1fe4ee 100644 --- a/tests/test-data/select_test.xml +++ b/tests/test-data/select_test.xml @@ -32,35 +32,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -68,7 +68,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -76,7 +76,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -84,7 +84,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -92,35 +92,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -128,7 +128,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -136,7 +136,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -144,7 +144,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -395,35 +395,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -431,7 +431,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -439,7 +439,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -447,7 +447,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -455,35 +455,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -491,7 +491,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -499,7 +499,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -507,7 +507,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + diff --git a/tests/test-data/string.xml b/tests/test-data/string.xml index eb1d183..25b2883 100644 --- a/tests/test-data/string.xml +++ b/tests/test-data/string.xml @@ -32,16 +32,16 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - +
@@ -71,16 +71,16 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + From 8079e391d30a7f3efc55c692096b5eb6ca223117 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 16 May 2021 12:16:58 +0200 Subject: [PATCH 08/36] galaxy: fix selects https://github.com/galaxyproject/galaxy/issues/11797 --- ctdconverter/galaxy/converter.py | 28 ++++--- tests/test-data/ofile-mult-typeparam.xml | 4 +- tests/test-data/ofile-typeparam.xml | 32 ++++---- tests/test-data/select_test.xml | 96 ++++++++++++------------ 4 files changed, 83 insertions(+), 77 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 42fcbea..055be42 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1165,22 +1165,18 @@ def create_param_attribute_list(param_node, param, model, supported_file_formats if argument.lstrip("-").replace("-", "_") != name: param_node.attrib["name"] = get_galaxy_parameter_name(param) param_node.attrib["argument"] = argument + param_type = TYPE_TO_GALAXY_TYPE[param.type] if param_type is None: raise ModelError("Unrecognized parameter type %(type)s for parameter %(name)s" % {"type": param.type, "name": param.name}) + # ITEMLIST is rendered as text field (even if its integers or floats), an - # exception is files which are treated a bit below + # exception is files which are treated just below if param.is_list: param_type = "text" - if is_selection_parameter(param): param_type = "select" - if len(param.restrictions.choices) < 5: - param_node.attrib["display"] = "checkboxes" - if param.is_list: - param_node.attrib["multiple"] = "true" - if is_boolean_parameter(param): param_type = "boolean" @@ -1207,10 +1203,20 @@ def create_param_attribute_list(param_node, param, model, supported_file_formats # (in Galaxy the default would be prefilled in the form and at least # one option needs to be selected). if not (param.default is None or type(param.default) is _Null) and param_node.attrib["type"] in ["integer", "float", "text", "boolean", "select"]: - logger.error("%s %s %s %s %s" % (param.name, param.default is None, type(param.default) is _Null, param_type, param.type)) - param_node.attrib["optional"] = "false" + # logger.error("%s %s %s %s %s" % (param.name, param.default is None, type(param.default) is _Null, param_type, param.type)) + optional = False else: - param_node.attrib["optional"] = str(not param.required).lower() + optional = not param.required + param_node.attrib["optional"] = str(optional).lower() + + if is_selection_parameter(param): + if param.is_list: + param_node.attrib["multiple"] = "true" + if len(param.restrictions.choices) < 5: + if param.is_list and optional: + param_node.attrib["display"] = "checkboxes" + elif not param.is_list and not optional: + param_node.attrib["display"] = "radio" # check for parameters with restricted values (which will correspond to a "select" in galaxy) if param.restrictions is not None or param_type == "boolean": @@ -1485,7 +1491,7 @@ def create_boolean_parameter(param_node, param): def all_outputs(model, parameter_hardcoder): """ - return lists of reqired and optional output parameters + return lists of required and optional output parameters """ out = [] optout = [] diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index a1c365e..fcdbb68 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -51,14 +51,14 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - +
- + diff --git a/tests/test-data/ofile-typeparam.xml b/tests/test-data/ofile-typeparam.xml index cd96e83..f419598 100644 --- a/tests/test-data/ofile-typeparam.xml +++ b/tests/test-data/ofile-typeparam.xml @@ -170,25 +170,25 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + @@ -198,49 +198,49 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + - + - + - + - + @@ -251,25 +251,25 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + diff --git a/tests/test-data/select_test.xml b/tests/test-data/select_test.xml index c1fe4ee..6f6baa7 100644 --- a/tests/test-data/select_test.xml +++ b/tests/test-data/select_test.xml @@ -32,28 +32,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + @@ -92,35 +92,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -128,7 +128,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -136,7 +136,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -144,7 +144,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -153,28 +153,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + @@ -213,35 +213,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -249,7 +249,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -257,7 +257,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -265,7 +265,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -273,28 +273,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + @@ -333,35 +333,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -369,7 +369,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -377,7 +377,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -385,7 +385,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -395,28 +395,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + @@ -455,35 +455,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -491,7 +491,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -499,7 +499,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -507,7 +507,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + From acdaa0122e42790dbe2dc29cd2aaf0db4876484f Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 30 Oct 2023 12:14:34 +0100 Subject: [PATCH 09/36] galaxy: add a mock count attribute to test/ouput_collection elements count is now required for planemo lint to pass --- ctdconverter/galaxy/converter.py | 3 ++- tests/test-data/ofile-mult-typeparam.xml | 4 ++-- tests/test-data/ofile-mult.xml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 055be42..e30023f 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1760,9 +1760,10 @@ def create_tests(parent, inputs=None, outputs=None, test_macros_prefix=None, nam node.attrib["value"] = "outfile.txt" if node.tag == "collection": node.tag = "output_collection" + node.attrib["count"] = "0" # add a mock count element if node.attrib.get("name", None) == "stdout": node.attrib["lines_diff"] = "2" - for a in set(node.attrib) - {"name", "value", "ftype", "lines_diff"}: + for a in set(node.attrib) - {"name", "value", "ftype", "lines_diff", "count"}: del node.attrib[a] strip_elements(outputs, "delete_node", "discover_datasets", "filter", "change_format") diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index fcdbb68..e44b0f2 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -93,8 +93,8 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - - + + - + Date: Mon, 30 Oct 2023 14:11:21 +0100 Subject: [PATCH 10/36] itry to run only on pull_request --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index ee0130b..ac32e90 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,6 +1,6 @@ name: Test Pull Request -on: [pull_request, push] +on: [pull_request] jobs: lint: From 41fe3062ff4917bd60c37e0b00e3b06af699c6fa Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 3 Mar 2022 15:56:26 +0100 Subject: [PATCH 11/36] add possibility to batch mode for multiple=true data parameters --- ctdconverter/galaxy/converter.py | 57 +++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index e30023f..ea14298 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -660,12 +660,21 @@ def create_command(tool, model, **kwargs): if param.type is _InFile: param_cmd['preprocessing'].append("mkdir %s &&" % actual_parameter) if param.is_list: - param_cmd['preprocessing'].append("mkdir ${' '.join([\"'" + actual_parameter + "/%s'\" % (i) for i, f in enumerate($" + _actual_parameter + ") if f])} && ") - param_cmd['preprocessing'].append("${' '.join([\"ln -s '%s' '" + actual_parameter + "/%s/%s.%s' && \" % (f, i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($" + _actual_parameter + ") if f])}") - param_cmd['command'].append("${' '.join([\"'" + actual_parameter + "/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($" + _actual_parameter + ") if f])}") + param_cmd['preprocessing'].append(f'#if ${_actual_parameter}_cond.{_actual_parameter}_select == "no"') + param_cmd['preprocessing'].append(f"mkdir ${{' '.join([\"'{actual_parameter}/%s'\" % (i) for i, f in enumerate(${_actual_parameter}_cond.{_actual_parameter}) if f])}} && ") + param_cmd['preprocessing'].append(f"${{' '.join([\"ln -s '%s' '{actual_parameter}/%s/%s.%s' && \" % (f, i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}_cond.{_actual_parameter}) if f])}}") + param_cmd['preprocessing'].append(f'#else') + param_cmd['preprocessing'].append(f"ln -s '${_actual_parameter}_cond.{_actual_parameter}' '{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}_cond.{_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}_cond.{_actual_parameter}.ext)' &&") + param_cmd['preprocessing'].append(f'#end if') + param_cmd['command'].append(f'#if ${actual_parameter}_cond.{actual_parameter}_select == "no"') + param_cmd['command'].append(f"${{' '.join([\"'{actual_parameter}/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}_cond.{_actual_parameter}) if f])}}") + param_cmd['command'].append(f'#else') + param_cmd['command'].append(f"'{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}_cond.{_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}_cond.{_actual_parameter}.ext)'") + param_cmd['command'].append(f'#end if') else: param_cmd['preprocessing'].append("ln -s '$" + _actual_parameter + "' '" + actual_parameter + "/${re.sub(\"[^\\w\\-_]\", \"_\", $" + _actual_parameter + ".element_identifier)}.$gxy2omsext($" + _actual_parameter + ".ext)' &&") param_cmd['command'].append("'" + actual_parameter + "/${re.sub(\"[^\\w\\-_]\", \"_\", $" + _actual_parameter + ".element_identifier)}.$gxy2omsext($" + _actual_parameter + ".ext)'") + elif param.type is _OutPrefix: param_cmd['preprocessing'].append("mkdir %s &&" % actual_parameter) param_cmd['command'].append(actual_parameter + "/") @@ -1047,13 +1056,8 @@ def create_inputs(tool, model, **kwargs): continue # create the actual param node and fill the attributes - param_node = add_child_node(parent_node, "param") - create_param_attribute_list(param_node, param, model, kwargs["supported_file_formats"]) - - hardcoded_attributes = parameter_hardcoder.get_hardcoded_attributes(param.name, model.name, 'XML') - if hardcoded_attributes is not None: - for a in hardcoded_attributes: - param_node.attrib[a] = str(hardcoded_attributes[a]) + param_node = create_param_attribute_list(param, model, kwargs["supported_file_formats"], parameter_hardcoder) + parent_node.append(param_node) section_parents = [utils.extract_param_name(section_params[sn].parent) for sn in section_nodes] for sn in section_nodes: @@ -1143,16 +1147,17 @@ def get_galaxy_formats(param, model, o2g, default=None): return sorted(gxy_formats) -def create_param_attribute_list(param_node, param, model, supported_file_formats): +def create_param_attribute_list(param, model, supported_file_formats, parameter_hardcoder): """ get the attributes of input parameters - @param param_node the galaxy tool param node + @param param the ctd parameter @param supported_file_formats """ g2o, o2g = get_fileformat_maps(supported_file_formats) + param_node = Element("param") # set the name, argument and a first guess for the type (which will be over written # in some cases .. see below) # even if the conversion relies on the fact that the param names are identical @@ -1361,6 +1366,34 @@ def create_param_attribute_list(param_node, param, model, supported_file_formats param_node.attrib["label"] = label param_node.attrib["help"] = help_text + hardcoded_attributes = parameter_hardcoder.get_hardcoded_attributes(param.name, model.name, 'XML') + if hardcoded_attributes is not None: + for a in hardcoded_attributes: + param_node.attrib[a] = str(hardcoded_attributes[a]) + + if param_node.attrib["type"] == "data" and param_node.attrib.get("multiple") == "true": + conditional_attrib = OrderedDict([ + ("name", get_galaxy_parameter_name(param)+"_cond") + ]) + conditional = Element("conditional", conditional_attrib) + + select_attrib = OrderedDict([ + ("name", get_galaxy_parameter_name(param)+"_select"), + ("type", "select"), + ("label", f"Run tool in batch mode for -{get_galaxy_parameter_name(param)}") + ]) + select = add_child_node(conditional, "param", select_attrib) + add_child_node(select, "option", attributes={"value": "no"}, text="No: process all datasets jointly") + add_child_node(select, "option", attributes={"value": "yes"}, text="Yes: process each dataset in an independent job") + + when_no = add_child_node(conditional, "when", attributes={"value": "no"}) + when_no.append(copy.deepcopy(param_node)) + when_yes = add_child_node(conditional, "when", attributes={"value": "yes"}) + param_node.attrib["multiple"] = "false" + when_yes.append(param_node) + return conditional + + return param_node def generate_label_and_help(desc): help_text = "" From 9fb88236c5d0563ef544f178a679eb2cc7c5acd6 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Fri, 4 Mar 2022 12:56:50 +0100 Subject: [PATCH 12/36] fixup: add possibility to batch mode for multiple=true data parameters --- ctdconverter/galaxy/converter.py | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index ea14298..052918d 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -660,16 +660,16 @@ def create_command(tool, model, **kwargs): if param.type is _InFile: param_cmd['preprocessing'].append("mkdir %s &&" % actual_parameter) if param.is_list: - param_cmd['preprocessing'].append(f'#if ${_actual_parameter}_cond.{_actual_parameter}_select == "no"') - param_cmd['preprocessing'].append(f"mkdir ${{' '.join([\"'{actual_parameter}/%s'\" % (i) for i, f in enumerate(${_actual_parameter}_cond.{_actual_parameter}) if f])}} && ") - param_cmd['preprocessing'].append(f"${{' '.join([\"ln -s '%s' '{actual_parameter}/%s/%s.%s' && \" % (f, i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}_cond.{_actual_parameter}) if f])}}") + param_cmd['preprocessing'].append(f'#if ${_actual_parameter}_select == "no"') + param_cmd['preprocessing'].append(f"mkdir ${{' '.join([\"'{actual_parameter}/%s'\" % (i) for i, f in enumerate(${_actual_parameter}) if f])}} && ") + param_cmd['preprocessing'].append(f"${{' '.join([\"ln -s '%s' '{actual_parameter}/%s/%s.%s' && \" % (f, i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}) if f])}}") param_cmd['preprocessing'].append(f'#else') - param_cmd['preprocessing'].append(f"ln -s '${_actual_parameter}_cond.{_actual_parameter}' '{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}_cond.{_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}_cond.{_actual_parameter}.ext)' &&") + param_cmd['preprocessing'].append(f"ln -s '${_actual_parameter}' '{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}.ext)' &&") param_cmd['preprocessing'].append(f'#end if') - param_cmd['command'].append(f'#if ${actual_parameter}_cond.{actual_parameter}_select == "no"') - param_cmd['command'].append(f"${{' '.join([\"'{actual_parameter}/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}_cond.{_actual_parameter}) if f])}}") + param_cmd['command'].append(f'#if ${actual_parameter}_select == "no"') + param_cmd['command'].append(f"${{' '.join([\"'{actual_parameter}/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}) if f])}}") param_cmd['command'].append(f'#else') - param_cmd['command'].append(f"'{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}_cond.{_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}_cond.{_actual_parameter}.ext)'") + param_cmd['command'].append(f"'{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}.ext)'") param_cmd['command'].append(f'#end if') else: param_cmd['preprocessing'].append("ln -s '$" + _actual_parameter + "' '" + actual_parameter + "/${re.sub(\"[^\\w\\-_]\", \"_\", $" + _actual_parameter + ".element_identifier)}.$gxy2omsext($" + _actual_parameter + ".ext)' &&") @@ -868,6 +868,10 @@ def get_galaxy_parameter_path(param, separator=".", suffix=None, fix_underscore= """ p = get_galaxy_parameter_name(param, suffix, fix_underscore) path = utils.extract_param_path(param, fix_underscore) + # data input params with multiple="true" are in a (batch mode) conditional + # which needs to be added to the param path list + if param.type is _InFile and param.is_list: + path.insert(len(path)-1, f"{p}_cond") if len(path) > 1: return (separator.join(path[:-1]) + separator + p).replace("-", "_") elif param.advanced and (param.type is not _OutFile or suffix): @@ -1044,15 +1048,19 @@ def create_inputs(tool, model, **kwargs): corresponding_input, fmt_from_corresponding = get_corresponding_input(param, model) if len(formats) > 1 and type_param is None and (corresponding_input is None or not fmt_from_corresponding): # and not param.is_list: - fmt_select = add_child_node(parent_node, "param", OrderedDict([("name", param.name + "_type"), ("type", "select"), ("optional", "false"), ("label", f"File type of output {param.name} ({param.description})")])) + fmt_select_attrib = OrderedDict([ + ("name", param.name + "_type"), + ("type", "select"), + ("optional", "false"), + ("label", f"File type of output {param.name} ({param.description})") + ]) + fmt_select = add_child_node(parent_node, "param", fmt_select_attrib) g2o, o2g = get_fileformat_maps(kwargs["supported_file_formats"]) -# for f in formats: -# option_node = add_child_node(fmt_select, "option", OrderedDict([("value", g2o[f])]), f) for choice in param.restrictions.formats: option_node = add_child_node(fmt_select, "option", OrderedDict([("value", str(choice))])) option_node.text = o2g[str(choice)] if choice.lower() != o2g[str(choice)]: - option_node.text += " (%s)" % choice + option_node.text += f" ({choice})" continue # create the actual param node and fill the attributes @@ -1114,9 +1122,7 @@ def get_formats(param, model, o2g): elif is_out_type_param(param, model): choices = param.restrictions.choices else: - raise InvalidModelException("Unrecognized restriction type [%(type)s] " - "for [%(name)s]" % {"type": type(param.restrictions), - "name": param.name}) + raise InvalidModelException(f"Unrecognized restriction type [{type(param.restrictions)}] for [{name}]") # check if there are formats that have not been registered yet... formats = set() @@ -1229,12 +1235,6 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ if param_type == "boolean": create_boolean_parameter(param_node, param) elif type(param.restrictions) is _Choices: - - # TODO if the parameter is used to select the output file type the - # options need to be replaced with the Galaxy data types - # if is_out_type_param(param, model): - # param.restrictions.choices = get_supported_file_types(param.restrictions.choices, supported_file_formats) - # create as many
- +
- - +
- - - +
- +
@@ -117,8 +117,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - +
- +
- - +
- +
@@ -117,8 +117,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - +
- - - +
+
- - - +
diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index c894a02..513188a 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -90,8 +90,7 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s.
- - + diff --git a/tests/test-data/ofile-mult.xml b/tests/test-data/ofile-mult.xml index 3790084..15c52e5 100644 --- a/tests/test-data/ofile-mult.xml +++ b/tests/test-data/ofile-mult.xml @@ -84,9 +84,8 @@ ${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandato - - - +
+
diff --git a/tests/test-data/ofile-typeparam.xml b/tests/test-data/ofile-typeparam.xml index 0c1dff2..79a2856 100644 --- a/tests/test-data/ofile-typeparam.xml +++ b/tests/test-data/ofile-typeparam.xml @@ -84,10 +84,10 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard 'optional_noformat_adv/output.${gxy2omsext("txt")}' #end if -mandatory_multformat_adv -'mandatory_multformat_adv/output.${adv_opts_cond.mandatory_multformat_adv_type}' +'mandatory_multformat_adv/output.${adv_opts.mandatory_multformat_adv_type}' #if "optional_multformat_adv_FLAG" in str($OPTIONAL_OUTPUTS).split(',') -optional_multformat_adv - 'optional_multformat_adv/output.${adv_opts_cond.optional_multformat_adv_type}' + 'optional_multformat_adv/output.${adv_opts.optional_multformat_adv_type}' #end if -decoy_input_noformat 'decoy_input_noformat/${re.sub("[^\w\-_]", "_", $decoy_input_noformat.element_identifier)}.$gxy2omsext($decoy_input_noformat.ext)' @@ -142,9 +142,9 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard #if "optional_noformat_adv_FLAG" in str($OPTIONAL_OUTPUTS).split(',') && mv 'optional_noformat_adv/output.${gxy2omsext("txt")}' '$optional_noformat_adv' #end if -&& mv 'mandatory_multformat_adv/output.${adv_opts_cond.mandatory_multformat_adv_type}' '$mandatory_multformat_adv' +&& mv 'mandatory_multformat_adv/output.${adv_opts.mandatory_multformat_adv_type}' '$mandatory_multformat_adv' #if "optional_multformat_adv_FLAG" in str($OPTIONAL_OUTPUTS).split(',') - && mv 'optional_multformat_adv/output.${adv_opts_cond.optional_multformat_adv_type}' '$optional_multformat_adv' + && mv 'optional_multformat_adv/output.${adv_opts.optional_multformat_adv_type}' '$optional_multformat_adv' #end if && mv 'test_section_sect_mandatory_noformat/output.${gxy2omsext("txt")}' '$test_section_sect_mandatory_noformat' #if "sect_optional_noformat_FLAG" in str($OPTIONAL_OUTPUTS).split(',') @@ -312,14 +312,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - + + - - + + OPTIONAL_OUTPUTS is not None and "optional_multformat_adv_FLAG" in OPTIONAL_OUTPUTS @@ -383,13 +383,12 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - +
- - +
diff --git a/tests/test-data/ofile.xml b/tests/test-data/ofile.xml index ccb5571..6796f70 100644 --- a/tests/test-data/ofile.xml +++ b/tests/test-data/ofile.xml @@ -100,10 +100,10 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard 'optional_oneformat_adv/output.${gxy2omsext("tsv")}' #end if -mandatory_multformat_adv -'mandatory_multformat_adv/output.${adv_opts_cond.mandatory_multformat_adv_type}' +'mandatory_multformat_adv/output.${adv_opts.mandatory_multformat_adv_type}' #if "optional_multformat_adv_FLAG" in str($OPTIONAL_OUTPUTS).split(',') -optional_multformat_adv - 'optional_multformat_adv/output.${adv_opts_cond.optional_multformat_adv_type}' + 'optional_multformat_adv/output.${adv_opts.optional_multformat_adv_type}' #end if -test_section:sect_mandatory_noformat 'test_section_sect_mandatory_noformat/output.${gxy2omsext("txt")}' @@ -166,9 +166,9 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard #if "optional_oneformat_adv_FLAG" in str($OPTIONAL_OUTPUTS).split(',') && mv 'optional_oneformat_adv/output.${gxy2omsext("tsv")}' '$optional_oneformat_adv' #end if -&& mv 'mandatory_multformat_adv/output.${adv_opts_cond.mandatory_multformat_adv_type}' '$mandatory_multformat_adv' +&& mv 'mandatory_multformat_adv/output.${adv_opts.mandatory_multformat_adv_type}' '$mandatory_multformat_adv' #if "optional_multformat_adv_FLAG" in str($OPTIONAL_OUTPUTS).split(',') - && mv 'optional_multformat_adv/output.${adv_opts_cond.optional_multformat_adv_type}' '$optional_multformat_adv' + && mv 'optional_multformat_adv/output.${adv_opts.optional_multformat_adv_type}' '$optional_multformat_adv' #end if && mv 'test_section_sect_mandatory_noformat/output.${gxy2omsext("txt")}' '$test_section_sect_mandatory_noformat' #if "sect_optional_noformat_FLAG" in str($OPTIONAL_OUTPUTS).split(',') @@ -294,14 +294,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - + + - - + + OPTIONAL_OUTPUTS is not None and "optional_multformat_adv_FLAG" in OPTIONAL_OUTPUTS @@ -361,11 +361,10 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - +
- - +
diff --git a/tests/test-data/repeat_test.xml b/tests/test-data/repeat_test.xml index a6fd49e..2f0f39a 100644 --- a/tests/test-data/repeat_test.xml +++ b/tests/test-data/repeat_test.xml @@ -449,7 +449,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - +
@@ -465,8 +465,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - +
- +
- - +
- +
- - +
Date: Tue, 8 Nov 2022 16:05:32 +0100 Subject: [PATCH 20/36] ignore duplicate options for selects --- ctdconverter/galaxy/converter.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 2e5ef3b..db60821 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -454,13 +454,10 @@ def _convert_internal(parsed_ctds, **kwargs): # overwrite attributes of the parsed ctd parameters as specified in hardcoded parameters json for param in utils.extract_and_flatten_parameters(model): hardcoded_attributes = parameter_hardcoder.get_hardcoded_attributes(utils.extract_param_name(param), model.name, 'CTD') - logger.error(f"hardcoded_attributes {hardcoded_attributes}") if hardcoded_attributes is not None: for a in hardcoded_attributes: if not hasattr(param, a): - logger.error(f"no attr {a} {dir(param)}") continue - logger.error(f"HERE") if a == "type": try: t = GALAXY_TYPE_TO_TYPE[hardcoded_attributes[a]] @@ -481,7 +478,6 @@ def _convert_internal(parsed_ctds, **kwargs): else: setattr(param, a, hardcoded_attributes[a]) else: - logger.error(f"set a {a}") setattr(param, a, hardcoded_attributes[a]) if "test_only" in kwargs and kwargs["test_only"]: @@ -900,7 +896,7 @@ def get_galaxy_parameter_path(param, separator=".", suffix=None, fix_underscore= if len(path) > 1: path = path[:-1] + [p] elif param.advanced and (param.type is not _OutFile or suffix): - return ADVANCED_OPTIONS_NAME + p + path = [ADVANCED_OPTIONS_NAME, p] else: path = [p] # data input params with multiple="true" are in a (batch mode) conditional @@ -1288,7 +1284,13 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ if is_default(fmt, param): option_node.attrib["selected"] = "true" else: + unique_choices = set() for choice in param.restrictions.choices: + if str(choice) in unique_choices: + logger.warning(f"Option {choice} of {utils.extract_param_name(param)} is not unique.") + continue + else: + unique_choices.add(str(choice)) option_node = add_child_node(param_node, "option", OrderedDict([("value", str(choice))]), text=str(choice)) From d11eb1cc00ec8cf62df2b3182190b31e776dea88 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 24 Nov 2022 16:22:12 +0100 Subject: [PATCH 21/36] fix test type parameters --- ctdconverter/galaxy/converter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index db60821..daf92c1 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1884,6 +1884,10 @@ def create_test_only(model, **kwargs): if param.name != "test": continue + # analogous to input generation + if is_in_type_param(param, model): + continue + if utils.extract_param_name(param.parent) in section_nodes: parent = section_nodes[utils.extract_param_name(param.parent)] elif type(param) is not ParameterGroup and param.advanced: From 8a47310913f7b351c01316f2486afd8b1a443054 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 21 Dec 2022 16:51:19 +0100 Subject: [PATCH 22/36] only use 1st line of description for Galaxy tool description see https://github.com/OpenMS/OpenMS/issues/6568 --- ctdconverter/galaxy/converter.py | 6 +++++- tests/test-data/bool.ctd | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index daf92c1..9ef418f 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -561,7 +561,11 @@ def create_description(tool, model): """ if "description" in model.opt_attribs.keys() and model.opt_attribs["description"] is not None: description = SubElement(tool, "description") - description.text = model.opt_attribs["description"] + text = model.opt_attribs["description"] + text = text.split("\n")[0].strip() + if text[-1] == ".": + text = text[:-1] + description.text = text def create_configfiles(tool, model, **kwargs): diff --git a/tests/test-data/bool.ctd b/tests/test-data/bool.ctd index dd43f2c..e91655e 100644 --- a/tests/test-data/bool.ctd +++ b/tests/test-data/bool.ctd @@ -1,6 +1,9 @@ - + From f4a9739fa434b86ea37d6a641ec22b1c17e52ee7 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sat, 28 Oct 2023 13:50:05 +0200 Subject: [PATCH 23/36] only flatten lists and input needs no default --- ctdconverter/common/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctdconverter/common/utils.py b/ctdconverter/common/utils.py index 7bddc81..f25fed5 100644 --- a/ctdconverter/common/utils.py +++ b/ctdconverter/common/utils.py @@ -184,7 +184,7 @@ def parse_input_ctds(xsd_location, input_ctds, output_destination, output_file_e def flatten_list_of_lists(args, list_name): - setattr(args, list_name, [item for sub_list in getattr(args, list_name) for item in sub_list]) + setattr(args, list_name, [item for sub_list in getattr(args, list_name) for item in sub_list if isinstance(sub_list, list)]) def validate_against_schema(ctd_file, schema): @@ -197,7 +197,7 @@ def validate_against_schema(ctd_file, schema): def add_common_parameters(parser, version, last_updated): parser.add_argument("FORMAT", default=None, help="Output format (mandatory). Can be one of: cwl, galaxy.") - parser.add_argument("-i", "--input", dest="input_files", default=[], required=True, nargs="+", action="append", + parser.add_argument("-i", "--input", dest="input_files", required=True, nargs="+", action="append", help="List of CTD files to convert.") parser.add_argument("-o", "--output-destination", dest="output_destination", required=True, help="If multiple input files are given, then a folder in which all converted " From 9bd35728a8d583e402b7cab58fb7816a37ccf091 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 10:32:47 +0100 Subject: [PATCH 24/36] only flatten lists and make code a bit more readable (hopefully) --- ctdconverter/common/utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ctdconverter/common/utils.py b/ctdconverter/common/utils.py index f25fed5..c002c2c 100644 --- a/ctdconverter/common/utils.py +++ b/ctdconverter/common/utils.py @@ -184,7 +184,14 @@ def parse_input_ctds(xsd_location, input_ctds, output_destination, output_file_e def flatten_list_of_lists(args, list_name): - setattr(args, list_name, [item for sub_list in getattr(args, list_name) for item in sub_list if isinstance(sub_list, list)]) + lst = getattr(args, list_name) + ret = [] + for l in lst: + if isinstance(l, list): + ret.extend(l) + else: + ret.append(l) + setattr(args, list_name, ret) def validate_against_schema(ctd_file, schema): From 472046ff6b32f33008fb9e1951795c5e398930db Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 11:03:54 +0100 Subject: [PATCH 25/36] use logging from stdlib --- ctdconverter/common/logger.py | 22 ----------- ctdconverter/common/utils.py | 18 ++++----- ctdconverter/convert.py | 19 ++++----- ctdconverter/cwl/converter.py | 11 ++---- ctdconverter/galaxy/converter.py | 68 ++++++++++++++++---------------- 5 files changed, 57 insertions(+), 81 deletions(-) delete mode 100644 ctdconverter/common/logger.py diff --git a/ctdconverter/common/logger.py b/ctdconverter/common/logger.py deleted file mode 100644 index d1573c3..0000000 --- a/ctdconverter/common/logger.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import sys - -MESSAGE_INDENTATION_INCREMENT = 2 - - -def _get_indented_text(text, indentation_level): - return ("%(indentation)s%(text)s" % - {"indentation": " " * (MESSAGE_INDENTATION_INCREMENT * indentation_level), - "text": text}) - - -def warning(warning_text, indentation_level=0): - sys.stdout.write(_get_indented_text("WARNING: %s\n" % warning_text, indentation_level)) - - -def error(error_text, indentation_level=0): - sys.stderr.write(_get_indented_text("ERROR: %s\n" % error_text, indentation_level)) - - -def info(info_text, indentation_level=0): - sys.stdout.write(_get_indented_text("INFO: %s\n" % info_text, indentation_level)) diff --git a/ctdconverter/common/utils.py b/ctdconverter/common/utils.py index c002c2c..015635a 100644 --- a/ctdconverter/common/utils.py +++ b/ctdconverter/common/utils.py @@ -1,5 +1,6 @@ #!/usr/bin/env python import json +import logging import ntpath import operator import os @@ -16,7 +17,6 @@ ) from lxml import etree -from ..common import logger from ..common.exceptions import ApplicationException @@ -109,7 +109,7 @@ def validate_path_exists(path): def validate_argument_is_directory(args, argument_name): file_name = getattr(args, argument_name) - logger.info("REALPATH %s" % os.path.realpath(file_name)) + logging.info("REALPATH %s" % os.path.realpath(file_name)) if file_name is not None and os.path.isdir(os.path.realpath(file_name)): raise ApplicationException("The provided output file name (%s) points to a directory." % file_name) @@ -150,12 +150,12 @@ def parse_input_ctds(xsd_location, input_ctds, output_destination, output_file_e schema = None if xsd_location is not None: try: - logger.info("Loading validation schema from %s" % xsd_location, 0) + logging.info("Loading validation schema from %s" % xsd_location) schema = etree.XMLSchema(etree.parse(xsd_location)) except Exception as e: - logger.error("Could not load validation schema {}. Reason: {}".format(xsd_location, str(e)), 0) + logging.error("Could not load validation schema {}. Reason: {}".format(xsd_location, str(e))) else: - logger.warning("Validation against a schema has not been enabled.", 0) + logging.warning("Validation against a schema has not been enabled.") for input_ctd in input_ctds: if schema is not None: @@ -165,7 +165,7 @@ def parse_input_ctds(xsd_location, input_ctds, output_destination, output_file_e # if multiple inputs are being converted, we need to generate a different output_file for each input if is_converting_multiple_ctds: output_file = os.path.join(output_file, get_filename_without_suffix(input_ctd) + "." + output_file_extension) - logger.info("Parsing %s" % input_ctd) + logging.info("Parsing %s" % input_ctd) model = None try: @@ -386,8 +386,8 @@ def resolve_param_mapping(param, ctd_model, fix_underscore=False): for mapping_element in cli_element.mappings: if mapping_element.reference_name == param.name: if param_mapping is not None: - logger.warning("The parameter %s has more than one mapping in the section. " - "The first found mapping, %s, will be used." % (param.name, param_mapping), 1) + logging.warning("The parameter %s has more than one mapping in the section. " + "The first found mapping, %s, will be used." % (param.name, param_mapping)) else: param_mapping = cli_element.option_identifier if param_mapping is not None: @@ -404,7 +404,7 @@ def _extract_param_cli_name(param, ctd_model, fix_underscore=False): # we generate parameters with colons for subgroups, but not for the two topmost parents (OpenMS legacy) if type(param.parent) == ParameterGroup: if hasattr(ctd_model, "cli") and ctd_model.cli: - logger.warning("Using nested parameter sections (NODE elements) is not compatible with ", 1) + logging.warning("Using nested parameter sections (NODE elements) is not compatible with ") return ":".join(extract_param_path(param, fix_underscore)[:-1]) + ":" + resolve_param_mapping(param, ctd_model, fix_underscore) else: return resolve_param_mapping(param, ctd_model, fix_underscore) diff --git a/ctdconverter/convert.py b/ctdconverter/convert.py index 935639b..c647adc 100644 --- a/ctdconverter/convert.py +++ b/ctdconverter/convert.py @@ -1,3 +1,4 @@ +import logging import os import sys import traceback @@ -75,7 +76,7 @@ def main(argv=None): # at this point we cannot parse the arguments, because each converter takes different arguments, meaning each # converter will register its own parameters after we've registered the basic ones... we have to do it old school if len(argv) < 2: - utils.logger.error("Not enough arguments provided") + logging.error("Not enough arguments provided") print("\nUsage: $ CTDConverter [TARGET] [ARGUMENTS]\n\n" "Where:\n" " target: one of 'cwl' or 'galaxy'\n\n" @@ -94,10 +95,10 @@ def main(argv=None): # print(program_license) # return 0 else: - utils.logger.error("Unrecognized target engine. Supported targets are 'cwl' and 'galaxy'.") + logging.error("Unrecognized target engine. Supported targets are 'cwl' and 'galaxy'.") return 1 - utils.logger.info("Using %s converter" % target) + logging.info("Using %s converter" % target) try: # Setup argument parser @@ -126,20 +127,20 @@ def main(argv=None): except ApplicationException as e: traceback.print_exc() - utils.logger.error("CTDConverter could not complete the requested operation.", 0) - utils.logger.error("Reason: " + e.msg, 0) + logging.error("CTDConverter could not complete the requested operation.") + logging.error("Reason: " + e.msg) return 1 except ModelError as e: traceback.print_exc() - utils.logger.error("There seems to be a problem with one of your input CTDs.", 0) - utils.logger.error("Reason: " + e.msg, 0) + logging.error("There seems to be a problem with one of your input CTDs.") + logging.error("Reason: " + e.msg) return 1 except Exception as e: traceback.print_exc() - utils.logger.error("CTDConverter could not complete the requested operation.", 0) - utils.logger.error("Reason: " + e.msg, 0) + logging.error("CTDConverter could not complete the requested operation.") + logging.error("Reason: " + e.msg) return 2 diff --git a/ctdconverter/cwl/converter.py b/ctdconverter/cwl/converter.py index eaa55ce..595d97a 100755 --- a/ctdconverter/cwl/converter.py +++ b/ctdconverter/cwl/converter.py @@ -7,7 +7,7 @@ # which kind of sucks, because this seems to be the way to state that a parameter is truly optional and has no default # since cwlgen is just "fancy classes" around the yaml.dump() method, we implemented our own generation of yaml - +import logging import ruamel.yaml as yaml from CTDopts.CTDopts import ( _Choices, @@ -17,10 +17,7 @@ ) from .. import __version__ as version -from ..common import ( - logger, - utils -) +from ..common import utils # all cwl-related properties are defined here @@ -75,10 +72,10 @@ def convert_models(args, parsed_ctds): origin_file = parsed_ctd.input_file output_file = parsed_ctd.suggested_output_file - logger.info("Converting {} (source {})".format(model.name, utils.get_filename(origin_file))) + logging.info("Converting {} (source {})".format(model.name, utils.get_filename(origin_file))) cwl_tool = convert_to_cwl(model, args) - logger.info("Writing to %s" % utils.get_filename(output_file), 1) + logging.info("Writing to %s" % utils.get_filename(output_file)) stream = open(output_file, 'w') stream.write(CWL_SHEBANG + '\n\n') diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 9ef418f..479fc3b 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import copy import json +import logging import os import os.path import re @@ -30,7 +31,6 @@ ) from ..common import ( - logger, utils ) from ..common.exceptions import ( @@ -138,7 +138,7 @@ def modify_param_for_galaxy(param): # need to be taken care by hardcoded values and the other cases # are chosen automatically if not specified on the command line) if param.required and not (param.default is None or type(param.default) is _Null): - logger.warning(f"Data parameter {param.name} with default ({param.default})", 1) + logging.warning(f"Data parameter {param.name} with default ({param.default})") param.required = False param.default = _Null() return param @@ -224,15 +224,15 @@ def parse_macros_files(macros_file_names, tool_version, supported_file_types, re for macros_file_name in macros_file_names: try: macros_file = open(macros_file_name) - logger.info("Loading macros from %s" % macros_file_name, 0) + logging.info("Loading macros from %s" % macros_file_name) root = parse(macros_file).getroot() for xml_element in root.findall("xml"): name = xml_element.attrib["name"] if name in macros_to_expand: - logger.warning("Macro %s has already been found. Duplicate found in file %s." % - (name, macros_file_name), 0) + logging.warning("Macro %s has already been found. Duplicate found in file %s." % + (name, macros_file_name)) continue - logger.info("Macro %s found" % name, 1) + logging.info("Macro %s found" % name) macros_to_expand.append(name) except ParseError as e: raise ApplicationException("The macros file " + macros_file_name + " could not be parsed. Cause: " + str(e)) @@ -318,7 +318,7 @@ def check_test_macros(test_macros_files, test_macros_prefix, parsed_ctds): for xml_element in root.findall("xml"): name = xml_element.attrib["name"] if not name.startswith(mp): - logger.warning("Testmacro with invalid prefix %s." % (mp), 0) + logging.warning("Testmacro with invalid prefix %s." % (mp)) continue name = name[len(mp):] macro_ids.add(name) @@ -328,11 +328,11 @@ def check_test_macros(test_macros_files, test_macros_prefix, parsed_ctds): except OSError as e: raise ApplicationException("The macros file " + mf + " could not be opened. Cause: " + str(e)) for t in tool_ids - macro_ids: - logger.error("missing %s" % t) + logging.error("missing %s" % t) add_child_node(root, "xml", OrderedDict([("name", mp + t)])) if len(macro_ids - tool_ids): - logger.warning("Unnecessary macros in {}: {}".format(mf, macro_ids - tool_ids)) + logging.warning("Unnecessary macros in {}: {}".format(mf, macro_ids - tool_ids)) tree = ElementTree(root) tree.write(mf, encoding="UTF-8", xml_declaration=True, pretty_print=True) @@ -363,7 +363,7 @@ def parse_file_formats(formats_file): parsed_formats[1], composite)) else: - logger.warning("Invalid line at line number %d of the given formats file. Line will be ignored:\n%s" % (line_number, line), 0) + logging.warning("Invalid line at line number %d of the given formats file. Line will be ignored:\n%s" % (line_number, line)) return supported_formats @@ -413,7 +413,7 @@ def validate_and_prepare_args(args, model): if not args.macros_files: # list is empty, provide the default value - logger.warning("Using default macros from galaxy/macros.xml", 0) + logging.warning("Using default macros from galaxy/macros.xml") args.macros_files = [os.path.dirname(os.path.abspath(__file__)) + "/macros.xml"] if args.tool_version is None: @@ -442,10 +442,10 @@ def _convert_internal(parsed_ctds, **kwargs): model = parsed_ctd.ctd_model if kwargs["skip_tools"] is not None and model.name in kwargs["skip_tools"]: - logger.info("Skipping tool %s" % model.name, 0) + logging.info("Skipping tool %s" % model.name) continue elif kwargs["required_tools"] is not None and model.name not in kwargs["required_tools"]: - logger.info("Tool %s is not required, skipping it" % model.name, 0) + logging.info("Tool %s is not required, skipping it" % model.name) continue origin_file = parsed_ctd.input_file @@ -462,7 +462,7 @@ def _convert_internal(parsed_ctds, **kwargs): try: t = GALAXY_TYPE_TO_TYPE[hardcoded_attributes[a]] except KeyError: - logger.error("Could not set hardcoded attribute {}={} for {}".format(a, hardcoded_attributes[a], param.name)) + logging.error("Could not set hardcoded attribute {}={} for {}".format(a, hardcoded_attributes[a], param.name)) sys.exit(1) setattr(param, a, t) elif a == "restrictions": @@ -484,11 +484,11 @@ def _convert_internal(parsed_ctds, **kwargs): test = create_test_only(parsed_ctd.ctd_model, **kwargs) tree = ElementTree(test) output_file = parsed_ctd.suggested_output_file - logger.info("Writing to %s" % utils.get_filename(output_file), 1) + logging.info("Writing to %s" % utils.get_filename(output_file)) tree.write(output_file, encoding="UTF-8", xml_declaration=False, pretty_print=True) continue - logger.info("Converting {} (source {})".format(model.name, utils.get_filename(origin_file)), 0) + logging.info("Converting {} (source {})".format(model.name, utils.get_filename(origin_file))) tool = create_tool(model, kwargs.get("tool_profile", None), kwargs.get("bump", None)) @@ -512,7 +512,7 @@ def _convert_internal(parsed_ctds, **kwargs): # wrap our tool element into a tree to be able to serialize it tree = ElementTree(tool) - logger.info("Writing to %s" % utils.get_filename(output_file), 1) + logging.info("Writing to %s" % utils.get_filename(output_file)) tree.write(output_file, encoding="UTF-8", xml_declaration=True, pretty_print=True) @@ -726,12 +726,12 @@ def create_command(tool, model, **kwargs): if len(formats) == 1: fmt = formats.pop() if param.is_list: - logger.info(f"1 fmt + list {param.name} -> {actual_input_parameter}", 1) + logging.info(f"1 fmt + list {param.name} -> {actual_input_parameter}") param_cmd['preprocessing'].append("mkdir ${' '.join([\"'" + actual_parameter + "/%s'\" % (i) for i, f in enumerate($" + actual_input_parameter + ") if f])} && ") param_cmd['command'].append("${' '.join([\"'" + actual_parameter + "/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(\"" + fmt + "\")) for i, f in enumerate($" + actual_input_parameter + ") if f])}") param_cmd['postprocessing'].append("${' '.join([\"&& mv -n '" + actual_parameter + "/%(bn)s/%(id)s.%(gext)s' '" + _actual_parameter + "/%(bn)s/%(id)s'\"%{\"bn\": i, \"id\": re.sub('[^\\w\\-_]', '_', f.element_identifier), \"gext\": $gxy2omsext(\"" + fmt + "\")} for i, f in enumerate($" + actual_input_parameter + ") if f])}") else: - logger.info("1 fmt + dataset %s" % param.name, 1) + logging.info("1 fmt + dataset %s" % param.name) param_cmd['command'].append("'" + actual_parameter + "/output.${gxy2omsext(\"" + fmt + "\")}'") param_cmd['postprocessing'].append("&& mv '" + actual_parameter + "/output.${gxy2omsext(\"" + fmt + "\")}' '$" + _actual_parameter + "'") @@ -740,12 +740,12 @@ def create_command(tool, model, **kwargs): # - list: let the command create output files with the oms extensions, postprocessing renames them to the galaxy extensions, output is then discover + __name_and_ext__ elif type_param_name is not None: if param.is_list: - logger.info("type + list %s" % param.name, 1) + logging.info("type + list %s" % param.name) param_cmd['preprocessing'].append("mkdir ${' '.join([\"'" + actual_parameter + "/%s'\" % (i) for i, f in enumerate($" + actual_input_parameter + ") if f])} && ") param_cmd['command'].append("${' '.join([\"'" + actual_parameter + "/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $" + type_param_name + ") for i, f in enumerate($" + actual_input_parameter + ") if f])}") param_cmd['postprocessing'].append("${' '.join([\"&& mv -n '" + actual_parameter + "/%(bn)s/%(id)s.%(omsext)s' '" + actual_parameter + "/%(bn)s/%(id)s.%(gext)s'\"%{\"bn\": i, \"id\": re.sub('[^\\w\\-_]', '_', f.element_identifier), \"omsext\":$" + type_param_name + ", \"gext\": $oms2gxyext(str($" + type_param_name + "))} for i, f in enumerate($" + actual_input_parameter + ") if f])}") else: - logger.info("type + dataset %s" % param.name, 1) + logging.info("type + dataset %s" % param.name) # 1st create file with openms extension (often required by openms) # then move it to the actual place specified by the parameter # the format is then set by the tag using @@ -753,11 +753,11 @@ def create_command(tool, model, **kwargs): param_cmd['postprocessing'].append("&& mv '" + actual_parameter + "/output.${" + type_param_name + "}' '$" + actual_parameter + "'") elif actual_input_parameter is not None: if param.is_list: - logger.info("actual + list %s" % param.name, 1) + logging.info("actual + list %s" % param.name) param_cmd['preprocessing'].append("mkdir ${' '.join([\"'" + actual_parameter + "/%s'\" % (i) for i, f in enumerate($" + actual_input_parameter + ") if f])} && ") param_cmd['command'].append("${' '.join([\"'" + actual_parameter + "/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), f.ext) for i, f in enumerate($" + actual_input_parameter + ") if f])}") else: - logger.info(f"actual + dataset {param.name} {actual_input_parameter} {corresponding_input.is_list}", 1) + logging.info(f"actual + dataset {param.name} {actual_input_parameter} {corresponding_input.is_list}") if corresponding_input.is_list: param_cmd['command'].append("'" + actual_parameter + "/output.${" + actual_input_parameter + "[0].ext}'") param_cmd['postprocessing'].append("&& mv '" + actual_parameter + "/output.${" + actual_input_parameter + "[0].ext}' '$" + _actual_parameter + "'") @@ -768,7 +768,7 @@ def create_command(tool, model, **kwargs): if param.is_list: raise Exception("output parameter itemlist %s without corresponding input") else: - logger.info("else + dataset %s" % param.name, 1) + logging.info("else + dataset %s" % param.name) param_cmd['command'].append("'$" + _actual_parameter + "'") # # select with multiple = true @@ -1004,7 +1004,7 @@ def get_input_with_same_restrictions(out_param, model, check_formats): for param in utils.extract_and_flatten_parameters(model): if param.type is not _InFile: continue -# logger.error("%s %s %s %s %s %s" %(out_param.name, param.name, param.is_list, out_param.is_list, param.restrictions, out_param.restrictions)) +# logging.error("%s %s %s %s %s %s" %(out_param.name, param.name, param.is_list, out_param.is_list, param.restrictions, out_param.restrictions)) if allow_different_type or param.is_list == out_param.is_list: if check_formats: if param.restrictions is None and out_param.restrictions is None: @@ -1013,7 +1013,7 @@ def get_input_with_same_restrictions(out_param, model, check_formats): matching.append(param) else: matching.append(param) -# logger.error("match %s "%([_.name for _ in matching])) +# logging.error("match %s "%([_.name for _ in matching])) if len(matching) > 0: break if len(matching) == 1: @@ -1158,7 +1158,7 @@ def get_formats(param, model, o2g): formats = set() for format_name in choices: if format_name not in o2g: - logger.warning(f"Ignoring unknown format {format_name} for parameter {param.name}", 1) + logging.warning(f"Ignoring unknown format {format_name} for parameter {param.name}") else: formats.add(format_name) return sorted(formats) @@ -1291,7 +1291,7 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ unique_choices = set() for choice in param.restrictions.choices: if str(choice) in unique_choices: - logger.warning(f"Option {choice} of {utils.extract_param_name(param)} is not unique.") + logging.warning(f"Option {choice} of {utils.extract_param_name(param)} is not unique.") continue else: unique_choices.add(str(choice)) @@ -1670,9 +1670,9 @@ def create_output_node(parent, param, model, supported_file_formats, parameter_h type_param_name = None # if there is only a single possible output format we set this -# logger.error("%s %s %s %s %s" %(param.name, formats, type_param, fmt_from_corresponding, corresponding_input)) +# logging.error("%s %s %s %s %s" %(param.name, formats, type_param, fmt_from_corresponding, corresponding_input)) if len(formats) == 1: - logger.info(f"OUTPUT {param.name} 1 fmt {formats}", 1) + logging.info(f"OUTPUT {param.name} 1 fmt {formats}") discover_node.attrib["format"] = formats.pop() if param.is_list: discover_node.attrib["pattern"] = "__name__" @@ -1682,7 +1682,7 @@ def create_output_node(parent, param, model, supported_file_formats, parameter_h # if there is another parameter where the user selects the format # then this format was added as file extension on the CLI, now we can discover this elif type_param_name is not None: - logger.info("OUTPUT %s type" % param.name, 1) + logging.info("OUTPUT %s type" % param.name) if not param.is_list: if len(type_param_choices) > 1: change_node = add_child_node(data_node, "change_format") @@ -1698,7 +1698,7 @@ def create_output_node(parent, param, model, supported_file_formats, parameter_h else: discover_node.attrib["pattern"] = "__name_and_ext__" elif corresponding_input is not None: - logger.info(f"OUTPUT {param.name} input {corresponding_input.name}", 1) + logging.info(f"OUTPUT {param.name} input {corresponding_input.name}") if param.is_list: discover_node.attrib["pattern"] = "__name_and_ext__" # data_node.attrib["structured_like"] = get_galaxy_parameter_name(corresponding_input) @@ -1708,7 +1708,7 @@ def create_output_node(parent, param, model, supported_file_formats, parameter_h data_node.attrib["format_source"] = get_galaxy_parameter_name(corresponding_input) data_node.attrib["metadata_source"] = get_galaxy_parameter_name(corresponding_input) else: - logger.info("OUTPUT %s else" % (param.name), 1) + logging.info("OUTPUT %s else" % (param.name)) if not param.is_list: data_node.attrib["auto_format"] = "true" else: @@ -1973,7 +1973,7 @@ def create_test_only(model, **kwargs): # - special care for outfile lists (ie collections): since we do not know (easily) the names of the collection elements we just use the count # exception of list parameters that are hardcoded to non-lists (the the default is still a list) if not param.is_list and type(param.default) is list: - logger.info("Found non-list parameter %s with list default (hardcoded?). Using only first value/" % param.name, 0) + logging.info("Found non-list parameter %s with list default (hardcoded?). Using only first value/" % param.name) try: param.default = param.default[0] except KeyError: From 6a422b88e3e60191ab93d37a5691d49ab9cd12b3 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 11:10:29 +0100 Subject: [PATCH 26/36] remove some unused cli arguments for the Galaxy converter --- ctdconverter/galaxy/converter.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 479fc3b..e039aa3 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -76,18 +76,6 @@ def add_specific_args(parser): "brief example on the layout of this file.", default=None, required=False) parser.add_argument("-a", "--add-to-command-line", dest="add_to_command_line", help="Adds content to the command line", default="", required=False) - parser.add_argument("-d", "--datatypes-destination", dest="data_types_destination", - help="Specify the location of a datatypes_conf.xml to modify and add the registered " - "data types. If the provided destination does not exist, a new file will be created.", - default=None, required=False) - parser.add_argument("-c", "--default-category", dest="default_category", default="DEFAULT", required=False, - help="Default category to use for tools lacking a category when generating tool_conf.xml") - parser.add_argument("-t", "--tool-conf-destination", dest="tool_conf_destination", default=None, required=False, - help="Specify the location of an existing tool_conf.xml that will be modified to include " - "the converted tools. If the provided destination does not exist, a new file will" - "be created.") - parser.add_argument("-g", "--galaxy-tool-path", dest="galaxy_tool_path", default=None, required=False, - help="The path that will be prepended to the file names when generating tool_conf.xml") parser.add_argument("-r", "--required-tools", dest="required_tools_file", default=None, required=False, help="Each line of the file will be interpreted as a tool name that needs translation. " "Run with '-h' or '--help' to see a brief example on the format of this file.") @@ -404,13 +392,6 @@ def validate_and_prepare_args(args, model): for variable_name in input_variables_to_check: utils.validate_argument_is_valid_path(args, variable_name) - # check that the provided output files, if provided, contain a valid file path (i.e., not a folder) - output_variables_to_check = ["data_types_destination", "tool_conf_destination"] - for variable_name in output_variables_to_check: - file_name = getattr(args, variable_name) - if file_name is not None and os.path.isdir(file_name): - raise ApplicationException("The provided output file name (%s) points to a directory." % file_name) - if not args.macros_files: # list is empty, provide the default value logging.warning("Using default macros from galaxy/macros.xml") From 43b854888cb8cad94ab77d4a982a58e391b9d65c Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 31 Oct 2023 14:30:12 +0100 Subject: [PATCH 27/36] post rebase cleanup --- ctdconverter/common/utils.py | 10 +++---- ctdconverter/galaxy/converter.py | 45 ++++++++++++-------------------- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/ctdconverter/common/utils.py b/ctdconverter/common/utils.py index 015635a..5ff7287 100644 --- a/ctdconverter/common/utils.py +++ b/ctdconverter/common/utils.py @@ -186,11 +186,11 @@ def parse_input_ctds(xsd_location, input_ctds, output_destination, output_file_e def flatten_list_of_lists(args, list_name): lst = getattr(args, list_name) ret = [] - for l in lst: - if isinstance(l, list): - ret.extend(l) + for e in lst: + if isinstance(e, list): + ret.extend(e) else: - ret.append(l) + ret.append(e) setattr(args, list_name, ret) @@ -387,7 +387,7 @@ def resolve_param_mapping(param, ctd_model, fix_underscore=False): if mapping_element.reference_name == param.name: if param_mapping is not None: logging.warning("The parameter %s has more than one mapping in the section. " - "The first found mapping, %s, will be used." % (param.name, param_mapping)) + "The first found mapping, %s, will be used." % (param.name, param_mapping)) else: param_mapping = cli_element.option_identifier if param_mapping is not None: diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index e039aa3..bce1c58 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -217,8 +217,7 @@ def parse_macros_files(macros_file_names, tool_version, supported_file_types, re for xml_element in root.findall("xml"): name = xml_element.attrib["name"] if name in macros_to_expand: - logging.warning("Macro %s has already been found. Duplicate found in file %s." % - (name, macros_file_name)) + logging.warning("Macro %s has already been found. Duplicate found in file %s." % (name, macros_file_name)) continue logging.info("Macro %s found" % name) macros_to_expand.append(name) @@ -482,7 +481,6 @@ def _convert_internal(parsed_ctds, **kwargs): create_configfiles(tool, model, **kwargs) inputs = create_inputs(tool, model, **kwargs) outputs = create_outputs(tool, model, **kwargs) - tests_node = add_child_node(tool, "tests") if kwargs["test_test"]: create_tests(tool, inputs=copy.deepcopy(inputs), outputs=copy.deepcopy(outputs)) @@ -656,14 +654,14 @@ def create_command(tool, model, **kwargs): param_cmd['preprocessing'].append(f'#if ${_actual_parameter}_select == "no"') param_cmd['preprocessing'].append(f"mkdir ${{' '.join([\"'{actual_parameter}/%s'\" % (i) for i, f in enumerate(${_actual_parameter}) if f])}} && ") param_cmd['preprocessing'].append(f"${{' '.join([\"ln -s '%s' '{actual_parameter}/%s/%s.%s' && \" % (f, i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}) if f])}}") - param_cmd['preprocessing'].append(f'#else') + param_cmd['preprocessing'].append('#else') param_cmd['preprocessing'].append(f"ln -s '${_actual_parameter}' '{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}.ext)' &&") - param_cmd['preprocessing'].append(f'#end if') + param_cmd['preprocessing'].append('#end if') param_cmd['command'].append(f'#if ${actual_parameter}_select == "no"') param_cmd['command'].append(f"${{' '.join([\"'{actual_parameter}/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}) if f])}}") - param_cmd['command'].append(f'#else') + param_cmd['command'].append('#else') param_cmd['command'].append(f"'{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}.ext)'") - param_cmd['command'].append(f'#end if') + param_cmd['command'].append('#end if') else: param_cmd['preprocessing'].append("ln -s '$" + _actual_parameter + "' '" + actual_parameter + "/${re.sub(\"[^\\w\\-_]\", \"_\", $" + _actual_parameter + ".element_identifier)}.$gxy2omsext($" + _actual_parameter + ".ext)' &&") param_cmd['command'].append("'" + actual_parameter + "/${re.sub(\"[^\\w\\-_]\", \"_\", $" + _actual_parameter + ".element_identifier)}.$gxy2omsext($" + _actual_parameter + ".ext)'") @@ -796,7 +794,7 @@ def create_command(tool, model, **kwargs): for stage in advanced_cmd: if len(advanced_cmd[stage]) == 0: continue - advanced_cmd[stage] = [] + utils.indent(advanced_cmd[stage]) + [] + advanced_cmd[stage] = [advanced_command_start] + utils.indent(advanced_cmd[stage]) + [advanced_command_end] final_cmd[stage].extend(advanced_cmd[stage]) out, optout = all_outputs(model, parameter_hardcoder) @@ -814,7 +812,6 @@ def create_command(tool, model, **kwargs): command_node.text = CDATA("\n".join(sum(final_cmd.values(), []))) - def import_macros(tool, model, **kwargs): """ creates the xml elements needed to import the needed macros files @@ -835,15 +832,15 @@ def import_macros(tool, model, **kwargs): import_node.text = os.path.basename(macro_file.name) -def add_macros(tool, model, test_macros_prefix = None, test_macros_file_names = None): +def add_macros(tool, model, test_macros_prefix=None, test_macros_file_names=None): """ paste all test macros for a tool into the tests node of the tool """ - if test_macros_file_names == None: + if test_macros_file_names is None: return tool_id = model.name.replace(" ", "_") tests_node = tool.find(".//tests") - + for macros_file, macros_prefix in zip(test_macros_file_names, test_macros_prefix): macros_root = parse(macros_file) tool_tests = macros_root.find(f".//xml[@name='{macros_prefix}{tool_id}']") @@ -887,7 +884,7 @@ def get_galaxy_parameter_path(param, separator=".", suffix=None, fix_underscore= # data input params with multiple="true" are in a (batch mode) conditional # which needs to be added to the param path list if param.type is _InFile and param.is_list: - path.insert(len(path)-1, f"{p}_cond") + path.insert(len(path) - 1, f"{p}_cond") return separator.join(path).replace("-", "_") @@ -1133,7 +1130,7 @@ def get_formats(param, model, o2g): elif is_out_type_param(param, model): choices = param.restrictions.choices else: - raise InvalidModelException(f"Unrecognized restriction type [{type(param.restrictions)}] for [{name}]") + raise InvalidModelException(f"Unrecognized restriction type [{type(param.restrictions)}] for [{param.name}]") # check if there are formats that have not been registered yet... formats = set() @@ -1400,19 +1397,19 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ if param_node.attrib["type"] == "data" and param_node.attrib.get("multiple") == "true": conditional_attrib = OrderedDict([ - ("name", get_galaxy_parameter_name(param)+"_cond") + ("name", get_galaxy_parameter_name(param) + "_cond") ]) conditional = Element("conditional", conditional_attrib) select_attrib = OrderedDict([ - ("name", get_galaxy_parameter_name(param)+"_select"), + ("name", get_galaxy_parameter_name(param) + "_select"), ("type", "select"), ("label", f"Run tool in batch mode for -{get_galaxy_parameter_name(param)}") ]) select = add_child_node(conditional, "param", select_attrib) add_child_node(select, "option", attributes={"value": "no"}, text="No: process all datasets jointly") add_child_node(select, "option", attributes={"value": "yes"}, text="Yes: process each dataset in an independent job") - + when_no = add_child_node(conditional, "when", attributes={"value": "no"}) when_no.append(copy.deepcopy(param_node)) when_yes = add_child_node(conditional, "when", attributes={"value": "yes"}) @@ -1422,6 +1419,7 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ return param_node + def generate_label_and_help(desc): help_text = "" # This tag is found in some descriptions @@ -1737,16 +1735,7 @@ def create_tests(parent, inputs=None, outputs=None): @param inputs a copy of the inputs """ - if not (inputs is None or outputs is None): - fidx = 0 - test_node = add_child_node(tests_node, "test") - strip_elements(inputs, "validator", "sanitizer") - for node in inputs.iter(): - if node.tag == "expand" and node.attrib["macro"] == ADVANCED_OPTIONS_NAME + "_macro": - node.tag = "section" - node.attrib["name"] = ADVANCED_OPTIONS_NAME - if "type" not in node.attrib: - continue + tests_node = add_child_node(parent, "tests") fidx = 0 test_node = add_child_node(tests_node, "test") @@ -1983,7 +1972,7 @@ def create_test_only(model, **kwargs): # for input-files with multiple=true we need to add the batch mode conditional if param.type is _InFile and param.is_list: batch_cond_attrib = OrderedDict([ - ("name", get_galaxy_parameter_name(param)+"_cond") + ("name", get_galaxy_parameter_name(param) + "_cond") ]) parent = add_child_node(parent, "conditional", batch_cond_attrib) From 98e9eb502febbcfc2ae0350a783ee4e098acd212 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 31 Oct 2023 15:15:19 +0100 Subject: [PATCH 28/36] fixup for batch mode tests --- tests/test-data/ifile.xml | 1928 +++++++++++++++++----- tests/test-data/ofile-mult-typeparam.xml | 93 +- tests/test-data/ofile-mult.xml | 93 +- 3 files changed, 1704 insertions(+), 410 deletions(-) diff --git a/tests/test-data/ifile.xml b/tests/test-data/ifile.xml index a47a291..130ea74 100644 --- a/tests/test-data/ifile.xml +++ b/tests/test-data/ifile.xml @@ -56,59 +56,107 @@ ln -s '$mandatory_multformat' 'mandatory_multformat/${re.sub("[^\w\-_]", "_", $m mkdir default_optional_multformat && ln -s '$default_optional_multformat' 'default_optional_multformat/${re.sub("[^\w\-_]", "_", $default_optional_multformat.element_identifier)}.$gxy2omsext($default_optional_multformat.ext)' && #end if -mkdir list_mandatory_noformat && -mkdir ${' '.join(["'list_mandatory_noformat/%s'" % (i) for i, f in enumerate($list_mandatory_noformat) if f])} && -${' '.join(["ln -s '%s' 'list_mandatory_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_noformat) if f])} -#if $list_optional_noformat: - mkdir list_optional_noformat && - mkdir ${' '.join(["'list_optional_noformat/%s'" % (i) for i, f in enumerate($list_optional_noformat) if f])} && - ${' '.join(["ln -s '%s' 'list_optional_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_noformat) if f])} -#end if -mkdir list_mandatory_oneformat && -mkdir ${' '.join(["'list_mandatory_oneformat/%s'" % (i) for i, f in enumerate($list_mandatory_oneformat) if f])} && -${' '.join(["ln -s '%s' 'list_mandatory_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_oneformat) if f])} -#if $list_optional_oneformat: - mkdir list_optional_oneformat && - mkdir ${' '.join(["'list_optional_oneformat/%s'" % (i) for i, f in enumerate($list_optional_oneformat) if f])} && - ${' '.join(["ln -s '%s' 'list_optional_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_oneformat) if f])} -#end if -mkdir list_mandatory_multformat && -mkdir ${' '.join(["'list_mandatory_multformat/%s'" % (i) for i, f in enumerate($list_mandatory_multformat) if f])} && -${' '.join(["ln -s '%s' 'list_mandatory_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_multformat) if f])} -#if $list_optional_multformat: - mkdir list_optional_multformat && - mkdir ${' '.join(["'list_optional_multformat/%s'" % (i) for i, f in enumerate($list_optional_multformat) if f])} && - ${' '.join(["ln -s '%s' 'list_optional_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_multformat) if f])} -#end if -#if $list_default_mandatory_noformat: - mkdir list_default_mandatory_noformat && - mkdir ${' '.join(["'list_default_mandatory_noformat/%s'" % (i) for i, f in enumerate($list_default_mandatory_noformat) if f])} && - ${' '.join(["ln -s '%s' 'list_default_mandatory_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_noformat) if f])} -#end if -#if $list_default_optional_noformat: - mkdir list_default_optional_noformat && - mkdir ${' '.join(["'list_default_optional_noformat/%s'" % (i) for i, f in enumerate($list_default_optional_noformat) if f])} && - ${' '.join(["ln -s '%s' 'list_default_optional_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_noformat) if f])} -#end if -#if $list_default_mandatory_oneformat: - mkdir list_default_mandatory_oneformat && - mkdir ${' '.join(["'list_default_mandatory_oneformat/%s'" % (i) for i, f in enumerate($list_default_mandatory_oneformat) if f])} && - ${' '.join(["ln -s '%s' 'list_default_mandatory_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_oneformat) if f])} -#end if -#if $list_default_optional_oneformat: - mkdir list_default_optional_oneformat && - mkdir ${' '.join(["'list_default_optional_oneformat/%s'" % (i) for i, f in enumerate($list_default_optional_oneformat) if f])} && - ${' '.join(["ln -s '%s' 'list_default_optional_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_oneformat) if f])} -#end if -#if $list_default_mandatory_multformat: - mkdir list_default_mandatory_multformat && - mkdir ${' '.join(["'list_default_mandatory_multformat/%s'" % (i) for i, f in enumerate($list_default_mandatory_multformat) if f])} && - ${' '.join(["ln -s '%s' 'list_default_mandatory_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_multformat) if f])} -#end if -#if $list_default_optional_multformat: - mkdir list_default_optional_multformat && - mkdir ${' '.join(["'list_default_optional_multformat/%s'" % (i) for i, f in enumerate($list_default_optional_multformat) if f])} && - ${' '.join(["ln -s '%s' 'list_default_optional_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_multformat) if f])} +mkdir list_mandatory_noformat_cond.list_mandatory_noformat && +#if $list_mandatory_noformat_cond.list_mandatory_noformat_select == "no" +mkdir ${' '.join(["'list_mandatory_noformat_cond.list_mandatory_noformat/%s'" % (i) for i, f in enumerate($list_mandatory_noformat_cond.list_mandatory_noformat) if f])} && +${' '.join(["ln -s '%s' 'list_mandatory_noformat_cond.list_mandatory_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_noformat_cond.list_mandatory_noformat) if f])} +#else +ln -s '$list_mandatory_noformat_cond.list_mandatory_noformat' 'list_mandatory_noformat_cond.list_mandatory_noformat/${re.sub("[^\w\-_]", "_", $list_mandatory_noformat_cond.list_mandatory_noformat.element_identifier)}.$gxy2omsext($list_mandatory_noformat_cond.list_mandatory_noformat.ext)' && +#end if +#if $list_optional_noformat_cond.list_optional_noformat: + mkdir list_optional_noformat_cond.list_optional_noformat && + #if $list_optional_noformat_cond.list_optional_noformat_select == "no" + mkdir ${' '.join(["'list_optional_noformat_cond.list_optional_noformat/%s'" % (i) for i, f in enumerate($list_optional_noformat_cond.list_optional_noformat) if f])} && + ${' '.join(["ln -s '%s' 'list_optional_noformat_cond.list_optional_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_noformat_cond.list_optional_noformat) if f])} + #else + ln -s '$list_optional_noformat_cond.list_optional_noformat' 'list_optional_noformat_cond.list_optional_noformat/${re.sub("[^\w\-_]", "_", $list_optional_noformat_cond.list_optional_noformat.element_identifier)}.$gxy2omsext($list_optional_noformat_cond.list_optional_noformat.ext)' && + #end if +#end if +mkdir list_mandatory_oneformat_cond.list_mandatory_oneformat && +#if $list_mandatory_oneformat_cond.list_mandatory_oneformat_select == "no" +mkdir ${' '.join(["'list_mandatory_oneformat_cond.list_mandatory_oneformat/%s'" % (i) for i, f in enumerate($list_mandatory_oneformat_cond.list_mandatory_oneformat) if f])} && +${' '.join(["ln -s '%s' 'list_mandatory_oneformat_cond.list_mandatory_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_oneformat_cond.list_mandatory_oneformat) if f])} +#else +ln -s '$list_mandatory_oneformat_cond.list_mandatory_oneformat' 'list_mandatory_oneformat_cond.list_mandatory_oneformat/${re.sub("[^\w\-_]", "_", $list_mandatory_oneformat_cond.list_mandatory_oneformat.element_identifier)}.$gxy2omsext($list_mandatory_oneformat_cond.list_mandatory_oneformat.ext)' && +#end if +#if $list_optional_oneformat_cond.list_optional_oneformat: + mkdir list_optional_oneformat_cond.list_optional_oneformat && + #if $list_optional_oneformat_cond.list_optional_oneformat_select == "no" + mkdir ${' '.join(["'list_optional_oneformat_cond.list_optional_oneformat/%s'" % (i) for i, f in enumerate($list_optional_oneformat_cond.list_optional_oneformat) if f])} && + ${' '.join(["ln -s '%s' 'list_optional_oneformat_cond.list_optional_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_oneformat_cond.list_optional_oneformat) if f])} + #else + ln -s '$list_optional_oneformat_cond.list_optional_oneformat' 'list_optional_oneformat_cond.list_optional_oneformat/${re.sub("[^\w\-_]", "_", $list_optional_oneformat_cond.list_optional_oneformat.element_identifier)}.$gxy2omsext($list_optional_oneformat_cond.list_optional_oneformat.ext)' && + #end if +#end if +mkdir list_mandatory_multformat_cond.list_mandatory_multformat && +#if $list_mandatory_multformat_cond.list_mandatory_multformat_select == "no" +mkdir ${' '.join(["'list_mandatory_multformat_cond.list_mandatory_multformat/%s'" % (i) for i, f in enumerate($list_mandatory_multformat_cond.list_mandatory_multformat) if f])} && +${' '.join(["ln -s '%s' 'list_mandatory_multformat_cond.list_mandatory_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_multformat_cond.list_mandatory_multformat) if f])} +#else +ln -s '$list_mandatory_multformat_cond.list_mandatory_multformat' 'list_mandatory_multformat_cond.list_mandatory_multformat/${re.sub("[^\w\-_]", "_", $list_mandatory_multformat_cond.list_mandatory_multformat.element_identifier)}.$gxy2omsext($list_mandatory_multformat_cond.list_mandatory_multformat.ext)' && +#end if +#if $list_optional_multformat_cond.list_optional_multformat: + mkdir list_optional_multformat_cond.list_optional_multformat && + #if $list_optional_multformat_cond.list_optional_multformat_select == "no" + mkdir ${' '.join(["'list_optional_multformat_cond.list_optional_multformat/%s'" % (i) for i, f in enumerate($list_optional_multformat_cond.list_optional_multformat) if f])} && + ${' '.join(["ln -s '%s' 'list_optional_multformat_cond.list_optional_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_multformat_cond.list_optional_multformat) if f])} + #else + ln -s '$list_optional_multformat_cond.list_optional_multformat' 'list_optional_multformat_cond.list_optional_multformat/${re.sub("[^\w\-_]", "_", $list_optional_multformat_cond.list_optional_multformat.element_identifier)}.$gxy2omsext($list_optional_multformat_cond.list_optional_multformat.ext)' && + #end if +#end if +#if $list_default_mandatory_noformat_cond.list_default_mandatory_noformat: + mkdir list_default_mandatory_noformat_cond.list_default_mandatory_noformat && + #if $list_default_mandatory_noformat_cond.list_default_mandatory_noformat_select == "no" + mkdir ${' '.join(["'list_default_mandatory_noformat_cond.list_default_mandatory_noformat/%s'" % (i) for i, f in enumerate($list_default_mandatory_noformat_cond.list_default_mandatory_noformat) if f])} && + ${' '.join(["ln -s '%s' 'list_default_mandatory_noformat_cond.list_default_mandatory_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_noformat_cond.list_default_mandatory_noformat) if f])} + #else + ln -s '$list_default_mandatory_noformat_cond.list_default_mandatory_noformat' 'list_default_mandatory_noformat_cond.list_default_mandatory_noformat/${re.sub("[^\w\-_]", "_", $list_default_mandatory_noformat_cond.list_default_mandatory_noformat.element_identifier)}.$gxy2omsext($list_default_mandatory_noformat_cond.list_default_mandatory_noformat.ext)' && + #end if +#end if +#if $list_default_optional_noformat_cond.list_default_optional_noformat: + mkdir list_default_optional_noformat_cond.list_default_optional_noformat && + #if $list_default_optional_noformat_cond.list_default_optional_noformat_select == "no" + mkdir ${' '.join(["'list_default_optional_noformat_cond.list_default_optional_noformat/%s'" % (i) for i, f in enumerate($list_default_optional_noformat_cond.list_default_optional_noformat) if f])} && + ${' '.join(["ln -s '%s' 'list_default_optional_noformat_cond.list_default_optional_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_noformat_cond.list_default_optional_noformat) if f])} + #else + ln -s '$list_default_optional_noformat_cond.list_default_optional_noformat' 'list_default_optional_noformat_cond.list_default_optional_noformat/${re.sub("[^\w\-_]", "_", $list_default_optional_noformat_cond.list_default_optional_noformat.element_identifier)}.$gxy2omsext($list_default_optional_noformat_cond.list_default_optional_noformat.ext)' && + #end if +#end if +#if $list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat: + mkdir list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat && + #if $list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat_select == "no" + mkdir ${' '.join(["'list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat/%s'" % (i) for i, f in enumerate($list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat) if f])} && + ${' '.join(["ln -s '%s' 'list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat) if f])} + #else + ln -s '$list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat' 'list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat/${re.sub("[^\w\-_]", "_", $list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat.element_identifier)}.$gxy2omsext($list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat.ext)' && + #end if +#end if +#if $list_default_optional_oneformat_cond.list_default_optional_oneformat: + mkdir list_default_optional_oneformat_cond.list_default_optional_oneformat && + #if $list_default_optional_oneformat_cond.list_default_optional_oneformat_select == "no" + mkdir ${' '.join(["'list_default_optional_oneformat_cond.list_default_optional_oneformat/%s'" % (i) for i, f in enumerate($list_default_optional_oneformat_cond.list_default_optional_oneformat) if f])} && + ${' '.join(["ln -s '%s' 'list_default_optional_oneformat_cond.list_default_optional_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_oneformat_cond.list_default_optional_oneformat) if f])} + #else + ln -s '$list_default_optional_oneformat_cond.list_default_optional_oneformat' 'list_default_optional_oneformat_cond.list_default_optional_oneformat/${re.sub("[^\w\-_]", "_", $list_default_optional_oneformat_cond.list_default_optional_oneformat.element_identifier)}.$gxy2omsext($list_default_optional_oneformat_cond.list_default_optional_oneformat.ext)' && + #end if +#end if +#if $list_default_mandatory_multformat_cond.list_default_mandatory_multformat: + mkdir list_default_mandatory_multformat_cond.list_default_mandatory_multformat && + #if $list_default_mandatory_multformat_cond.list_default_mandatory_multformat_select == "no" + mkdir ${' '.join(["'list_default_mandatory_multformat_cond.list_default_mandatory_multformat/%s'" % (i) for i, f in enumerate($list_default_mandatory_multformat_cond.list_default_mandatory_multformat) if f])} && + ${' '.join(["ln -s '%s' 'list_default_mandatory_multformat_cond.list_default_mandatory_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_multformat_cond.list_default_mandatory_multformat) if f])} + #else + ln -s '$list_default_mandatory_multformat_cond.list_default_mandatory_multformat' 'list_default_mandatory_multformat_cond.list_default_mandatory_multformat/${re.sub("[^\w\-_]", "_", $list_default_mandatory_multformat_cond.list_default_mandatory_multformat.element_identifier)}.$gxy2omsext($list_default_mandatory_multformat_cond.list_default_mandatory_multformat.ext)' && + #end if +#end if +#if $list_default_optional_multformat_cond.list_default_optional_multformat: + mkdir list_default_optional_multformat_cond.list_default_optional_multformat && + #if $list_default_optional_multformat_cond.list_default_optional_multformat_select == "no" + mkdir ${' '.join(["'list_default_optional_multformat_cond.list_default_optional_multformat/%s'" % (i) for i, f in enumerate($list_default_optional_multformat_cond.list_default_optional_multformat) if f])} && + ${' '.join(["ln -s '%s' 'list_default_optional_multformat_cond.list_default_optional_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_multformat_cond.list_default_optional_multformat) if f])} + #else + ln -s '$list_default_optional_multformat_cond.list_default_optional_multformat' 'list_default_optional_multformat_cond.list_default_optional_multformat/${re.sub("[^\w\-_]", "_", $list_default_optional_multformat_cond.list_default_optional_multformat.element_identifier)}.$gxy2omsext($list_default_optional_multformat_cond.list_default_optional_multformat.ext)' && + #end if #end if mkdir test_section.sect_mandatory_noformat && ln -s '$test_section.sect_mandatory_noformat' 'test_section.sect_mandatory_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_mandatory_noformat.element_identifier)}.$gxy2omsext($test_section.sect_mandatory_noformat.ext)' && @@ -152,61 +200,109 @@ ln -s '$test_section.sect_mandatory_multformat' 'test_section.sect_mandatory_mul mkdir test_section.sect_default_optional_multformat && ln -s '$test_section.sect_default_optional_multformat' 'test_section.sect_default_optional_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_default_optional_multformat.element_identifier)}.$gxy2omsext($test_section.sect_default_optional_multformat.ext)' && #end if -mkdir test_section.sect_list_mandatory_noformat && -mkdir ${' '.join(["'test_section.sect_list_mandatory_noformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_noformat) if f])} && -${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_noformat) if f])} -#if $test_section.sect_list_optional_noformat: - mkdir test_section.sect_list_optional_noformat && - mkdir ${' '.join(["'test_section.sect_list_optional_noformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_noformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_noformat) if f])} -#end if -mkdir test_section.sect_list_mandatory_oneformat && -mkdir ${' '.join(["'test_section.sect_list_mandatory_oneformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_oneformat) if f])} && -${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_oneformat) if f])} -#if $test_section.sect_list_optional_oneformat: - mkdir test_section.sect_list_optional_oneformat && - mkdir ${' '.join(["'test_section.sect_list_optional_oneformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_oneformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_oneformat) if f])} -#end if -mkdir test_section.sect_list_mandatory_multformat && -mkdir ${' '.join(["'test_section.sect_list_mandatory_multformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_multformat) if f])} && -${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_multformat) if f])} -#if $test_section.sect_list_optional_multformat: - mkdir test_section.sect_list_optional_multformat && - mkdir ${' '.join(["'test_section.sect_list_optional_multformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_multformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_multformat) if f])} -#end if -#if $test_section.sect_list_default_mandatory_noformat: - mkdir test_section.sect_list_default_mandatory_noformat && - mkdir ${' '.join(["'test_section.sect_list_default_mandatory_noformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat) if f])} -#end if -#if $test_section.sect_list_default_optional_noformat: - mkdir test_section.sect_list_default_optional_noformat && - mkdir ${' '.join(["'test_section.sect_list_default_optional_noformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_noformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_noformat) if f])} -#end if -#if $test_section.sect_list_default_mandatory_oneformat: - mkdir test_section.sect_list_default_mandatory_oneformat && - mkdir ${' '.join(["'test_section.sect_list_default_mandatory_oneformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat) if f])} -#end if -#if $test_section.sect_list_default_optional_oneformat: - mkdir test_section.sect_list_default_optional_oneformat && - mkdir ${' '.join(["'test_section.sect_list_default_optional_oneformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_oneformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_oneformat) if f])} -#end if -#if $test_section.sect_list_default_mandatory_multformat: - mkdir test_section.sect_list_default_mandatory_multformat && - mkdir ${' '.join(["'test_section.sect_list_default_mandatory_multformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat) if f])} -#end if -#if $test_section.sect_list_default_optional_multformat: - mkdir test_section.sect_list_default_optional_multformat && - mkdir ${' '.join(["'test_section.sect_list_default_optional_multformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_multformat) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_multformat) if f])} -#end if -#if $adv_opts.adv_opts_selector=='advanced': +mkdir test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat && +#if $test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat_select == "no" +mkdir ${' '.join(["'test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat) if f])} && +${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat) if f])} +#else +ln -s '$test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat' 'test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat.ext)' && +#end if +#if $test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat: + mkdir test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat && + #if $test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat) if f])} + #else + ln -s '$test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat' 'test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat.ext)' && + #end if +#end if +mkdir test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat && +#if $test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat_select == "no" +mkdir ${' '.join(["'test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat) if f])} && +${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat) if f])} +#else +ln -s '$test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat' 'test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat.ext)' && +#end if +#if $test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat: + mkdir test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat && + #if $test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat) if f])} + #else + ln -s '$test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat' 'test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat.ext)' && + #end if +#end if +mkdir test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat && +#if $test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat_select == "no" +mkdir ${' '.join(["'test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat) if f])} && +${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat) if f])} +#else +ln -s '$test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat' 'test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat.ext)' && +#end if +#if $test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat: + mkdir test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat && + #if $test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat) if f])} + #else + ln -s '$test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat' 'test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat.ext)' && + #end if +#end if +#if $test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat: + mkdir test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat && + #if $test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat) if f])} + #else + ln -s '$test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat' 'test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat.ext)' && + #end if +#end if +#if $test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat: + mkdir test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat && + #if $test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat) if f])} + #else + ln -s '$test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat' 'test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat.ext)' && + #end if +#end if +#if $test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat: + mkdir test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat && + #if $test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat) if f])} + #else + ln -s '$test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat' 'test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat.ext)' && + #end if +#end if +#if $test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat: + mkdir test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat && + #if $test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat) if f])} + #else + ln -s '$test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat' 'test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat.ext)' && + #end if +#end if +#if $test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat: + mkdir test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat && + #if $test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat) if f])} + #else + ln -s '$test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat' 'test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat.ext)' && + #end if +#end if +#if $test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat: + mkdir test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat && + #if $test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat) if f])} + #else + ln -s '$test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat' 'test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat.ext)' && + #end if +#end if +## advanced options mkdir adv_opts.mandatory_noformat_adv && ln -s '$adv_opts.mandatory_noformat_adv' 'adv_opts.mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.mandatory_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.mandatory_noformat_adv.ext)' && #if $adv_opts.optional_noformat_adv: @@ -249,59 +345,107 @@ ${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_multformat/%s/%s.%s' & mkdir adv_opts.default_optional_multformat_adv && ln -s '$adv_opts.default_optional_multformat_adv' 'adv_opts.default_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.default_optional_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.default_optional_multformat_adv.ext)' && #end if - mkdir adv_opts.list_mandatory_noformat_adv && - mkdir ${' '.join(["'adv_opts.list_mandatory_noformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_mandatory_noformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_mandatory_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_noformat_adv) if f])} - #if $adv_opts.list_optional_noformat_adv: - mkdir adv_opts.list_optional_noformat_adv && - mkdir ${' '.join(["'adv_opts.list_optional_noformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_optional_noformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_optional_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_noformat_adv) if f])} - #end if - mkdir adv_opts.list_mandatory_oneformat_adv && - mkdir ${' '.join(["'adv_opts.list_mandatory_oneformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_mandatory_oneformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_mandatory_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_oneformat_adv) if f])} - #if $adv_opts.list_optional_oneformat_adv: - mkdir adv_opts.list_optional_oneformat_adv && - mkdir ${' '.join(["'adv_opts.list_optional_oneformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_optional_oneformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_optional_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_oneformat_adv) if f])} - #end if - mkdir adv_opts.list_mandatory_multformat_adv && - mkdir ${' '.join(["'adv_opts.list_mandatory_multformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_mandatory_multformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_mandatory_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_multformat_adv) if f])} - #if $adv_opts.list_optional_multformat_adv: - mkdir adv_opts.list_optional_multformat_adv && - mkdir ${' '.join(["'adv_opts.list_optional_multformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_optional_multformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_optional_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_multformat_adv) if f])} - #end if - #if $adv_opts.list_default_mandatory_noformat_adv: - mkdir adv_opts.list_default_mandatory_noformat_adv && - mkdir ${' '.join(["'adv_opts.list_default_mandatory_noformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_mandatory_noformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_default_mandatory_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_noformat_adv) if f])} - #end if - #if $adv_opts.list_default_optional_noformat_adv: - mkdir adv_opts.list_default_optional_noformat_adv && - mkdir ${' '.join(["'adv_opts.list_default_optional_noformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_optional_noformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_default_optional_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_noformat_adv) if f])} - #end if - #if $adv_opts.list_default_mandatory_oneformat_adv: - mkdir adv_opts.list_default_mandatory_oneformat_adv && - mkdir ${' '.join(["'adv_opts.list_default_mandatory_oneformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_mandatory_oneformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_default_mandatory_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_oneformat_adv) if f])} - #end if - #if $adv_opts.list_default_optional_oneformat_adv: - mkdir adv_opts.list_default_optional_oneformat_adv && - mkdir ${' '.join(["'adv_opts.list_default_optional_oneformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_optional_oneformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_default_optional_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_oneformat_adv) if f])} - #end if - #if $adv_opts.list_default_mandatory_multformat_adv: - mkdir adv_opts.list_default_mandatory_multformat_adv && - mkdir ${' '.join(["'adv_opts.list_default_mandatory_multformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_mandatory_multformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_default_mandatory_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_multformat_adv) if f])} - #end if - #if $adv_opts.list_default_optional_multformat_adv: - mkdir adv_opts.list_default_optional_multformat_adv && - mkdir ${' '.join(["'adv_opts.list_default_optional_multformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_optional_multformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'adv_opts.list_default_optional_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_multformat_adv) if f])} + mkdir adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv && + #if $adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv) if f])} + #else + ln -s '$adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv' 'adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv.ext)' && + #end if + #if $adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv: + mkdir adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv && + #if $adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv) if f])} + #else + ln -s '$adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv' 'adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv.ext)' && + #end if + #end if + mkdir adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv && + #if $adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv) if f])} + #else + ln -s '$adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv' 'adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv.ext)' && + #end if + #if $adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv: + mkdir adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv && + #if $adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv) if f])} + #else + ln -s '$adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv' 'adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv.ext)' && + #end if + #end if + mkdir adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv && + #if $adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv) if f])} + #else + ln -s '$adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv' 'adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv.ext)' && + #end if + #if $adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv: + mkdir adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv && + #if $adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv) if f])} + #else + ln -s '$adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv' 'adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv.ext)' && + #end if + #end if + #if $adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv: + mkdir adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv && + #if $adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv) if f])} + #else + ln -s '$adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv' 'adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv.ext)' && + #end if + #end if + #if $adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv: + mkdir adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv && + #if $adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv) if f])} + #else + ln -s '$adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv' 'adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv.ext)' && + #end if + #end if + #if $adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv: + mkdir adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv && + #if $adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv) if f])} + #else + ln -s '$adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv' 'adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv.ext)' && + #end if + #end if + #if $adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv: + mkdir adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv && + #if $adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv) if f])} + #else + ln -s '$adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv' 'adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv.ext)' && + #end if + #end if + #if $adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv: + mkdir adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv && + #if $adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv) if f])} + #else + ln -s '$adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv' 'adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv.ext)' && + #end if + #end if + #if $adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv: + mkdir adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv && + #if $adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv_select == "no" + mkdir ${' '.join(["'adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv/%s'" % (i) for i, f in enumerate($adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv) if f])} + #else + ln -s '$adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv' 'adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv.ext)' && + #end if #end if mkdir test_section.sect_mandatory_noformat_adv && ln -s '$test_section.sect_mandatory_noformat_adv' 'test_section.sect_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_mandatory_noformat_adv.ext)' && @@ -345,61 +489,109 @@ ${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_multformat/%s/%s.%s' & mkdir test_section.sect_default_optional_multformat_adv && ln -s '$test_section.sect_default_optional_multformat_adv' 'test_section.sect_default_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_default_optional_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_default_optional_multformat_adv.ext)' && #end if - mkdir test_section.sect_list_mandatory_noformat_adv && - mkdir ${' '.join(["'test_section.sect_list_mandatory_noformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_noformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_noformat_adv) if f])} - #if $test_section.sect_list_optional_noformat_adv: - mkdir test_section.sect_list_optional_noformat_adv && - mkdir ${' '.join(["'test_section.sect_list_optional_noformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_noformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_noformat_adv) if f])} - #end if - mkdir test_section.sect_list_mandatory_oneformat_adv && - mkdir ${' '.join(["'test_section.sect_list_mandatory_oneformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_adv) if f])} - #if $test_section.sect_list_optional_oneformat_adv: - mkdir test_section.sect_list_optional_oneformat_adv && - mkdir ${' '.join(["'test_section.sect_list_optional_oneformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_oneformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_oneformat_adv) if f])} - #end if - mkdir test_section.sect_list_mandatory_multformat_adv && - mkdir ${' '.join(["'test_section.sect_list_mandatory_multformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_multformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_multformat_adv) if f])} - #if $test_section.sect_list_optional_multformat_adv: - mkdir test_section.sect_list_optional_multformat_adv && - mkdir ${' '.join(["'test_section.sect_list_optional_multformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_multformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_multformat_adv) if f])} - #end if - #if $test_section.sect_list_default_mandatory_noformat_adv: - mkdir test_section.sect_list_default_mandatory_noformat_adv && - mkdir ${' '.join(["'test_section.sect_list_default_mandatory_noformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_adv) if f])} - #end if - #if $test_section.sect_list_default_optional_noformat_adv: - mkdir test_section.sect_list_default_optional_noformat_adv && - mkdir ${' '.join(["'test_section.sect_list_default_optional_noformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_noformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_noformat_adv) if f])} - #end if - #if $test_section.sect_list_default_mandatory_oneformat_adv: - mkdir test_section.sect_list_default_mandatory_oneformat_adv && - mkdir ${' '.join(["'test_section.sect_list_default_mandatory_oneformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_adv) if f])} - #end if - #if $test_section.sect_list_default_optional_oneformat_adv: - mkdir test_section.sect_list_default_optional_oneformat_adv && - mkdir ${' '.join(["'test_section.sect_list_default_optional_oneformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_adv) if f])} - #end if - #if $test_section.sect_list_default_mandatory_multformat_adv: - mkdir test_section.sect_list_default_mandatory_multformat_adv && - mkdir ${' '.join(["'test_section.sect_list_default_mandatory_multformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_adv) if f])} - #end if - #if $test_section.sect_list_default_optional_multformat_adv: - mkdir test_section.sect_list_default_optional_multformat_adv && - mkdir ${' '.join(["'test_section.sect_list_default_optional_multformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_multformat_adv) if f])} && - ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_multformat_adv) if f])} + mkdir test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv && + #if $test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv) if f])} + #else + ln -s '$test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv' 'test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv.ext)' && + #end if + #if $test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv: + mkdir test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv && + #if $test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv) if f])} + #else + ln -s '$test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv' 'test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv.ext)' && + #end if + #end if + mkdir test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv && + #if $test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv) if f])} + #else + ln -s '$test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv' 'test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv.ext)' && + #end if + #if $test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv: + mkdir test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv && + #if $test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv) if f])} + #else + ln -s '$test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv' 'test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv.ext)' && + #end if + #end if + mkdir test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv && + #if $test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv) if f])} + #else + ln -s '$test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv' 'test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv.ext)' && + #end if + #if $test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv: + mkdir test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv && + #if $test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv) if f])} + #else + ln -s '$test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv' 'test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv.ext)' && + #end if + #end if + #if $test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv: + mkdir test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv && + #if $test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv) if f])} + #else + ln -s '$test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv' 'test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv.ext)' && + #end if + #end if + #if $test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv: + mkdir test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv && + #if $test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv) if f])} + #else + ln -s '$test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv' 'test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv.ext)' && + #end if + #end if + #if $test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv: + mkdir test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv && + #if $test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv) if f])} + #else + ln -s '$test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv' 'test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv.ext)' && + #end if + #end if + #if $test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv: + mkdir test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv && + #if $test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv) if f])} + #else + ln -s '$test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv' 'test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv.ext)' && + #end if + #end if + #if $test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv: + mkdir test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv && + #if $test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv) if f])} + #else + ln -s '$test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv' 'test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv.ext)' && + #end if + #end if + #if $test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv: + mkdir test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv && + #if $test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv_select == "no" + mkdir ${' '.join(["'test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv/%s'" % (i) for i, f in enumerate($test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv) if f])} && + ${' '.join(["ln -s '%s' 'test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv) if f])} + #else + ln -s '$test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv' 'test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv.ext)' && + #end if #end if -#end if + ## Main program call @@ -450,46 +642,94 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard 'default_optional_multformat/${re.sub("[^\w\-_]", "_", $default_optional_multformat.element_identifier)}.$gxy2omsext($default_optional_multformat.ext)' #end if -list_mandatory_noformat -${' '.join(["'list_mandatory_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_noformat) if f])} -#if $list_optional_noformat: +#if $list_mandatory_noformat_cond.list_mandatory_noformat_select == "no" +${' '.join(["'list_mandatory_noformat_cond.list_mandatory_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_noformat_cond.list_mandatory_noformat) if f])} +#else +'list_mandatory_noformat_cond.list_mandatory_noformat/${re.sub("[^\w\-_]", "_", $list_mandatory_noformat_cond.list_mandatory_noformat.element_identifier)}.$gxy2omsext($list_mandatory_noformat_cond.list_mandatory_noformat.ext)' +#end if +#if $list_optional_noformat_cond.list_optional_noformat: -list_optional_noformat - ${' '.join(["'list_optional_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_noformat) if f])} + #if $list_optional_noformat_cond.list_optional_noformat_select == "no" + ${' '.join(["'list_optional_noformat_cond.list_optional_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_noformat_cond.list_optional_noformat) if f])} + #else + 'list_optional_noformat_cond.list_optional_noformat/${re.sub("[^\w\-_]", "_", $list_optional_noformat_cond.list_optional_noformat.element_identifier)}.$gxy2omsext($list_optional_noformat_cond.list_optional_noformat.ext)' + #end if #end if -list_mandatory_oneformat -${' '.join(["'list_mandatory_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_oneformat) if f])} -#if $list_optional_oneformat: +#if $list_mandatory_oneformat_cond.list_mandatory_oneformat_select == "no" +${' '.join(["'list_mandatory_oneformat_cond.list_mandatory_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_oneformat_cond.list_mandatory_oneformat) if f])} +#else +'list_mandatory_oneformat_cond.list_mandatory_oneformat/${re.sub("[^\w\-_]", "_", $list_mandatory_oneformat_cond.list_mandatory_oneformat.element_identifier)}.$gxy2omsext($list_mandatory_oneformat_cond.list_mandatory_oneformat.ext)' +#end if +#if $list_optional_oneformat_cond.list_optional_oneformat: -list_optional_oneformat - ${' '.join(["'list_optional_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_oneformat) if f])} + #if $list_optional_oneformat_cond.list_optional_oneformat_select == "no" + ${' '.join(["'list_optional_oneformat_cond.list_optional_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_oneformat_cond.list_optional_oneformat) if f])} + #else + 'list_optional_oneformat_cond.list_optional_oneformat/${re.sub("[^\w\-_]", "_", $list_optional_oneformat_cond.list_optional_oneformat.element_identifier)}.$gxy2omsext($list_optional_oneformat_cond.list_optional_oneformat.ext)' + #end if #end if -list_mandatory_multformat -${' '.join(["'list_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_multformat) if f])} -#if $list_optional_multformat: +#if $list_mandatory_multformat_cond.list_mandatory_multformat_select == "no" +${' '.join(["'list_mandatory_multformat_cond.list_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_mandatory_multformat_cond.list_mandatory_multformat) if f])} +#else +'list_mandatory_multformat_cond.list_mandatory_multformat/${re.sub("[^\w\-_]", "_", $list_mandatory_multformat_cond.list_mandatory_multformat.element_identifier)}.$gxy2omsext($list_mandatory_multformat_cond.list_mandatory_multformat.ext)' +#end if +#if $list_optional_multformat_cond.list_optional_multformat: -list_optional_multformat - ${' '.join(["'list_optional_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_multformat) if f])} + #if $list_optional_multformat_cond.list_optional_multformat_select == "no" + ${' '.join(["'list_optional_multformat_cond.list_optional_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_optional_multformat_cond.list_optional_multformat) if f])} + #else + 'list_optional_multformat_cond.list_optional_multformat/${re.sub("[^\w\-_]", "_", $list_optional_multformat_cond.list_optional_multformat.element_identifier)}.$gxy2omsext($list_optional_multformat_cond.list_optional_multformat.ext)' + #end if #end if -#if $list_default_mandatory_noformat: +#if $list_default_mandatory_noformat_cond.list_default_mandatory_noformat: -list_default_mandatory_noformat - ${' '.join(["'list_default_mandatory_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_noformat) if f])} + #if $list_default_mandatory_noformat_cond.list_default_mandatory_noformat_select == "no" + ${' '.join(["'list_default_mandatory_noformat_cond.list_default_mandatory_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_noformat_cond.list_default_mandatory_noformat) if f])} + #else + 'list_default_mandatory_noformat_cond.list_default_mandatory_noformat/${re.sub("[^\w\-_]", "_", $list_default_mandatory_noformat_cond.list_default_mandatory_noformat.element_identifier)}.$gxy2omsext($list_default_mandatory_noformat_cond.list_default_mandatory_noformat.ext)' + #end if #end if -#if $list_default_optional_noformat: +#if $list_default_optional_noformat_cond.list_default_optional_noformat: -list_default_optional_noformat - ${' '.join(["'list_default_optional_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_noformat) if f])} + #if $list_default_optional_noformat_cond.list_default_optional_noformat_select == "no" + ${' '.join(["'list_default_optional_noformat_cond.list_default_optional_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_noformat_cond.list_default_optional_noformat) if f])} + #else + 'list_default_optional_noformat_cond.list_default_optional_noformat/${re.sub("[^\w\-_]", "_", $list_default_optional_noformat_cond.list_default_optional_noformat.element_identifier)}.$gxy2omsext($list_default_optional_noformat_cond.list_default_optional_noformat.ext)' + #end if #end if -#if $list_default_mandatory_oneformat: +#if $list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat: -list_default_mandatory_oneformat - ${' '.join(["'list_default_mandatory_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_oneformat) if f])} + #if $list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat_select == "no" + ${' '.join(["'list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat) if f])} + #else + 'list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat/${re.sub("[^\w\-_]", "_", $list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat.element_identifier)}.$gxy2omsext($list_default_mandatory_oneformat_cond.list_default_mandatory_oneformat.ext)' + #end if #end if -#if $list_default_optional_oneformat: +#if $list_default_optional_oneformat_cond.list_default_optional_oneformat: -list_default_optional_oneformat - ${' '.join(["'list_default_optional_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_oneformat) if f])} + #if $list_default_optional_oneformat_cond.list_default_optional_oneformat_select == "no" + ${' '.join(["'list_default_optional_oneformat_cond.list_default_optional_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_oneformat_cond.list_default_optional_oneformat) if f])} + #else + 'list_default_optional_oneformat_cond.list_default_optional_oneformat/${re.sub("[^\w\-_]", "_", $list_default_optional_oneformat_cond.list_default_optional_oneformat.element_identifier)}.$gxy2omsext($list_default_optional_oneformat_cond.list_default_optional_oneformat.ext)' + #end if #end if -#if $list_default_mandatory_multformat: +#if $list_default_mandatory_multformat_cond.list_default_mandatory_multformat: -list_default_mandatory_multformat - ${' '.join(["'list_default_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_multformat) if f])} + #if $list_default_mandatory_multformat_cond.list_default_mandatory_multformat_select == "no" + ${' '.join(["'list_default_mandatory_multformat_cond.list_default_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_mandatory_multformat_cond.list_default_mandatory_multformat) if f])} + #else + 'list_default_mandatory_multformat_cond.list_default_mandatory_multformat/${re.sub("[^\w\-_]", "_", $list_default_mandatory_multformat_cond.list_default_mandatory_multformat.element_identifier)}.$gxy2omsext($list_default_mandatory_multformat_cond.list_default_mandatory_multformat.ext)' + #end if #end if -#if $list_default_optional_multformat: +#if $list_default_optional_multformat_cond.list_default_optional_multformat: -list_default_optional_multformat - ${' '.join(["'list_default_optional_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_multformat) if f])} + #if $list_default_optional_multformat_cond.list_default_optional_multformat_select == "no" + ${' '.join(["'list_default_optional_multformat_cond.list_default_optional_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($list_default_optional_multformat_cond.list_default_optional_multformat) if f])} + #else + 'list_default_optional_multformat_cond.list_default_optional_multformat/${re.sub("[^\w\-_]", "_", $list_default_optional_multformat_cond.list_default_optional_multformat.element_identifier)}.$gxy2omsext($list_default_optional_multformat_cond.list_default_optional_multformat.ext)' + #end if #end if -test_section:sect_mandatory_noformat 'test_section.sect_mandatory_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_mandatory_noformat.element_identifier)}.$gxy2omsext($test_section.sect_mandatory_noformat.ext)' @@ -534,48 +774,96 @@ ${' '.join(["'list_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f 'test_section.sect_default_optional_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_default_optional_multformat.element_identifier)}.$gxy2omsext($test_section.sect_default_optional_multformat.ext)' #end if -test_section:sect_list_mandatory_noformat -${' '.join(["'test_section.sect_list_mandatory_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_noformat) if f])} -#if $test_section.sect_list_optional_noformat: +#if $test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat_select == "no" +${' '.join(["'test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat) if f])} +#else +'test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_noformat_cond.sect_list_mandatory_noformat.ext)' +#end if +#if $test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat: -test_section:sect_list_optional_noformat - ${' '.join(["'test_section.sect_list_optional_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_noformat) if f])} + #if $test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat_select == "no" + ${' '.join(["'test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat) if f])} + #else + 'test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_noformat_cond.sect_list_optional_noformat.ext)' + #end if #end if -test_section:sect_list_mandatory_oneformat -${' '.join(["'test_section.sect_list_mandatory_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_oneformat) if f])} -#if $test_section.sect_list_optional_oneformat: +#if $test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat_select == "no" +${' '.join(["'test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat) if f])} +#else +'test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_oneformat_cond.sect_list_mandatory_oneformat.ext)' +#end if +#if $test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat: -test_section:sect_list_optional_oneformat - ${' '.join(["'test_section.sect_list_optional_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_oneformat) if f])} + #if $test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat_select == "no" + ${' '.join(["'test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat) if f])} + #else + 'test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_oneformat_cond.sect_list_optional_oneformat.ext)' + #end if #end if -test_section:sect_list_mandatory_multformat -${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_multformat) if f])} -#if $test_section.sect_list_optional_multformat: +#if $test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat_select == "no" +${' '.join(["'test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat) if f])} +#else +'test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_multformat_cond.sect_list_mandatory_multformat.ext)' +#end if +#if $test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat: -test_section:sect_list_optional_multformat - ${' '.join(["'test_section.sect_list_optional_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_multformat) if f])} + #if $test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat_select == "no" + ${' '.join(["'test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat) if f])} + #else + 'test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_multformat_cond.sect_list_optional_multformat.ext)' + #end if #end if -#if $test_section.sect_list_default_mandatory_noformat: +#if $test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat: -test_section:sect_list_default_mandatory_noformat - ${' '.join(["'test_section.sect_list_default_mandatory_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat) if f])} + #if $test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat_select == "no" + ${' '.join(["'test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat) if f])} + #else + 'test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_noformat_cond.sect_list_default_mandatory_noformat.ext)' + #end if #end if -#if $test_section.sect_list_default_optional_noformat: +#if $test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat: -test_section:sect_list_default_optional_noformat - ${' '.join(["'test_section.sect_list_default_optional_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_noformat) if f])} + #if $test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat_select == "no" + ${' '.join(["'test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat) if f])} + #else + 'test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_noformat_cond.sect_list_default_optional_noformat.ext)' + #end if #end if -#if $test_section.sect_list_default_mandatory_oneformat: +#if $test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat: -test_section:sect_list_default_mandatory_oneformat - ${' '.join(["'test_section.sect_list_default_mandatory_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat) if f])} + #if $test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat_select == "no" + ${' '.join(["'test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat) if f])} + #else + 'test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_oneformat_cond.sect_list_default_mandatory_oneformat.ext)' + #end if #end if -#if $test_section.sect_list_default_optional_oneformat: +#if $test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat: -test_section:sect_list_default_optional_oneformat - ${' '.join(["'test_section.sect_list_default_optional_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_oneformat) if f])} + #if $test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat_select == "no" + ${' '.join(["'test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat) if f])} + #else + 'test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_oneformat_cond.sect_list_default_optional_oneformat.ext)' + #end if #end if -#if $test_section.sect_list_default_mandatory_multformat: +#if $test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat: -test_section:sect_list_default_mandatory_multformat - ${' '.join(["'test_section.sect_list_default_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat) if f])} + #if $test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat_select == "no" + ${' '.join(["'test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat) if f])} + #else + 'test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_multformat_cond.sect_list_default_mandatory_multformat.ext)' + #end if #end if -#if $test_section.sect_list_default_optional_multformat: +#if $test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat: -test_section:sect_list_default_optional_multformat - ${' '.join(["'test_section.sect_list_default_optional_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_multformat) if f])} + #if $test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat_select == "no" + ${' '.join(["'test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat) if f])} + #else + 'test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_multformat_cond.sect_list_default_optional_multformat.ext)' + #end if #end if -#if $adv_opts.adv_opts_selector=='advanced': +## advanced options -mandatory_noformat_adv 'adv_opts.mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.mandatory_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.mandatory_noformat_adv.ext)' #if $adv_opts.optional_noformat_adv: @@ -619,46 +907,94 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( 'adv_opts.default_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.default_optional_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.default_optional_multformat_adv.ext)' #end if -list_mandatory_noformat_adv - ${' '.join(["'adv_opts.list_mandatory_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_noformat_adv) if f])} - #if $adv_opts.list_optional_noformat_adv: + #if $adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv_select == "no" + ${' '.join(["'adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv) if f])} + #else + 'adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_mandatory_noformat_adv_cond.list_mandatory_noformat_adv.ext)' + #end if + #if $adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv: -list_optional_noformat_adv - ${' '.join(["'adv_opts.list_optional_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_noformat_adv) if f])} + #if $adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv_select == "no" + ${' '.join(["'adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv) if f])} + #else + 'adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_optional_noformat_adv_cond.list_optional_noformat_adv.ext)' + #end if #end if -list_mandatory_oneformat_adv - ${' '.join(["'adv_opts.list_mandatory_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_oneformat_adv) if f])} - #if $adv_opts.list_optional_oneformat_adv: + #if $adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv_select == "no" + ${' '.join(["'adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv) if f])} + #else + 'adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_mandatory_oneformat_adv_cond.list_mandatory_oneformat_adv.ext)' + #end if + #if $adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv: -list_optional_oneformat_adv - ${' '.join(["'adv_opts.list_optional_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_oneformat_adv) if f])} + #if $adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv_select == "no" + ${' '.join(["'adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv) if f])} + #else + 'adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_optional_oneformat_adv_cond.list_optional_oneformat_adv.ext)' + #end if #end if -list_mandatory_multformat_adv - ${' '.join(["'adv_opts.list_mandatory_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_multformat_adv) if f])} - #if $adv_opts.list_optional_multformat_adv: + #if $adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv_select == "no" + ${' '.join(["'adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv) if f])} + #else + 'adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_mandatory_multformat_adv_cond.list_mandatory_multformat_adv.ext)' + #end if + #if $adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv: -list_optional_multformat_adv - ${' '.join(["'adv_opts.list_optional_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_multformat_adv) if f])} + #if $adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv_select == "no" + ${' '.join(["'adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv) if f])} + #else + 'adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_optional_multformat_adv_cond.list_optional_multformat_adv.ext)' + #end if #end if - #if $adv_opts.list_default_mandatory_noformat_adv: + #if $adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv: -list_default_mandatory_noformat_adv - ${' '.join(["'adv_opts.list_default_mandatory_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_noformat_adv) if f])} + #if $adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv_select == "no" + ${' '.join(["'adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv) if f])} + #else + 'adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_mandatory_noformat_adv_cond.list_default_mandatory_noformat_adv.ext)' + #end if #end if - #if $adv_opts.list_default_optional_noformat_adv: + #if $adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv: -list_default_optional_noformat_adv - ${' '.join(["'adv_opts.list_default_optional_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_noformat_adv) if f])} + #if $adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv_select == "no" + ${' '.join(["'adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv) if f])} + #else + 'adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_optional_noformat_adv_cond.list_default_optional_noformat_adv.ext)' + #end if #end if - #if $adv_opts.list_default_mandatory_oneformat_adv: + #if $adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv: -list_default_mandatory_oneformat_adv - ${' '.join(["'adv_opts.list_default_mandatory_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_oneformat_adv) if f])} + #if $adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv_select == "no" + ${' '.join(["'adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv) if f])} + #else + 'adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_mandatory_oneformat_adv_cond.list_default_mandatory_oneformat_adv.ext)' + #end if #end if - #if $adv_opts.list_default_optional_oneformat_adv: + #if $adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv: -list_default_optional_oneformat_adv - ${' '.join(["'adv_opts.list_default_optional_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_oneformat_adv) if f])} + #if $adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv_select == "no" + ${' '.join(["'adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv) if f])} + #else + 'adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_optional_oneformat_adv_cond.list_default_optional_oneformat_adv.ext)' + #end if #end if - #if $adv_opts.list_default_mandatory_multformat_adv: + #if $adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv: -list_default_mandatory_multformat_adv - ${' '.join(["'adv_opts.list_default_mandatory_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_multformat_adv) if f])} + #if $adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv_select == "no" + ${' '.join(["'adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv) if f])} + #else + 'adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_mandatory_multformat_adv_cond.list_default_mandatory_multformat_adv.ext)' + #end if #end if - #if $adv_opts.list_default_optional_multformat_adv: + #if $adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv: -list_default_optional_multformat_adv - ${' '.join(["'adv_opts.list_default_optional_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_multformat_adv) if f])} + #if $adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv_select == "no" + ${' '.join(["'adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv) if f])} + #else + 'adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv.element_identifier)}.$gxy2omsext($adv_opts.list_default_optional_multformat_adv_cond.list_default_optional_multformat_adv.ext)' + #end if #end if -test_section:sect_mandatory_noformat_adv 'test_section.sect_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_mandatory_noformat_adv.ext)' @@ -703,48 +1039,96 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( 'test_section.sect_default_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_default_optional_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_default_optional_multformat_adv.ext)' #end if -test_section:sect_list_mandatory_noformat_adv - ${' '.join(["'test_section.sect_list_mandatory_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_noformat_adv) if f])} - #if $test_section.sect_list_optional_noformat_adv: + #if $test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv) if f])} + #else + 'test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_noformat_adv_cond.sect_list_mandatory_noformat_adv.ext)' + #end if + #if $test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv: -test_section:sect_list_optional_noformat_adv - ${' '.join(["'test_section.sect_list_optional_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_noformat_adv) if f])} + #if $test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv) if f])} + #else + 'test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_noformat_adv_cond.sect_list_optional_noformat_adv.ext)' + #end if #end if -test_section:sect_list_mandatory_oneformat_adv - ${' '.join(["'test_section.sect_list_mandatory_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_adv) if f])} - #if $test_section.sect_list_optional_oneformat_adv: + #if $test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv) if f])} + #else + 'test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_oneformat_adv_cond.sect_list_mandatory_oneformat_adv.ext)' + #end if + #if $test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv: -test_section:sect_list_optional_oneformat_adv - ${' '.join(["'test_section.sect_list_optional_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_oneformat_adv) if f])} + #if $test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv) if f])} + #else + 'test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_oneformat_adv_cond.sect_list_optional_oneformat_adv.ext)' + #end if #end if -test_section:sect_list_mandatory_multformat_adv - ${' '.join(["'test_section.sect_list_mandatory_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_multformat_adv) if f])} - #if $test_section.sect_list_optional_multformat_adv: + #if $test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv) if f])} + #else + 'test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_mandatory_multformat_adv_cond.sect_list_mandatory_multformat_adv.ext)' + #end if + #if $test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv: -test_section:sect_list_optional_multformat_adv - ${' '.join(["'test_section.sect_list_optional_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_multformat_adv) if f])} + #if $test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv) if f])} + #else + 'test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_optional_multformat_adv_cond.sect_list_optional_multformat_adv.ext)' + #end if #end if - #if $test_section.sect_list_default_mandatory_noformat_adv: + #if $test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv: -test_section:sect_list_default_mandatory_noformat_adv - ${' '.join(["'test_section.sect_list_default_mandatory_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_adv) if f])} + #if $test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv) if f])} + #else + 'test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_noformat_adv_cond.sect_list_default_mandatory_noformat_adv.ext)' + #end if #end if - #if $test_section.sect_list_default_optional_noformat_adv: + #if $test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv: -test_section:sect_list_default_optional_noformat_adv - ${' '.join(["'test_section.sect_list_default_optional_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_noformat_adv) if f])} + #if $test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv) if f])} + #else + 'test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_noformat_adv_cond.sect_list_default_optional_noformat_adv.ext)' + #end if #end if - #if $test_section.sect_list_default_mandatory_oneformat_adv: + #if $test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv: -test_section:sect_list_default_mandatory_oneformat_adv - ${' '.join(["'test_section.sect_list_default_mandatory_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_adv) if f])} + #if $test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv) if f])} + #else + 'test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_oneformat_adv_cond.sect_list_default_mandatory_oneformat_adv.ext)' + #end if #end if - #if $test_section.sect_list_default_optional_oneformat_adv: + #if $test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv: -test_section:sect_list_default_optional_oneformat_adv - ${' '.join(["'test_section.sect_list_default_optional_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_adv) if f])} + #if $test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv) if f])} + #else + 'test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_oneformat_adv_cond.sect_list_default_optional_oneformat_adv.ext)' + #end if #end if - #if $test_section.sect_list_default_mandatory_multformat_adv: + #if $test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv: -test_section:sect_list_default_mandatory_multformat_adv - ${' '.join(["'test_section.sect_list_default_mandatory_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_adv) if f])} + #if $test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv) if f])} + #else + 'test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_mandatory_multformat_adv_cond.sect_list_default_mandatory_multformat_adv.ext)' + #end if #end if - #if $test_section.sect_list_default_optional_multformat_adv: + #if $test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv: -test_section:sect_list_default_optional_multformat_adv - ${' '.join(["'test_section.sect_list_default_optional_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_multformat_adv) if f])} + #if $test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv_select == "no" + ${' '.join(["'test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv) if f])} + #else + 'test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv/${re.sub("[^\w\-_]", "_", $test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv.element_identifier)}.$gxy2omsext($test_section.sect_list_default_optional_multformat_adv_cond.sect_list_default_optional_multformat_adv.ext)' + #end if #end if -#end if + | tee '$stdout' ## Postprocessing @@ -768,18 +1152,150 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -793,18 +1309,150 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -817,18 +1465,150 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -843,18 +1623,150 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -873,30 +1785,306 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index 513188a..c7c1ed4 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -15,15 +15,23 @@ ## Preprocessing mkdir mandatory_mandatoryinput && -mkdir ${' '.join(["'mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} && -mkdir inp_mandatory_mandatoryinput && -mkdir ${' '.join(["'inp_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} && -${' '.join(["ln -s '%s' 'inp_mandatory_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} +mkdir ${' '.join(["'mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} && +mkdir inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput && +#if $inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput_select == "no" +mkdir ${' '.join(["'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} && +${' '.join(["ln -s '%s' 'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} +#else +ln -s '$inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput' 'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/${re.sub("[^\w\-_]", "_", $inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput.element_identifier)}.$gxy2omsext($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput.ext)' && +#end if mkdir test_section_sect_mandatory_mandatoryinput && -mkdir ${' '.join(["'test_section_sect_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])} && -mkdir test_section.sect_inp_mandatory_mandatoryinput && -mkdir ${' '.join(["'test_section.sect_inp_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])} && -${' '.join(["ln -s '%s' 'test_section.sect_inp_mandatory_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])} +mkdir ${' '.join(["'test_section_sect_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput) if f])} && +mkdir test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput && +#if $test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput_select == "no" +mkdir ${' '.join(["'test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput) if f])} && +${' '.join(["ln -s '%s' 'test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput) if f])} +#else +ln -s '$test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput' 'test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput/${re.sub("[^\w\-_]", "_", $test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput.element_identifier)}.$gxy2omsext($test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput.ext)' && +#end if ## Main program call @@ -32,17 +40,25 @@ set -o pipefail && python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hardcoded_json' && @EXECUTABLE@ -ini @EXECUTABLE@.ctd -mandatory_mandatoryinput -${' '.join(["'mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("tsv")) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} +${' '.join(["'mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("tsv")) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} -inp_mandatory_mandatoryinput -${' '.join(["'inp_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} +#if $inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput_select == "no" +${' '.join(["'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} +#else +'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/${re.sub("[^\w\-_]", "_", $inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput.element_identifier)}.$gxy2omsext($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput.ext)' +#end if -test_section:sect_mandatory_mandatoryinput -${' '.join(["'test_section_sect_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $test_section.sect_mandatory_mandatoryinput_type) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])} +${' '.join(["'test_section_sect_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $test_section.sect_mandatory_mandatoryinput_type) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput) if f])} -test_section:sect_inp_mandatory_mandatoryinput -${' '.join(["'test_section.sect_inp_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])} +#if $test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput_select == "no" +${' '.join(["'test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput) if f])} +#else +'test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput/${re.sub("[^\w\-_]", "_", $test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput.element_identifier)}.$gxy2omsext($test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput.ext)' +#end if ## Postprocessing -${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandatory_mandatoryinput/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("tsv")} for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} -${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s.%(omsext)s' 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "omsext":$test_section.sect_mandatory_mandatoryinput_type, "gext": $oms2gxyext(str($test_section.sect_mandatory_mandatoryinput_type))} for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])} +${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandatory_mandatoryinput/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("tsv")} for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} +${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s.%(omsext)s' 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "omsext":$test_section.sect_mandatory_mandatoryinput_type, "gext": $oms2gxyext(str($test_section.sect_mandatory_mandatoryinput_type))} for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput_cond.sect_inp_mandatory_mandatoryinput) if f])} #if "ctd_out_FLAG" in $OPTIONAL_OUTPUTS && mv '@EXECUTABLE@.ctd' '$ctd_out' #end if]]> @@ -56,7 +72,18 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - + + + + + + + + + + + +
@@ -64,7 +91,18 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - + + + + + + + + + + + +
@@ -85,13 +123,28 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - + + + + + + + + +
- + + + + + + + + +
- - +
diff --git a/tests/test-data/ofile-mult.xml b/tests/test-data/ofile-mult.xml index 15c52e5..7e2b625 100644 --- a/tests/test-data/ofile-mult.xml +++ b/tests/test-data/ofile-mult.xml @@ -15,17 +15,25 @@ ## Preprocessing mkdir mandatory_mandatoryinput && -mkdir ${' '.join(["'mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} && +mkdir ${' '.join(["'mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} && #if "optional_mandatoryinput_FLAG" in str($OPTIONAL_OUTPUTS).split(',') mkdir optional_mandatoryinput && - mkdir ${' '.join(["'optional_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_optional_mandatoryinput) if f])} && + mkdir ${' '.join(["'optional_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput) if f])} && +#end if +mkdir inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput && +#if $inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput_select == "no" +mkdir ${' '.join(["'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} && +${' '.join(["ln -s '%s' 'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} +#else +ln -s '$inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput' 'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/${re.sub("[^\w\-_]", "_", $inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput.element_identifier)}.$gxy2omsext($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput.ext)' && +#end if +mkdir inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput && +#if $inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput_select == "no" +mkdir ${' '.join(["'inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput) if f])} && +${' '.join(["ln -s '%s' 'inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput) if f])} +#else +ln -s '$inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput' 'inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput/${re.sub("[^\w\-_]", "_", $inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput.element_identifier)}.$gxy2omsext($inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput.ext)' && #end if -mkdir inp_mandatory_mandatoryinput && -mkdir ${' '.join(["'inp_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} && -${' '.join(["ln -s '%s' 'inp_mandatory_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} -mkdir inp_optional_mandatoryinput && -mkdir ${' '.join(["'inp_optional_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_optional_mandatoryinput) if f])} && -${' '.join(["ln -s '%s' 'inp_optional_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_optional_mandatoryinput) if f])} ## Main program call @@ -34,23 +42,31 @@ set -o pipefail && python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hardcoded_json' && @EXECUTABLE@ -ini @EXECUTABLE@.ctd -mandatory_mandatoryinput -${' '.join(["'mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("tsv")) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} +${' '.join(["'mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("tsv")) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} #if "optional_mandatoryinput_FLAG" in str($OPTIONAL_OUTPUTS).split(',') -optional_mandatoryinput - ${' '.join(["'optional_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("tsv")) for i, f in enumerate($inp_optional_mandatoryinput) if f])} + ${' '.join(["'optional_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("tsv")) for i, f in enumerate($inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput) if f])} #end if -inp_mandatory_mandatoryinput -${' '.join(["'inp_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} +#if $inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput_select == "no" +${' '.join(["'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} +#else +'inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput/${re.sub("[^\w\-_]", "_", $inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput.element_identifier)}.$gxy2omsext($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput.ext)' +#end if -inp_optional_mandatoryinput -${' '.join(["'inp_optional_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_optional_mandatoryinput) if f])} +#if $inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput_select == "no" +${' '.join(["'inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput) if f])} +#else +'inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput/${re.sub("[^\w\-_]", "_", $inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput.element_identifier)}.$gxy2omsext($inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput.ext)' +#end if #if len(str($OPTIONAL_OUTPUTS).split(',')) == 0 | tee '$stdout' #end if ## Postprocessing -${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandatory_mandatoryinput/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("tsv")} for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} +${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandatory_mandatoryinput/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("tsv")} for i, f in enumerate($inp_mandatory_mandatoryinput_cond.inp_mandatory_mandatoryinput) if f])} #if "optional_mandatoryinput_FLAG" in str($OPTIONAL_OUTPUTS).split(',') - ${' '.join(["&& mv -n 'optional_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'optional_mandatoryinput/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("tsv")} for i, f in enumerate($inp_optional_mandatoryinput) if f])} + ${' '.join(["&& mv -n 'optional_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'optional_mandatoryinput/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("tsv")} for i, f in enumerate($inp_optional_mandatoryinput_cond.inp_optional_mandatoryinput) if f])} #end if #if "ctd_out_FLAG" in $OPTIONAL_OUTPUTS && mv '@EXECUTABLE@.ctd' '$ctd_out' @@ -60,8 +76,30 @@ ${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandato - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -82,10 +120,25 @@ ${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandato - - -
-
+ + + + + + + + + + + + + + + + + + +
From 6178f56de823c4b22732d93ce2b3dfd2fc9a23b0 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 1 Nov 2023 14:31:23 +0100 Subject: [PATCH 29/36] fixup: for batch mode test data generation needs to remove whens and set the select parameter --- ctdconverter/galaxy/converter.py | 24 ++- tests/test-data/ifile.xml | 192 ++++------------------- tests/test-data/ofile-mult-typeparam.xml | 14 +- tests/test-data/ofile-mult.xml | 14 +- tests/test-data/test-data/24test.ext | 1 + tests/test-data/test-data/24test2.ext | 1 + tests/test-data/test-data/25test.ext | 1 + tests/test-data/test-data/25test2.ext | 1 + tests/test-data/test-data/26test.ext | 1 + tests/test-data/test-data/26test2.ext | 1 + tests/test-data/test-data/27test.ext | 1 + tests/test-data/test-data/28test.ext | 1 + tests/test-data/test-data/29test.ext | 1 + tests/test-data/test-data/30test.ext | 1 + tests/test-data/test-data/31test.ext | 1 + tests/test-data/test-data/32test.ext | 1 + tests/test-data/test-data/33test.ext | 1 + tests/test-data/test-data/34test.ext | 1 + tests/test-data/test-data/35test.ext | 1 + 19 files changed, 70 insertions(+), 189 deletions(-) create mode 120000 tests/test-data/test-data/24test.ext create mode 120000 tests/test-data/test-data/24test2.ext create mode 120000 tests/test-data/test-data/25test.ext create mode 120000 tests/test-data/test-data/25test2.ext create mode 120000 tests/test-data/test-data/26test.ext create mode 120000 tests/test-data/test-data/26test2.ext create mode 120000 tests/test-data/test-data/27test.ext create mode 120000 tests/test-data/test-data/28test.ext create mode 120000 tests/test-data/test-data/29test.ext create mode 120000 tests/test-data/test-data/30test.ext create mode 120000 tests/test-data/test-data/31test.ext create mode 120000 tests/test-data/test-data/32test.ext create mode 120000 tests/test-data/test-data/33test.ext create mode 120000 tests/test-data/test-data/34test.ext create mode 120000 tests/test-data/test-data/35test.ext diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index bce1c58..443bbb0 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -4,6 +4,7 @@ import logging import os import os.path +import random import re import sys from collections import OrderedDict @@ -51,6 +52,8 @@ REQUIRED_MACROS = [REQUIREMENTS_MACRO_NAME, STDIO_MACRO_NAME, ADVANCED_OPTIONS_NAME + "_macro"] +random.seed(42) + class ExitCode: def __init__(self, code_range="", level="", description=None): @@ -1749,14 +1752,27 @@ def create_tests(parent, inputs=None, outputs=None): for a in attrib: del node.attrib[a] node.attrib[a] = attrib[a] + # this should be batch mode conditionals + # select yes/no at random + if node.tag == "conditional": + select = node.find("./param") + options = [x.attrib["value"] for x in select.findall("./option")] + option = random.choice(options) + select.attrib["value"] = option + for when in node.findall(".//when"): + when.tag = "delete_node" + if when.attrib["value"] != option: + continue + for p in when: + node.append(p) + if node.tag == "expand" and node.attrib["macro"] == ADVANCED_OPTIONS_NAME + "_macro": node.tag = "section" node.attrib["name"] = ADVANCED_OPTIONS_NAME if "type" not in node.attrib: continue - if (node.attrib["type"] == "select" and "true" in {_.attrib.get("selected", "false") for _ in node}) or\ - (node.attrib["type"] == "select" and node.attrib.get("value", "") != ""): + if node.attrib["type"] == "select" and node.getparent().tag != "conditional" and (("true" in {_.attrib.get("selected", "false") for _ in node}) or (node.attrib.get("value", "") != "")): node.tag = "delete_node" continue @@ -1777,7 +1793,9 @@ def create_tests(parent, inputs=None, outputs=None): elif node.attrib["type"] == "float" and node.attrib["value"] == "": node.attrib["value"] = "1.0" elif node.attrib["type"] == "select": - if node.attrib.get("display", None) == "radio" or node.attrib.get("multiple", "false") == "false": + if node.getparent().tag == "conditional": # set batch mode conditional select, this is done elsewhere + pass + elif node.attrib.get("display", None) == "radio" or node.attrib.get("multiple", "false") == "false": node.attrib["value"] = node[0].attrib["value"] elif node.attrib.get("multiple", None) == "true": node.attrib["value"] = ",".join([_.attrib["value"] for _ in node if "value" in _.attrib]) diff --git a/tests/test-data/ifile.xml b/tests/test-data/ifile.xml index 130ea74..6299adc 100644 --- a/tests/test-data/ifile.xml +++ b/tests/test-data/ifile.xml @@ -1787,75 +1787,42 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat_cond.sect_list_mandato - - - - - - + - - - - - - - - - + + - - - - - - - - + - - - - - - - - - + - - - - - -
@@ -1863,150 +1830,84 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat_cond.sect_list_mandato - - - - - - + - - - - - - - - + - - - - - - - - - + + - - - - - + - - - + - - - - - - - + - - - + - - - - - - - + + - - - - - - - - + - - - + - - - - - - + - - - - - + - - - - - + - - - + - - - + - -
@@ -2014,76 +1915,43 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat_cond.sect_list_mandato - - - - - - - + + - - - - - - - - - + + - - - - - - - - - + + - - - + - - - - - - - - - - - + - -
diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index c7c1ed4..adc9da3 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -125,23 +125,13 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - - - - - - +
- - - - - - +
diff --git a/tests/test-data/ofile-mult.xml b/tests/test-data/ofile-mult.xml index 7e2b625..fe569dd 100644 --- a/tests/test-data/ofile-mult.xml +++ b/tests/test-data/ofile-mult.xml @@ -122,21 +122,11 @@ ${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandato - - - - - - + - - - - - - +
diff --git a/tests/test-data/test-data/24test.ext b/tests/test-data/test-data/24test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/24test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/24test2.ext b/tests/test-data/test-data/24test2.ext new file mode 120000 index 0000000..f6d8b81 --- /dev/null +++ b/tests/test-data/test-data/24test2.ext @@ -0,0 +1 @@ +test2.ext \ No newline at end of file diff --git a/tests/test-data/test-data/25test.ext b/tests/test-data/test-data/25test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/25test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/25test2.ext b/tests/test-data/test-data/25test2.ext new file mode 120000 index 0000000..f6d8b81 --- /dev/null +++ b/tests/test-data/test-data/25test2.ext @@ -0,0 +1 @@ +test2.ext \ No newline at end of file diff --git a/tests/test-data/test-data/26test.ext b/tests/test-data/test-data/26test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/26test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/26test2.ext b/tests/test-data/test-data/26test2.ext new file mode 120000 index 0000000..f6d8b81 --- /dev/null +++ b/tests/test-data/test-data/26test2.ext @@ -0,0 +1 @@ +test2.ext \ No newline at end of file diff --git a/tests/test-data/test-data/27test.ext b/tests/test-data/test-data/27test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/27test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/28test.ext b/tests/test-data/test-data/28test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/28test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/29test.ext b/tests/test-data/test-data/29test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/29test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/30test.ext b/tests/test-data/test-data/30test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/30test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/31test.ext b/tests/test-data/test-data/31test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/31test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/32test.ext b/tests/test-data/test-data/32test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/32test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/33test.ext b/tests/test-data/test-data/33test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/33test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/34test.ext b/tests/test-data/test-data/34test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/34test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file diff --git a/tests/test-data/test-data/35test.ext b/tests/test-data/test-data/35test.ext new file mode 120000 index 0000000..769e133 --- /dev/null +++ b/tests/test-data/test-data/35test.ext @@ -0,0 +1 @@ +test.ext \ No newline at end of file From 1bad1ac4c63803ad842ba69f2c2bdcc9c8925347 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 8 Jan 2024 16:21:02 +0100 Subject: [PATCH 30/36] fix test generation - remove XML declaration from output - indent XML --- ctdconverter/galaxy/converter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 443bbb0..53d192a 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -486,6 +486,8 @@ def _convert_internal(parsed_ctds, **kwargs): outputs = create_outputs(tool, model, **kwargs) if kwargs["test_test"]: create_tests(tool, inputs=copy.deepcopy(inputs), outputs=copy.deepcopy(outputs)) + else: + add_child_node(tool, "tests") create_help(tool, model) # citations are required to be at the end @@ -495,8 +497,8 @@ def _convert_internal(parsed_ctds, **kwargs): # wrap our tool element into a tree to be able to serialize it tree = ElementTree(tool) logging.info("Writing to %s" % utils.get_filename(output_file)) - tree.write(output_file, encoding="UTF-8", xml_declaration=True, pretty_print=True) - + etree.indent(tree) + tree.write(output_file, encoding="UTF-8", pretty_print=True) def write_header(tool, model): """ @@ -843,14 +845,12 @@ def add_macros(tool, model, test_macros_prefix=None, test_macros_file_names=None return tool_id = model.name.replace(" ", "_") tests_node = tool.find(".//tests") - for macros_file, macros_prefix in zip(test_macros_file_names, test_macros_prefix): macros_root = parse(macros_file) tool_tests = macros_root.find(f".//xml[@name='{macros_prefix}{tool_id}']") for test in tool_tests: tests_node.append(test) - def expand_macro(node, macro, attribs=None): """Add to node.""" expand_node = add_child_node(node, "expand") @@ -1148,7 +1148,7 @@ def get_formats(param, model, o2g): def get_galaxy_formats(param, model, o2g, default=None): """ determine galaxy formats for a parm (i.e. list of allowed Galaxy extensions) - from the CTD restictions (i.e. the OpenMS extensions) + from the CTD restrictions (i.e. the OpenMS extensions) - if there is a single one, then take this - if there is none than use given default """ From b8c2fc15c1ed7ec28e39f99134ba92bb4d255500 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Fri, 12 Apr 2024 12:27:21 +0200 Subject: [PATCH 31/36] some fixes --- ctdconverter/galaxy/converter.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 53d192a..4b348bb 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1967,7 +1967,7 @@ def create_test_only(model, **kwargs): except KeyError: param.default = _Null() - if is_selection_parameter(param) and type(param.default) is _Null: + if (is_selection_parameter(param) or param.is_list) and type(param.default) is _Null: value = None elif param.is_list and type(param.default) is not _Null: if param.type is _InFile: @@ -2001,26 +2001,32 @@ def create_test_only(model, **kwargs): if param.is_list: nd = add_child_node(test, "output_collection", OrderedDict([("name", name), ("count", value)])) else: - nd = add_child_node(test, "output", OrderedDict([("name", name), ("file", value)])) - for tc in test_condition: - nd.attrib[tc[0]] = tc[1] - if ext: - nd.attrib["ftype"] = ext + if value: + # nd = add_child_node(test, "output", OrderedDict([("name", name), ("location", f"@TEST_DATA_LOCATION@{value}")])) + nd = add_child_node(test, "output", OrderedDict([("name", name), ("value", value)])) + for tc in test_condition: + nd.attrib[tc[0]] = tc[1] + if ext: + nd.attrib["ftype"] = ext elif param.type is _OutPrefix: # #for outprefix elements / count need to be added manually name = get_galaxy_parameter_path(param, separator="_") nd = add_child_node(test, "output_collection", OrderedDict([("name", name), ("count", "")])) else: name = get_galaxy_parameter_name(param) - nd = add_child_node(parent, "param", OrderedDict([("name", name)])) if value is not None: - nd.attrib["value"] = value + nd = add_child_node(parent, "param", OrderedDict([("name", name), ("value", value)])) + # if param.type is _InFile: + # nd.attrib["location"] = "@TEST_DATA_LOCATION@" + nd.attrib["value"] + # add format attribute for unsniffable extensions if param.type is _InFile: ext = os.path.splitext(value)[1][1:] if ext in unsniffable and ext in o2g: nd.attrib["ftype"] = o2g[ext] + + add_child_node(test, "param", OrderedDict([("name", "OPTIONAL_OUTPUTS"), ("value", ",".join(optout))])) ctd_out = add_child_node(test, "output", OrderedDict([("name", "ctd_out"), ("ftype", "xml")])) @@ -2032,6 +2038,11 @@ def create_test_only(model, **kwargs): nd = add_child_node(test, "output", OrderedDict([("name", "stdout"), ("value", "stdout.txt"), ("compare", "sim_size")])) + + # add a stdout assertion + stdout_assert = add_child_node(test, "assert_stdout") + stdout_has_text = add_child_node(stdout_assert, "has_text_matching", OrderedDict([("expression", "@EXECUTABLE@ took .* \(wall\), .* \(CPU\), .* \(system\), .* \(user\)(; Peak Memory Usage: 32 MB)?.")])) + test.attrib["expect_num_outputs"] = str(outcnt) # if all_optional_outputs(model, parameter_hardcoder): return test From e69cca9b314f89c43c4f3bdca5e01bfbc254e047 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Fri, 12 Apr 2024 12:29:01 +0200 Subject: [PATCH 32/36] copy input files instead of symlinking --- ctdconverter/galaxy/converter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 4b348bb..b87bbe8 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -655,12 +655,13 @@ def create_command(tool, model, **kwargs): # this leads to conflicts while linking... might also be better in general if param.type is _InFile: param_cmd['preprocessing'].append("mkdir %s &&" % actual_parameter) + # TODO we copy input files to the JWD because of https://github.com/OpenMS/OpenMS/issues/7439 if param.is_list: param_cmd['preprocessing'].append(f'#if ${_actual_parameter}_select == "no"') param_cmd['preprocessing'].append(f"mkdir ${{' '.join([\"'{actual_parameter}/%s'\" % (i) for i, f in enumerate(${_actual_parameter}) if f])}} && ") - param_cmd['preprocessing'].append(f"${{' '.join([\"ln -s '%s' '{actual_parameter}/%s/%s.%s' && \" % (f, i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}) if f])}}") + param_cmd['preprocessing'].append(f"${{' '.join([\"cp '%s' '{actual_parameter}/%s/%s.%s' && \" % (f, i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}) if f])}}") param_cmd['preprocessing'].append('#else') - param_cmd['preprocessing'].append(f"ln -s '${_actual_parameter}' '{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}.ext)' &&") + param_cmd['preprocessing'].append(f"cp '${_actual_parameter}' '{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}.ext)' &&") param_cmd['preprocessing'].append('#end if') param_cmd['command'].append(f'#if ${actual_parameter}_select == "no"') param_cmd['command'].append(f"${{' '.join([\"'{actual_parameter}/%s/%s.%s'\"%(i, re.sub('[^\\w\\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate(${_actual_parameter}) if f])}}") @@ -668,7 +669,7 @@ def create_command(tool, model, **kwargs): param_cmd['command'].append(f"'{actual_parameter}/${{re.sub(\"[^\\w\\-_]\", \"_\", ${_actual_parameter}.element_identifier)}}.$gxy2omsext(${_actual_parameter}.ext)'") param_cmd['command'].append('#end if') else: - param_cmd['preprocessing'].append("ln -s '$" + _actual_parameter + "' '" + actual_parameter + "/${re.sub(\"[^\\w\\-_]\", \"_\", $" + _actual_parameter + ".element_identifier)}.$gxy2omsext($" + _actual_parameter + ".ext)' &&") + param_cmd['preprocessing'].append("cp '$" + _actual_parameter + "' '" + actual_parameter + "/${re.sub(\"[^\\w\\-_]\", \"_\", $" + _actual_parameter + ".element_identifier)}.$gxy2omsext($" + _actual_parameter + ".ext)' &&") param_cmd['command'].append("'" + actual_parameter + "/${re.sub(\"[^\\w\\-_]\", \"_\", $" + _actual_parameter + ".element_identifier)}.$gxy2omsext($" + _actual_parameter + ".ext)'") elif param.type is _OutPrefix: From dff88f3b4480b6a4b8ca3039a9505ba08d4bcd5a Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 6 Jun 2024 10:31:44 +0200 Subject: [PATCH 33/36] also do not make output_prefix parameters advanced --- ctdconverter/galaxy/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index b87bbe8..8731213 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -881,7 +881,7 @@ def get_galaxy_parameter_path(param, separator=".", suffix=None, fix_underscore= path = utils.extract_param_path(param, fix_underscore) if len(path) > 1: path = path[:-1] + [p] - elif param.advanced and (param.type is not _OutFile or suffix): + elif param.advanced and (param.type is not _OutFile and param.type is not _OutPrefix or suffix): path = [ADVANCED_OPTIONS_NAME, p] else: path = [p] From fb5a6c5b0b6169790fa32eced5839f13986bba93 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Fri, 14 Jun 2024 10:05:16 +0200 Subject: [PATCH 34/36] better support for out_prefix and do not use checkboxes/radio --- ctdconverter/galaxy/converter.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 8731213..abfda65 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1246,11 +1246,6 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ if is_selection_parameter(param): if param.is_list: param_node.attrib["multiple"] = "true" - if len(param.restrictions.choices) < 5: - if param.is_list and optional: - param_node.attrib["display"] = "checkboxes" - elif not param.is_list and not optional: - param_node.attrib["display"] = "radio" # check for parameters with restricted values (which will correspond to a "select" in galaxy) if param.restrictions is not None or param_type == "boolean": @@ -1682,7 +1677,9 @@ def create_output_node(parent, param, model, supported_file_formats, parameter_h discover_node.attrib["pattern"] = "__name_and_ext__" elif corresponding_input is not None: logging.info(f"OUTPUT {param.name} input {corresponding_input.name}") - if param.is_list: + if param.is_list or param.type is _OutPrefix: + # TODO like for the else branch format_source would be better: + # with https://github.com/galaxyproject/galaxy/pull/9493 discover_node.attrib["pattern"] = "__name_and_ext__" # data_node.attrib["structured_like"] = get_galaxy_parameter_name(corresponding_input) # data_node.attrib["inherit_format"] = "true" @@ -1796,7 +1793,7 @@ def create_tests(parent, inputs=None, outputs=None): elif node.attrib["type"] == "select": if node.getparent().tag == "conditional": # set batch mode conditional select, this is done elsewhere pass - elif node.attrib.get("display", None) == "radio" or node.attrib.get("multiple", "false") == "false": + elif node.attrib.get("multiple", "false") == "false": node.attrib["value"] = node[0].attrib["value"] elif node.attrib.get("multiple", None) == "true": node.attrib["value"] = ",".join([_.attrib["value"] for _ in node if "value" in _.attrib]) From 767f14814a4037381806adfcd898d1bed01d5c89 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 17 Jun 2024 09:38:14 +0200 Subject: [PATCH 35/36] ommit optional if default --- ctdconverter/galaxy/converter.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index abfda65..2ed6714 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1063,7 +1063,6 @@ def create_inputs(tool, model, **kwargs): fmt_select_attrib = OrderedDict([ ("name", param.name + "_type"), ("type", "select"), - ("optional", "false"), ("label", f"File type of output {param.name} ({param.description})") ]) fmt_select = add_child_node(parent_node, "param", fmt_select_attrib) @@ -1241,11 +1240,21 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ optional = False else: optional = not param.required - param_node.attrib["optional"] = str(optional).lower() - if is_selection_parameter(param): - if param.is_list: - param_node.attrib["multiple"] = "true" + # set multiple for select parameters if needed + # also set optional if it's not the default + # - for select with multiple=true optional defaults to true, i.e. we set it if the parameter is not optional + # - never set it for bool + # - otherwise the default is false, i.e. we set the attribute if the parameter is optional + if is_selection_parameter(param) and param.is_list: + param_node.attrib["multiple"] = "true" + if not optional: + param_node.attrib["optional"] = str(optional).lower() + if param_type == "boolean": + pass + else: + if optional: + param_node.attrib["optional"] = str(optional).lower() # check for parameters with restricted values (which will correspond to a "select" in galaxy) if param.restrictions is not None or param_type == "boolean": @@ -1278,8 +1287,8 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ if is_default(choice, param): option_node.attrib["selected"] = "true" - # add validator to check that "nothing selected" is not seletcedto mandatory options w/o default - if param_node.attrib["optional"] == "False" and (param.default is None or type(param.default) is _Null): + # add validator to check that "nothing selected" is not seleted to mandatory options w/o default + if param_node.attrib.get("optional", "false") in ["false", "False"] and (param.default is None or type(param.default) is _Null): validator_node = add_child_node(param_node, "validator", OrderedDict([("type", "expression"), ("message", "A value needs to be selected")])) validator_node.text = 'value != "select a value"' @@ -1412,7 +1421,7 @@ def create_param_attribute_list(param, model, supported_file_formats, parameter_ when_no = add_child_node(conditional, "when", attributes={"value": "no"}) when_no.append(copy.deepcopy(param_node)) when_yes = add_child_node(conditional, "when", attributes={"value": "yes"}) - param_node.attrib["multiple"] = "false" + del param_node.attrib["multiple"] when_yes.append(param_node) return conditional From f2300694a93edbd84cb197db55b9e96b9acef720 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 24 Nov 2024 18:27:56 +0100 Subject: [PATCH 36/36] imporve prefix mapping some OpenMS tools have parameters with the same name (different sections). This creates problems in Galaxy. workaround is to hardcode a unique prefix. Before _ was used which now creates problems with the tool linting (parameters are not supposed to start with _). Hence we now use prefix of the form DEDUP_[0-9]+_DEDUP_ --- ctdconverter/common/utils.py | 66 +++++--------------------------- ctdconverter/galaxy/converter.py | 19 ++++----- 2 files changed, 19 insertions(+), 66 deletions(-) diff --git a/ctdconverter/common/utils.py b/ctdconverter/common/utils.py index 5ff7287..dd8f521 100644 --- a/ctdconverter/common/utils.py +++ b/ctdconverter/common/utils.py @@ -4,6 +4,7 @@ import ntpath import operator import os +import re from functools import reduce from CTDopts.CTDopts import ( @@ -374,72 +375,23 @@ def extract_and_flatten_parameters(ctd_model, nodes=False): # return reversed(parameters) -# some parameters are mapped to command line options, this method helps resolve those mappings, if any -def resolve_param_mapping(param, ctd_model, fix_underscore=False): - # go through all mappings and find if the given param appears as a reference name in a mapping element - param_mapping = None - ctd_model_cli = [] - if hasattr(ctd_model, "cli"): - ctd_model_cli = ctd_model.cli - - for cli_element in ctd_model_cli: - for mapping_element in cli_element.mappings: - if mapping_element.reference_name == param.name: - if param_mapping is not None: - logging.warning("The parameter %s has more than one mapping in the section. " - "The first found mapping, %s, will be used." % (param.name, param_mapping)) - else: - param_mapping = cli_element.option_identifier - if param_mapping is not None: - ret = param_mapping - else: - ret = param.name - if fix_underscore and ret.startswith("_"): - return ret[1:] - else: - return ret - - -def _extract_param_cli_name(param, ctd_model, fix_underscore=False): - # we generate parameters with colons for subgroups, but not for the two topmost parents (OpenMS legacy) - if type(param.parent) == ParameterGroup: - if hasattr(ctd_model, "cli") and ctd_model.cli: - logging.warning("Using nested parameter sections (NODE elements) is not compatible with ") - return ":".join(extract_param_path(param, fix_underscore)[:-1]) + ":" + resolve_param_mapping(param, ctd_model, fix_underscore) - else: - return resolve_param_mapping(param, ctd_model, fix_underscore) - - -def extract_param_path(param, fix_underscore=False): +def extract_param_path(param, fix_dedup_prefix=False): pl = param.get_lineage(name_only=True) - if fix_underscore: + if fix_dedup_prefix: for i, p in enumerate(pl): - if p.startswith("_"): - pl[i] = pl[i][1:] + dedup_match = re.match("DEDUP_[0-9]+_DEDUP_(.*)", p) + if dedup_match: + pl[i] = dedup_match.group(1) return pl -# if type(param.parent) == ParameterGroup or type(param.parent) == Parameters: -# if not hasattr(param.parent.parent, "parent"): -# return [param.name] -# elif not hasattr(param.parent.parent.parent, "parent"): -# return [param.name] -# else: -# return extract_param_path(param.parent) + [param.name] -# else: -# return [param.name] -def extract_param_name(param, fix_underscore=False): +def extract_param_name(param, fix_dedup_prefix=False): # we generate parameters with colons for subgroups, but not for the two topmost parents (OpenMS legacy) - return ":".join(extract_param_path(param, fix_underscore)) + return ":".join(extract_param_path(param, fix_dedup_prefix)) def extract_command_line_prefix(param, ctd_model): - param_name = extract_param_name(param, True) - param_cli_name = _extract_param_cli_name(param, ctd_model, True) - if param_name == param_cli_name: - # there was no mapping, so for the cli name we will use a '-' in the prefix - param_cli_name = "-" + param_name - return param_cli_name + return "-" + extract_param_name(param, True) def indent(s, indentation=" "): diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 2ed6714..75e609c 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -643,7 +643,7 @@ def create_command(tool, model, **kwargs): # in the else branch the parameter is neither blacklisted nor hardcoded... _actual_parameter = get_galaxy_parameter_path(param) - actual_parameter = get_galaxy_parameter_path(param, fix_underscore=True) + actual_parameter = get_galaxy_parameter_path(param, fix_dedup_prefix=True) # all but bool params need the command line argument (bools have it already in the true/false value) if param.type is _OutFile or param.type is _OutPrefix or param.type is _InFile: param_cmd['command'].append(command_line_prefix) @@ -677,7 +677,7 @@ def create_command(tool, model, **kwargs): param_cmd['command'].append(actual_parameter + "/") elif param.type is _OutFile: _actual_parameter = get_galaxy_parameter_path(param, separator="_") - actual_parameter = get_galaxy_parameter_path(param, separator="_", fix_underscore=True) + actual_parameter = get_galaxy_parameter_path(param, separator="_", fix_dedup_prefix=True) # check if there is a parameter that sets the format # if so we add an extension to the generated files which will be used to # determine the format in the output tag @@ -774,7 +774,7 @@ def create_command(tool, model, **kwargs): # need no if (otherwise the empty string could not be provided) if not (param.required or is_boolean_parameter(param) or (param.type is str and param.restrictions is None)): # and not(param.type is _InFile and param.is_list): - actual_parameter = get_galaxy_parameter_path(param, suffix="FLAG", fix_underscore=True) + actual_parameter = get_galaxy_parameter_path(param, suffix="FLAG", fix_dedup_prefix=True) _actual_parameter = get_galaxy_parameter_path(param, suffix="FLAG") for stage in param_cmd: if len(param_cmd[stage]) == 0: @@ -871,14 +871,14 @@ def expand_macros(node, macros_to_expand): expand_node.attrib["macro"] = expand_macro -def get_galaxy_parameter_path(param, separator=".", suffix=None, fix_underscore=False): +def get_galaxy_parameter_path(param, separator=".", suffix=None, fix_dedup_prefix=False): """ Get the complete path for a parameter as a string where the path components are joined by the given separator. A given suffix can be appended """ - p = get_galaxy_parameter_name(param, suffix, fix_underscore) - path = utils.extract_param_path(param, fix_underscore) + p = get_galaxy_parameter_name(param, suffix, fix_dedup_prefix) + path = utils.extract_param_path(param, fix_dedup_prefix) if len(path) > 1: path = path[:-1] + [p] elif param.advanced and (param.type is not _OutFile and param.type is not _OutPrefix or suffix): @@ -892,7 +892,7 @@ def get_galaxy_parameter_path(param, separator=".", suffix=None, fix_underscore= return separator.join(path).replace("-", "_") -def get_galaxy_parameter_name(param, suffix=None, fix_underscore=False): +def get_galaxy_parameter_name(param, suffix=None, fix_dedup_prefix=False): """ get the name of the parameter used in the galaxy tool - replace : and - by _ @@ -906,8 +906,9 @@ def get_galaxy_parameter_name(param, suffix=None, fix_underscore=False): @return the name used for the parameter in the tool form """ p = param.name.replace("-", "_") - if fix_underscore and p.startswith("_"): - p = p[1:] + dedup_match = re.match("DEDUP_[0-9]+_DEDUP_(.*)", p) + if fix_dedup_prefix and dedup_match: + p = dedup_match.group(1) if param.type is _OutFile and suffix is not None: return f"{p}_{suffix}" else: