Ticket #44577

generate_packets.py: overhaul Variant.get_send() and Variant.get_receive() string formatting

Open Date: 2022-05-13 05:34 Last Update: 2022-05-16 23:56

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
None

Details

Part of #43927. Split from #44575. The get_send() and get_receive() methods of the Variant class do their own formatting thing that needs to be replaced with something more robust. For this reason, they've been left out of a number of recent refactorings, which should also be applied to them once viable.

Steps to be done:

  • For Variant.get_receive(), along with Variant.get_delta_receive_body() (and Field.get_get_real()):
    • #44597 Replace the <var>-based custom formatting with a string join
    • #44598 Distribute the % (printf-style) formatting out to the individual parts (that need them) in get_receive()
    • #44599 Replace % formatting with str.format() and only the required arguments in get_receive(); cf. #44575
    • #44601 Deal with string formatting in get_delta_receive_body() (and Field.get_get_real())
  • For Variant.get_send(), along with Variant.get_delta_send_body()
    • #44602 Give get_delta_send_body() access to pre2 (in some way) so that it doesn't need the custom formatting anymore
    • #44603 Replace the <var>-based custom formatting with a string join
    • #44604 Distribute the % (printf-style) formatting out to the individual parts (that need them) in get_send()
    • #44605 Replace % formatting with str.format() and only the required arguments in get_send(); cf. #44575
    • #44606 Deal with string formatting in get_delta_send_body()
  • #44607 Apply the equivalent of #44584 to the resulting code

Ticket History (3/8 Histories)

2022-05-13 05:34 Updated by: alienvalkyrie
  • New Ticket "generate_packets.py: overhaul Variant.get_send() and Variant.get_receive() string formatting" created
2022-05-15 04:04 Updated by: alienvalkyrie
  • Details Updated
Comment

I'll be using this ticket as a smaller metaticket, since the affected code is large enough that it should probably be done in multiple steps.

2022-05-15 04:17 Updated by: alienvalkyrie
  • Details Updated
2022-05-15 06:15 Updated by: alienvalkyrie
  • Details Updated
Comment

get_receive() parts done.

2022-05-15 06:30 Updated by: alienvalkyrie
  • Details Updated
2022-05-15 08:12 Updated by: alienvalkyrie
  • Details Updated
2022-05-15 09:05 Updated by: alienvalkyrie
  • Details Updated
Comment

All sub-issues are now in review. Once they are merged, this ticket will be closed.

2022-05-16 23:56 Updated by: alienvalkyrie
  • Status Update from Open to Closed
  • Resolution Update from None to Fixed
  • Type Update from Patches to Tasks

Attachment File List

No attachments

Edit

Please login to add comment to this ticket » Login