Repository navigation
Commit 2cd7aee
committed
refactor(corekit)!: Info.to_dict() returns an OrderedMultiDict; add MultiInfo and OrderedMultiInfo (#1484)
- corekit/infoclass: add MultiInfo and OrderedMultiInfo, immutable
MultiDict/OrderedMultiDict subclasses that 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 a plain OrderedMultiDict at every level and turns
MultiInfo/OrderedMultiInfo back into MultiDict/OrderedMultiDict;
from_dict() restores them, including an annotated subclass (HTTP/2
Settings, now an OrderedMultiInfo).
- 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 ffca646 commit 2cd7aee
32 files changed
Lines changed: 915 additions & 271 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 | + | |
34 | 49 | | |
35 | 50 | | |
36 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
37 | 55 | | |
38 | 56 | | |
39 | 57 | | |
| |||
| 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