Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the packet generator #2070

Merged
merged 39 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2312633
Reformat generate_packets with black
lmoureaux Dec 3, 2023
c6a90f9
generate_packets: replace without() with sets
lmoureaux Dec 3, 2023
1782bd1
generate_packets: use argparse
lmoureaux Dec 3, 2023
9eda15e
generate_packets: drop mentions of old python, modernize
lmoureaux Dec 3, 2023
88c7ac3
Fix lazy_overwrite
lmoureaux Dec 3, 2023
76b69e7
generate_packets: factor out parse_packet_definitions
lmoureaux Dec 3, 2023
986c294
generate_packets: remove unused imports
lmoureaux Dec 3, 2023
e6ac27f
generate_packets: Remove lazy overwrite support
lmoureaux Dec 3, 2023
2509400
generate_packets: factor out writing files
lmoureaux Dec 3, 2023
f8c6456
generate_packets: some C++ification
lmoureaux Dec 3, 2023
4f902de
generate_packets: restore indent
lmoureaux Dec 3, 2023
9c36037
generate_packets: rename p -> packets (pylint)
lmoureaux Dec 3, 2023
c27163c
generate_packets: modernize write_client_header
lmoureaux Dec 3, 2023
cf9684b
generate_packets: modernize write_client_source
lmoureaux Dec 3, 2023
506e4b1
generate_packets: simplify worklist support
lmoureaux Dec 3, 2023
c6104f0
generate_packets: modernize write_server_header
lmoureaux Dec 3, 2023
d737e8e
generate_packets: modernize write_server_source
lmoureaux Dec 3, 2023
ce1b409
generate_packets: longer variable names (pylint)
lmoureaux Dec 3, 2023
5778e19
generate_packets: don't shadow 'args' (pylint)
lmoureaux Dec 3, 2023
46cb2b1
generate_packets: Type as namedtuple
lmoureaux Dec 3, 2023
ce98f53
generate_packets: start modernizing Packet constructor
lmoureaux Dec 3, 2023
cd0163e
generate_packets: start work on get_packet_handlers_fill_capability
lmoureaux Dec 3, 2023
5b1f8fc
generate_packets: refactor get_packet_handlers_fill_capability
lmoureaux Dec 3, 2023
e0731f9
generate_packets: refactor get_enum_packet
lmoureaux Dec 3, 2023
3bbd3a3
generate_packets: add more r-strings (pylint)
lmoureaux Dec 3, 2023
f237333
generate_packets: remove __dummy fields
lmoureaux Dec 3, 2023
d274625
generate_packets: Rename prefix() to indent()
lmoureaux Dec 3, 2023
ed3a068
generate_packets: use itertools for get_choices
lmoureaux Dec 3, 2023
66b5e44
generate_packets: no regex in parse_fields
lmoureaux Dec 3, 2023
c572d5a
generate_packets: simplify how type aliases are done
lmoureaux Dec 3, 2023
6417768
generate_packets: simplify parse_fields slightly
lmoureaux Dec 3, 2023
cca3e31
generate_packets: f-strings and cleanup
lmoureaux Dec 3, 2023
0ad7dcb
generate_packets: replace custom format strings
lmoureaux Dec 3, 2023
41fe87e
generate_packets: promote comment to help string
lmoureaux Dec 3, 2023
101bb9a
generate_packets: document Field attributes for pylint
lmoureaux Dec 3, 2023
3c0217c
Remove unused parts of dataio
lmoureaux Dec 3, 2023
7d298d4
Remove unused dataio "field location" stuff
lmoureaux Dec 3, 2023
a4bee3f
generate_packets: declare for loop counters in loop
lmoureaux Dec 3, 2023
7674728
generate_packets: misc pylint warnings
lmoureaux Dec 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.py]
indent_size = 4
6 changes: 2 additions & 4 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ add_custom_command(
COMMAND
${Python3_EXECUTABLE}
${CMAKE_SOURCE_DIR}/common/generate_packets.py
"" # common/packets_gen.h
"" # common/packets_gen.c
${CMAKE_SOURCE_DIR}/common/networking/packets.def
--mode client
${CMAKE_CURRENT_BINARY_DIR}/packhand_gen.h
${CMAKE_CURRENT_BINARY_DIR}/packhand_gen.cpp
"" # server/hand_gen.h
"" # server/hand_gen.c
VERBATIM
DEPENDS
${CMAKE_SOURCE_DIR}/common/generate_packets.py
Expand Down
6 changes: 2 additions & 4 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ add_custom_command(
COMMAND
${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/generate_packets.py
${CMAKE_CURRENT_SOURCE_DIR}/networking/packets.def
--mode common
${CMAKE_CURRENT_BINARY_DIR}/packets_gen.h
${CMAKE_CURRENT_BINARY_DIR}/packets_gen.cpp
"" # client/packhand_gen.h
"" # client/packhand_gen.cpp
"" # server/hand_gen.h
"" # server/hand_gen.cpp
VERBATIM
DEPENDS
generate_packets.py
Expand Down
Loading
Loading