From 8bef9d84d56f24c4d0f2e23aa6320c77e466dc95 Mon Sep 17 00:00:00 2001 From: Justin Warren Date: Wed, 21 Dec 2022 09:01:27 +1100 Subject: [PATCH] Change comment merge join to use ', ' not '\n'. --- bin/fediblock_sync.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/fediblock_sync.py b/bin/fediblock_sync.py index ef930b6..acf1ec2 100755 --- a/bin/fediblock_sync.py +++ b/bin/fediblock_sync.py @@ -148,7 +148,7 @@ def merge_blocklists(blocklists: dict, mergeplan: str='max') -> dict: def apply_mergeplan(oldblock: dict, newblock: dict, mergeplan: str='max') -> dict: """Use a mergeplan to decide how to merge two overlapping block definitions - @param oldblock: The exist block definition. + @param oldblock: The existing block definition. @param newblock: The new block definition we want to merge in. @param mergeplan: How to merge. Choices are 'max', the default, and 'min'. """ @@ -156,13 +156,13 @@ def apply_mergeplan(oldblock: dict, newblock: dict, mergeplan: str='max') -> dic blockdata = oldblock.copy() # If the public or private comment is different, - # append it to the existing comment, joined with a newline + # append it to the existing comment, joined with ', ' # unless the comment is None or an empty string keylist = ['public_comment', 'private_comment'] for key in keylist: try: if oldblock[key] != newblock[key] and newblock[key] not in ['', None]: - blockdata[key] = '\n'.join([oldblock[key], newblock[key]]) + blockdata[key] = ', '.join([oldblock[key], newblock[key]]) except KeyError: log.debug(f"Key '{key}' missing from block definition so cannot compare. Continuing...") continue