Skip to content

Commit 7bf6aac

Browse files
authored
Merge pull request #400 from andlaus/property_ordering
Use the same order of dataclass fields as the XSD uses for subtags
2 parents bea26d6 + 19f47c4 commit 7bf6aac

File tree

91 files changed

+1213
-1117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1213
-1117
lines changed

examples/mksomersaultmodifiedpdx.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def find_named_object(item_list: List[T], name: str) -> T:
116116
description=None,
117117
diag_coded_type=somersaultecu.somersault_diagcodedtypes["uint8"],
118118
byte_position=0,
119-
coded_value=FLIC_FLAC_SID,
119+
coded_value_raw=str(FLIC_FLAC_SID),
120120
bit_position=None,
121121
sdgs=[],
122122
)
@@ -142,7 +142,7 @@ def find_named_object(item_list: List[T], name: str) -> T:
142142
description=None,
143143
diag_coded_type=somersaultecu.somersault_diagcodedtypes["uint8"],
144144
byte_position=0,
145-
coded_value=uds.positive_response_id(FLIC_FLAC_SID),
145+
coded_value_raw=str(uds.positive_response_id(FLIC_FLAC_SID)),
146146
bit_position=None,
147147
sdgs=[],
148148
),

examples/somersaultecu.py

+52-45
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class SomersaultSID(IntEnum):
118118
roles=["gymnast", "tracker"],
119119
department="sniffers",
120120
address="Some road",
121-
zip="12345",
121+
zipcode="12345",
122122
city="New Dogsville",
123123
phone="+0 1234/5678-9",
124124
fax="+0 1234/5678-0",
@@ -134,7 +134,7 @@ class SomersaultSID(IntEnum):
134134
roles=["gymnast"],
135135
department="haulers",
136136
address="Some road",
137-
zip="12345",
137+
zipcode="12345",
138138
city="New Dogsville",
139139
phone="+0 1234/5678-91",
140140
fax="+0 1234/5678-0",
@@ -150,7 +150,7 @@ class SomersaultSID(IntEnum):
150150
roles=[],
151151
department=None,
152152
address=None,
153-
zip=None,
153+
zipcode=None,
154154
city=None,
155155
phone=None,
156156
fax=None,
@@ -765,8 +765,9 @@ class SomersaultSID(IntEnum):
765765
description=None,
766766
diag_coded_type=somersault_diagcodedtypes["uint8"],
767767
byte_position=0,
768-
coded_value=uds.positive_response_id(
769-
SID.DiagnosticSessionControl.value), # type: ignore[attr-defined]
768+
coded_value_raw=str(
769+
uds.positive_response_id(
770+
SID.DiagnosticSessionControl.value)), # type: ignore[attr-defined]
770771
bit_position=None,
771772
sdgs=[],
772773
),
@@ -804,8 +805,8 @@ class SomersaultSID(IntEnum):
804805
description=None,
805806
diag_coded_type=somersault_diagcodedtypes["uint8"],
806807
byte_position=0,
807-
coded_value=uds.positive_response_id(
808-
SID.TesterPresent.value), # type: ignore[attr-defined]
808+
coded_value_raw=str(uds.positive_response_id(
809+
SID.TesterPresent.value)), # type: ignore[attr-defined]
809810
bit_position=None,
810811
sdgs=[],
811812
),
@@ -843,8 +844,8 @@ class SomersaultSID(IntEnum):
843844
description=None,
844845
diag_coded_type=somersault_diagcodedtypes["uint8"],
845846
byte_position=0,
846-
coded_value=uds.positive_response_id(
847-
SID.ForwardFlip.value), # type: ignore[attr-defined]
847+
coded_value_raw=str(uds.positive_response_id(
848+
SID.ForwardFlip.value)), # type: ignore[attr-defined]
848849
bit_position=None,
849850
sdgs=[],
850851
),
@@ -895,8 +896,8 @@ class SomersaultSID(IntEnum):
895896
description=None,
896897
diag_coded_type=somersault_diagcodedtypes["uint8"],
897898
byte_position=0,
898-
coded_value=uds.positive_response_id(
899-
SID.ForwardFlip.value), # type: ignore[attr-defined]
899+
coded_value_raw=str(uds.positive_response_id(
900+
SID.ForwardFlip.value)), # type: ignore[attr-defined]
900901
bit_position=None,
901902
sdgs=[],
902903
),
@@ -947,8 +948,8 @@ class SomersaultSID(IntEnum):
947948
description=None,
948949
diag_coded_type=somersault_diagcodedtypes["uint8"],
949950
byte_position=0,
950-
coded_value=uds.positive_response_id(
951-
SID.BackwardFlip.value), # type: ignore[attr-defined]
951+
coded_value_raw=str(uds.positive_response_id(
952+
SID.BackwardFlip.value)), # type: ignore[attr-defined]
952953
bit_position=None,
953954
sdgs=[],
954955
),
@@ -1000,8 +1001,8 @@ class SomersaultSID(IntEnum):
10001001
description=None,
10011002
diag_coded_type=somersault_diagcodedtypes["uint8"],
10021003
byte_position=0,
1003-
coded_value=uds.positive_response_id(
1004-
SID.ReadDataByIdentifier.value), # type: ignore[attr-defined]
1004+
coded_value_raw=str(uds.positive_response_id(
1005+
SID.ReadDataByIdentifier.value)), # type: ignore[attr-defined]
10051006
bit_position=None,
10061007
sdgs=[],
10071008
),
@@ -1081,8 +1082,8 @@ class SomersaultSID(IntEnum):
10811082
description=None,
10821083
diag_coded_type=somersault_diagcodedtypes["uint8"],
10831084
byte_position=0,
1084-
coded_value=uds.positive_response_id(
1085-
SID.ForwardFlipCondition.value), # type: ignore[attr-defined]
1085+
coded_value_raw=str(uds.positive_response_id(
1086+
SID.ForwardFlipCondition.value)), # type: ignore[attr-defined]
10861087
bit_position=None,
10871088
sdgs=[],
10881089
),
@@ -1161,7 +1162,7 @@ class SomersaultSID(IntEnum):
11611162
description=None,
11621163
diag_coded_type=somersault_diagcodedtypes["uint8"],
11631164
byte_position=0,
1164-
coded_value=uds.NegativeResponseId,
1165+
coded_value_raw=str(uds.NegativeResponseId),
11651166
bit_position=None,
11661167
sdgs=[],
11671168
),
@@ -1214,7 +1215,7 @@ class SomersaultSID(IntEnum):
12141215
description=None,
12151216
diag_coded_type=somersault_diagcodedtypes["uint8"],
12161217
byte_position=0,
1217-
coded_value=uds.NegativeResponseId,
1218+
coded_value_raw=str(uds.NegativeResponseId),
12181219
bit_position=None,
12191220
sdgs=[],
12201221
),
@@ -1226,7 +1227,7 @@ class SomersaultSID(IntEnum):
12261227
description=None,
12271228
diag_coded_type=somersault_diagcodedtypes["uint8"],
12281229
byte_position=1,
1229-
coded_value=uds.SID.TesterPresent.value, # type: ignore[attr-defined]
1230+
coded_value_raw=str(uds.SID.TesterPresent.value), # type: ignore[attr-defined]
12301231
bit_position=None,
12311232
sdgs=[],
12321233
),
@@ -1251,7 +1252,7 @@ class SomersaultSID(IntEnum):
12511252
description=None,
12521253
diag_coded_type=somersault_diagcodedtypes["uint8"],
12531254
byte_position=0,
1254-
coded_value=uds.NegativeResponseId,
1255+
coded_value_raw=str(uds.NegativeResponseId),
12551256
bit_position=None,
12561257
sdgs=[],
12571258
),
@@ -1275,7 +1276,7 @@ class SomersaultSID(IntEnum):
12751276
description=None,
12761277
diag_coded_type=somersault_diagcodedtypes["uint8"],
12771278
byte_position=2,
1278-
coded_values=[0, 1, 2],
1279+
coded_values_raw=[str(0), str(1), str(2)],
12791280
# possible values (TODO: make this an enum parameter):
12801281
# 0 -> not sober
12811282
# 1 -> too dizzy
@@ -1320,7 +1321,7 @@ class SomersaultSID(IntEnum):
13201321
description=None,
13211322
diag_coded_type=somersault_diagcodedtypes["uint8"],
13221323
byte_position=0,
1323-
coded_value=uds.NegativeResponseId,
1324+
coded_value_raw=str(uds.NegativeResponseId),
13241325
bit_position=None,
13251326
sdgs=[],
13261327
),
@@ -1332,7 +1333,7 @@ class SomersaultSID(IntEnum):
13321333
description=None,
13331334
diag_coded_type=somersault_diagcodedtypes["uint8"],
13341335
byte_position=1,
1335-
coded_value=0xfe,
1336+
coded_value_raw=str(0xfe),
13361337
bit_position=None,
13371338
sdgs=[],
13381339
),
@@ -1344,7 +1345,7 @@ class SomersaultSID(IntEnum):
13441345
description=None,
13451346
diag_coded_type=somersault_diagcodedtypes["uint8"],
13461347
byte_position=2,
1347-
coded_value=0xa7,
1348+
coded_value_raw=str(0xa7),
13481349
bit_position=None,
13491350
sdgs=[],
13501351
),
@@ -1497,7 +1498,7 @@ class SomersaultSID(IntEnum):
14971498
description=None,
14981499
admin_data=None,
14991500
sdgs=[],
1500-
parameters=[
1501+
parameters=NamedItemList([
15011502
CodedConstParameter(
15021503
oid=None,
15031504
short_name="sid",
@@ -1506,8 +1507,8 @@ class SomersaultSID(IntEnum):
15061507
description=None,
15071508
diag_coded_type=somersault_diagcodedtypes["uint8"],
15081509
byte_position=0,
1509-
coded_value=SID.DiagnosticSessionControl # type: ignore[attr-defined,arg-type]
1510-
.value,
1510+
coded_value_raw=str(
1511+
SID.DiagnosticSessionControl.value), # type: ignore[attr-defined]
15111512
bit_position=None,
15121513
sdgs=[],
15131514
),
@@ -1519,7 +1520,7 @@ class SomersaultSID(IntEnum):
15191520
description=None,
15201521
diag_coded_type=somersault_diagcodedtypes["uint8"],
15211522
byte_position=1,
1522-
coded_value=0x0,
1523+
coded_value_raw=str(0x0),
15231524
bit_position=None,
15241525
sdgs=[],
15251526
),
@@ -1536,7 +1537,7 @@ class SomersaultSID(IntEnum):
15361537
bit_position=None,
15371538
sdgs=[],
15381539
),
1539-
],
1540+
]),
15401541
),
15411542
"stop_session":
15421543
Request(
@@ -1556,8 +1557,9 @@ class SomersaultSID(IntEnum):
15561557
description=None,
15571558
diag_coded_type=somersault_diagcodedtypes["uint8"],
15581559
byte_position=0,
1559-
coded_value=SID.DiagnosticSessionControl # type: ignore[attr-defined,arg-type]
1560-
.value,
1560+
coded_value_raw=str(
1561+
SID.DiagnosticSessionControl # type: ignore[attr-defined,arg-type]
1562+
.value),
15611563
bit_position=None,
15621564
sdgs=[],
15631565
),
@@ -1569,7 +1571,7 @@ class SomersaultSID(IntEnum):
15691571
description=None,
15701572
diag_coded_type=somersault_diagcodedtypes["uint8"],
15711573
byte_position=1,
1572-
coded_value=0x1,
1574+
coded_value_raw=str(0x1),
15731575
bit_position=None,
15741576
sdgs=[],
15751577
),
@@ -1593,7 +1595,8 @@ class SomersaultSID(IntEnum):
15931595
description=None,
15941596
diag_coded_type=somersault_diagcodedtypes["uint8"],
15951597
byte_position=0,
1596-
coded_value=SID.TesterPresent.value, # type: ignore[attr-defined,arg-type]
1598+
coded_value_raw=str(
1599+
SID.TesterPresent.value), # type: ignore[attr-defined,arg-type]
15971600
bit_position=None,
15981601
sdgs=[],
15991602
),
@@ -1605,7 +1608,7 @@ class SomersaultSID(IntEnum):
16051608
description=None,
16061609
diag_coded_type=somersault_diagcodedtypes["uint8"],
16071610
byte_position=1,
1608-
coded_value=0x0,
1611+
coded_value_raw=str(0x0),
16091612
bit_position=None,
16101613
sdgs=[],
16111614
),
@@ -1630,8 +1633,9 @@ class SomersaultSID(IntEnum):
16301633
description=None,
16311634
diag_coded_type=somersault_diagcodedtypes["uint8"],
16321635
byte_position=0,
1633-
coded_value=SID.ForwardFlipCondition # type: ignore[attr-defined,arg-type]
1634-
.value,
1636+
coded_value_raw=str(
1637+
SID.ForwardFlipCondition # type: ignore[attr-defined,arg-type]
1638+
.value),
16351639
bit_position=None,
16361640
sdgs=[],
16371641
),
@@ -1668,7 +1672,8 @@ class SomersaultSID(IntEnum):
16681672
description=None,
16691673
diag_coded_type=somersault_diagcodedtypes["uint8"],
16701674
byte_position=0,
1671-
coded_value=SID.ForwardFlip.value, # type: ignore[attr-defined,arg-type]
1675+
coded_value_raw=str(
1676+
SID.ForwardFlip.value), # type: ignore[attr-defined,arg-type]
16721677
bit_position=None,
16731678
sdgs=[],
16741679
),
@@ -1719,7 +1724,8 @@ class SomersaultSID(IntEnum):
17191724
description=None,
17201725
diag_coded_type=somersault_diagcodedtypes["uint8"],
17211726
byte_position=0,
1722-
coded_value=SID.BackwardFlip.value, # type: ignore[attr-defined,arg-type]
1727+
coded_value_raw=str(
1728+
SID.BackwardFlip.value), # type: ignore[attr-defined,arg-type]
17231729
bit_position=None,
17241730
sdgs=[],
17251731
),
@@ -1770,8 +1776,9 @@ class SomersaultSID(IntEnum):
17701776
description=None,
17711777
diag_coded_type=somersault_diagcodedtypes["uint8"],
17721778
byte_position=0,
1773-
coded_value=SID.ReadDataByIdentifier # type: ignore[attr-defined,arg-type]
1774-
.value,
1779+
coded_value_raw=str(
1780+
SID.ReadDataByIdentifier # type: ignore[attr-defined,arg-type]
1781+
.value),
17751782
bit_position=None,
17761783
sdgs=[],
17771784
),
@@ -1783,7 +1790,7 @@ class SomersaultSID(IntEnum):
17831790
description=None,
17841791
diag_coded_type=somersault_diagcodedtypes["uint8"],
17851792
byte_position=1,
1786-
coded_value=0x0,
1793+
coded_value_raw=str(0x0),
17871794
bit_position=None,
17881795
sdgs=[],
17891796
),
@@ -2776,7 +2783,7 @@ class SomersaultSID(IntEnum):
27762783
description=None,
27772784
diag_coded_type=somersault_diagcodedtypes["uint8"],
27782785
byte_position=0,
2779-
coded_value=0x3,
2786+
coded_value_raw=str(0x3),
27802787
bit_position=None,
27812788
sdgs=[],
27822789
),
@@ -2818,7 +2825,7 @@ class SomersaultSID(IntEnum):
28182825
description=None,
28192826
diag_coded_type=somersault_diagcodedtypes["uint8"],
28202827
byte_position=0,
2821-
coded_value=0x1,
2828+
coded_value_raw=str(0x1),
28222829
bit_position=None,
28232830
sdgs=[],
28242831
),
@@ -2860,7 +2867,7 @@ class SomersaultSID(IntEnum):
28602867
description=None,
28612868
diag_coded_type=somersault_diagcodedtypes["uint8"],
28622869
byte_position=0,
2863-
coded_value=0x20,
2870+
coded_value_raw=str(0x20),
28642871
bit_position=None,
28652872
sdgs=[],
28662873
),

odxtools/additionalaudience.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class AdditionalAudience(IdentifiableElement):
1818
@staticmethod
1919
def from_et(et_element: ElementTree.Element,
2020
doc_frags: List[OdxDocFragment]) -> "AdditionalAudience":
21+
kwargs = dataclass_fields_asdict(IdentifiableElement.from_et(et_element, doc_frags))
2122

22-
return AdditionalAudience(
23-
**dataclass_fields_asdict(IdentifiableElement.from_et(et_element, doc_frags)))
23+
return AdditionalAudience(**kwargs)
2424

2525
def _build_odxlinks(self) -> Dict[OdxLinkId, Any]:
2626
return {self.odx_id: self}

odxtools/admindata.py

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def _build_odxlinks(self) -> Dict[OdxLinkId, Any]:
4343
for cdi in self.company_doc_infos:
4444
result.update(cdi._build_odxlinks())
4545

46+
for dr in self.doc_revisions:
47+
result.update(dr._build_odxlinks())
48+
4649
return result
4750

4851
def _resolve_odxlinks(self, odxlinks: OdxLinkDatabase) -> None:

0 commit comments

Comments
 (0)