Repository navigation
Commit 94c3545
committed
refactor(corekit)!: Info.to_dict() returns an OrderedMultiDict; add MultiInfo and OrderedMultiInfo (#1484)
- corekit/infoclass: add MultiInfo and OrderedMultiInfo, Info subclasses
that also derive from MultiDict/OrderedMultiDict. They inherit from_dict
and Info's finalisation, keep the multi-mapping protocol, refuse every
mutation, read keys as attributes and keep every value of a repeated key.
Info stores every MultiDict value as one of them, so a finalised Info
holds no mutable multi-mapping.
- Info.to_dict() returns an OrderedMultiDict at every level, and a
MultiInfo/OrderedMultiInfo exports its plain multi-mapping; from_dict()
restores them, including an annotated subclass (HTTP/2 Settings, now an
OrderedMultiInfo). The OrderedMultiDict exports are a private subclass
whose != negates ==, as OrderedMultiInfo's does, so two equal exports or
option lists no longer compare unequal.
- corekit/multidict: drop InfoDict; the module is Werkzeug's classes only.
- dumpkit: write an Info's fields with every value of a repeated field, as a
list; the PCAP and PCAP-NG engines hand the writers the Info itself.
- protocols/data: retype the attribute annotations to OrderedMultiInfo and
MultiInfo; PCAP-NG freezes the entries it holds in a tuple or dict.
- tests: move the to_dict() assertions to the OrderedMultiDict contract.
Every test directory and top-level test module passes, run one at a time.1 parent cf6e78a commit 94c3545
34 files changed
Lines changed: 1465 additions & 276 deletions
File tree
- docs/source/pcapkit/corekit
- pcapkit
- corekit
- dumpkit
- foundation/engines
- protocols
- application
- data
- application
- internet
- misc
- transport
- misc
- tests
- corekit
- dumpkit
- protocols
- application
- internet
- misc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
34 | 53 | | |
35 | 54 | | |
36 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
37 | 59 | | |
38 | 60 | | |
39 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 38 | | |
48 | 39 | | |
49 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments