From 812affd0ae1573d74b6e7745b63823001398d447 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 9 Jan 2023 22:07:56 -0500 Subject: [PATCH] Use list of strings instead of block string for config changes --- mailman_sync.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/mailman_sync.py b/mailman_sync.py index f025695..98973c1 100755 --- a/mailman_sync.py +++ b/mailman_sync.py @@ -51,26 +51,27 @@ class ListManager: ) def config_list(self): - config_changes = """ -# TODO: set real_name, moderator, subject prefix, and reply-to address -from_is_list = 1 -anonymous_list = 1 -first_strip_reply_to = 1 -reply_goes_to_list = 2 - -# quiet member management -send_reminders = 0 -send_welcome_msg = 0 -send_goodbye_msg = 0 - -new_member_options = 272 -advertised = 0 -private_roster = 2 # only admins can view the roster -default_member_moderation = 1 - -generic_nonmember_action = 3 # discard non-member emails -forward_auto_discards = 0 # don't notify admin about discards -""" + config_changes = "\n".join( + [ + # TODO: set real_name, moderator, subject prefix, and reply-to address + "from_is_list = 1", + "anonymous_list = 1", + "first_strip_reply_to = 1", + # Use explicit address for Reply-To + "reply_goes_to_list = 2", + # quiet member management + "send_reminders = 0", + "send_welcome_msg = 0", + "send_goodbye_msg = 0", + # ConcealSubscription | DontReceiveDuplicates + "new_member_options = 272", + "advertised = 0", + "private_roster = 2", # only admins can view the roster + "default_member_moderation = 1", + "generic_nonmember_action = 3", # discard non-member emails + "forward_auto_discards = 0", # don't notify admin about discards + ] + ) with tempfile.NamedTemporaryFile("w", suffix=".py") as config_file: config_file.write(config_changes)