From 424ba859423f8bd99ba99cce31af704bc84793bc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 1 Nov 2021 23:39:20 +0000 Subject: [PATCH] Searching for custom emoji --- content.py | 3 +-- webapp_search.py | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/content.py b/content.py index d01485df6..753a08554 100644 --- a/content.py +++ b/content.py @@ -905,8 +905,7 @@ def addHtmlTags(baseDir: str, httpPrefix: str, customEmojiDict = \ loadJson(baseDir + '/emojicustom/emoji.json') if customEmojiDict: - newEmojiDict = dict(emojiDict, **customEmojiDict) - emojiDict = newEmojiDict + emojiDict = dict(emojiDict, **customEmojiDict) # print('TAG: looking up emoji for :' + wordStr2 + ':') _addEmoji(baseDir, ':' + wordStr2 + ':', httpPrefix, diff --git a/webapp_search.py b/webapp_search.py index 68a21385f..629cad276 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -71,17 +71,17 @@ def htmlSearchEmoji(cssCache: {}, translate: {}, # does the lookup file exist? if not os.path.isfile(emojiLookupFilename): - emojiForm += '
' + \ - translate['No results'] + '
' - emojiForm += htmlFooter() - return emojiForm + if not os.path.isfile(customEmojiLookupFilename): + emojiForm += '
' + \ + translate['No results'] + '
' + emojiForm += htmlFooter() + return emojiForm emojiJson = loadJson(emojiLookupFilename) if emojiJson: if os.path.isfile(customEmojiLookupFilename): customEmojiJson = loadJson(customEmojiLookupFilename) - newEmojiJson = dict(emojiJson, **customEmojiJson) - emojiDict = newEmojiJson + emojiJson = dict(emojiJson, **customEmojiJson) results = {} for emojiName, filename in emojiJson.items(): if searchStr in emojiName: