Skip to content

Commit

Permalink
Merge pull request #537 from lognaturel/v1.5.1
Browse files Browse the repository at this point in the history
Prepare v1.5.1 release
  • Loading branch information
yanokwa authored May 18, 2021
2 parents 3184e9d + 13ee243 commit d054d38
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Pyxform Changelog

# v1.5.1, 2021-05-18

* #535 Don't check for dynamic label if there is no label
* Hélène Martin @lognaturel (ODK)
* #536 Expand refs in predicates using current() even if preceded by whitespace
* Agus Hilman @gushil (OpenClinica)

# v1.5.0, 2021-04-16

* #521 Use itext for dynamic selects with dynamic labels
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
===============
pyxform v1.5.0
pyxform v1.5.1
===============

|circleci| |appveyor| |codecov| |black|
Expand Down
2 changes: 1 addition & 1 deletion pyxform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Collect easy.
"""

__version__ = "1.5.0"
__version__ = "1.5.1"

from pyxform.builder import (
SurveyElementBuilder,
Expand Down
20 changes: 10 additions & 10 deletions pyxform/tests_v1/test_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,14 +818,14 @@ def test_repeat_with_reference_path_in_a_method_with_spaces_in_predicate_uses_cu
| | calculate | pos1 | | position(..) |
| | begin repeat | rep5 | | |
| | calculate | pos5 | | position(..) |
| | calculate | item5 | | instance('item')/root/item[index=number(1+ ${pos5} and ${pos1} = 1]/label |
| | calculate | item5 | | instance('item')/root/item[index=number(1+ ${pos5}) and ${pos1} = 1]/label |
| | end repeat | | | |
"""
self.assertPyxformXform(
name="data",
md=xlsform_md,
xml__contains=[
"""<bind calculate="instance('item')/root/item[index=number(1+ current()/../pos5 and /data/pos1 = 1]/label" nodeset="/data/rep5/item5" type="string"/>""" # noqa pylint: disable=line-too-long
"""<bind calculate="instance('item')/root/item[index=number(1+ current()/../pos5 ) and /data/pos1 = 1]/label" nodeset="/data/rep5/item5" type="string"/>""" # noqa pylint: disable=line-too-long
],
)

Expand Down Expand Up @@ -953,19 +953,19 @@ def test_repeat_with_reference_path_after_instance_in_predicate_uses_current(sel
${pos5} that is in 'position()=${pos5}'' uses current because it is in a predicate (eventhough not in an instance)
"""
xlsform_md = """
| survey | | | | |
| | type | name | label | calculation |
| | xml-external | item | | |
| | begin repeat | rep5 | | |
| | calculate | pos5 | | position(..) |
| | calculate | item5 | | concat(instance('item')/root/item[index =${pos5}]/label, @data/form/[position()=${pos5}]/text |
| | end repeat | | | |
| survey | | | | |
| | type | name | label | calculation |
| | xml-external | item | | |
| | begin repeat | rep5 | | |
| | calculate | pos5 | | position(..) |
| | calculate | item5 | | concat(instance('item')/root/item[index =${pos5}]/label, /data[position()=${pos5}]/text) |
| | end repeat | | | |
"""
self.assertPyxformXform(
name="data",
md=xlsform_md,
xml__contains=[
"""<bind calculate="concat(instance('item')/root/item[index = current()/../pos5 ]/label, @data/form/[position()= current()/../pos5 ]/text" nodeset="/data/rep5/item5" type="string"/>""", # noqa pylint: disable=line-too-long
"""<bind calculate="concat(instance('item')/root/item[index = current()/../pos5 ]/label, /data[position()= current()/../pos5 ]/text)" nodeset="/data/rep5/item5" type="string"/>""", # noqa pylint: disable=line-too-long
],
)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name="pyxform",
version="1.5.0",
version="1.5.1",
author="github.com/xlsform",
author_email="[email protected]",
packages=find_packages(),
Expand Down

0 comments on commit d054d38

Please sign in to comment.