Browse Source

Refactor magicwords header and variable names

Header on top matches existing style.
main
Luke Murphy 3 years ago
parent
commit
35015c9d94
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 17
      etherpump/commands/pull.py

17
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:

Loading…
Cancel
Save