Skip to content

Commit 60e5e98

Browse files
authored
Merge pull request #407 from pbs-data-solutions/comments
Add missing comments to native files parsers
2 parents ad3fab0 + 3c76f60 commit 60e5e98

File tree

6 files changed

+19
-3
lines changed

6 files changed

+19
-3
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ crate-type = ["cdylib"]
1616
[dependencies]
1717
anyhow = "1.0.89"
1818
chrono = "0.4.38"
19-
prelude-xml-parser = { version = "0.7.1", features = ["python"] }
19+
prelude-xml-parser = { version = "0.7.2", features = ["python"] }
2020
pyo3 = { version = "0.22.4", features = ["extension-module"] }
2121
roxmltree = "0.20.0"
2222
serde = { version = "1.0.210", features = ["derive"] }

prelude_parser/_prelude_parser.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,20 @@ class Entry:
2929

3030
def to_dict(self) -> dict: ...
3131

32+
class Comment:
33+
entry_id: str
34+
value: Value | None
35+
36+
def to_dict(self) -> dict: ...
37+
3238
class Field:
3339
name: str
3440
data_type: str | None
3541
error_code: str
3642
when_created: datetime
3743
keep_history: bool
3844
entries: list[Entry] | None
45+
comments: list[Comment] | None
3946

4047
def to_dict(self) -> dict: ...
4148

tests/assets/site_native.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<entry id="1">
1111
<value by="Paul Sanders" byUniqueId="1681162687395" role="Project Manager" when="2023-04-15 12:08:19 -0400" xml:space="preserve">Some Company</value>
1212
</entry>
13+
<comment id="1">
14+
<value by="Paul Sanders" byUniqueId="1681162687395" role="Project Manager" when="2023-04-15 12:09:02 -0400" xml:space="preserve">Some comment</value>
15+
</comment>
1316
</field>
1417
<field name="site_code_name" type="hidden" dataType="string" errorCode="valid" whenCreated="2023-04-15 11:07:14 -0500" keepHistory="true">
1518
<entry id="1">

tests/assets/subject_native.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<entry id="1">
1010
<value by="Paul Sanders" byUniqueId="1681162687395" role="Project Manager" when="2023-04-15 12:09:02 -0400" xml:space="preserve">Labrador</value>
1111
</entry>
12+
<comment id="1">
13+
<value by="Paul Sanders" byUniqueId="1681162687395" role="Project Manager" when="2023-04-15 12:09:02 -0400" xml:space="preserve">Some comment</value>
14+
</comment>
1215
</field>
1316
<field name="dob" type="popUpCalendar" dataType="date" errorCode="valid" whenCreated="2023-04-15 12:08:26 -0400" keepHistory="true">
1417
<entry id="1">

tests/assets/user_native.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<entry id="1">
1111
<value by="Paul Sanders" byUniqueId="1681162687395" role="Project Manager" when="2023-08-07 10:15:41 -0500" xml:space="preserve">[email protected]</value>
1212
</entry>
13+
<comment id="1">
14+
<value by="Paul Sanders" byUniqueId="1681162687395" role="Project Manager" when="2023-04-15 12:09:02 -0400" xml:space="preserve">Some comment</value>
15+
</comment>
1316
</field>
1417
</category>
1518
<category name="Administrative" type="normal" highestIndex="0">

0 commit comments

Comments
 (0)