From 35015c9d949392c79b0603afd673647957abc2f4 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 12 Dec 2020 15:37:49 +0100 Subject: [PATCH] Refactor magicwords header and variable names Header on top matches existing style. --- etherpump/commands/pull.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/etherpump/commands/pull.py b/etherpump/commands/pull.py index dcb49f0..869d5f4 100644 --- a/etherpump/commands/pull.py +++ b/etherpump/commands/pull.py @@ -377,22 +377,15 @@ async def handle_pad(args, padid, data, info, session): # once the content is settled, compute a hash # and link it in the metadata! - # include magic words + ########################################## + # INCLUDE __XXX__ MAGIC WORDS + ########################################## if args.magicwords: - - ########################################## - ## INCLUDE __XXX__ MAGIC WORDS - ########################################## pattern = r"__[a-zA-Z0-9]+?__" - magic_words = re.findall(pattern, text) - magic_words = list(set(magic_words)) + all_matches = re.findall(pattern, text) + magic_words = list(set(all_matches)) if magic_words: meta["magicwords"] = magic_words - print( - "FOUND MAGIC WORD(s): {} in {}".format( - magic_words, padid - ) - ) links = [] if args.css: