Browse Source
Refactor magicwords header and variable names
Header on top matches existing style.
main
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with
5 additions and
12 deletions
-
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 |
|
|
# once the content is settled, compute a hash |
|
|
# and link it in the metadata! |
|
|
# and link it in the metadata! |
|
|
|
|
|
|
|
|
# include magic words |
|
|
|
|
|
if args.magicwords: |
|
|
|
|
|
|
|
|
|
|
|
########################################## |
|
|
########################################## |
|
|
## INCLUDE __XXX__ MAGIC WORDS |
|
|
# INCLUDE __XXX__ MAGIC WORDS |
|
|
########################################## |
|
|
########################################## |
|
|
|
|
|
if args.magicwords: |
|
|
pattern = r"__[a-zA-Z0-9]+?__" |
|
|
pattern = r"__[a-zA-Z0-9]+?__" |
|
|
magic_words = re.findall(pattern, text) |
|
|
all_matches = re.findall(pattern, text) |
|
|
magic_words = list(set(magic_words)) |
|
|
magic_words = list(set(all_matches)) |
|
|
if magic_words: |
|
|
if magic_words: |
|
|
meta["magicwords"] = magic_words |
|
|
meta["magicwords"] = magic_words |
|
|
print( |
|
|
|
|
|
"FOUND MAGIC WORD(s): {} in {}".format( |
|
|
|
|
|
magic_words, padid |
|
|
|
|
|
) |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
links = [] |
|
|
links = [] |
|
|
if args.css: |
|
|
if args.css: |
|
|