generate_packets.py: Initial cleanup
When making changes to generate_packets.py, pay extra attention to clear version history (just one easy-to-understand change per commit, hopefully so that the diff file is easy to read), as porting the changes to freeciv-web's patching of the file is painful at best of times.
Reply To cazfi
just one easy-to-understand change per commit, hopefully so that the diff file is easy to read
I'll see what I can do, though that might mean lot of commits, given that basically the whole file needs a complete makeover – without the way I already split it into multiple tickets, it would've probably resulted in one giant commit tantamount to writing almost the entire script anew from the ground up.
Attached patch covers imports and declarations that are no longer used, whitespace, and places where a variable name was the same as a builtin.
I'd still like that #43901 would go in first, as a separate commit, from which people know that nothing else changes on those lines touched than trailing space removal - which is easy to recreate for the forked scripts without any other considerations.
Part of #43927. Remove trailing whitespace and imports/variables that are no longer used, to provide a clean starting point for bigger changes.