Check that emoji files exist

master
Bob Mottram 2019-08-19 22:18:04 +01:00
parent 95d3a78ea3
commit 83cb78ea0d
2 changed files with 6 additions and 12 deletions

View File

@ -330,12 +330,6 @@
"pizza": "1F355", "pizza": "1F355",
"placeofworship": "1F6D0", "placeofworship": "1F6D0",
"playbutton": "25B6", "playbutton": "25B6",
"playingcardaceofclubs": "1F0D1",
"playingcardaceofdiamonds": "1F0C1",
"playingcardaceofhearts": "1F0B1",
"playingcardback": "1F0A0",
"playingcardfool": "1F0E0",
"playingcardredjoker": "1F0BF",
"pleadingface": "1F97A", "pleadingface": "1F97A",
"plussign": "2795", "plussign": "2795",
"poodle": "1F429", "poodle": "1F429",
@ -443,14 +437,11 @@
"thermometer": "1F321", "thermometer": "1F321",
"thinking": "1F914", "thinking": "1F914",
"thinkingstallman": "7B2F1", "thinkingstallman": "7B2F1",
"three": "0033",
"threelinesconvergingright": "269E",
"tick": "2714", "tick": "2714",
"tiger": "1F405", "tiger": "1F405",
"tomato": "1F345", "tomato": "1F345",
"trademark": "2122", "trademark": "2122",
"trash": "E262", "trash": "E262",
"trianglewithroundedcorners": "1F6C6",
"trophy": "1F3C6", "trophy": "1F3C6",
"trumpet": "1F3BA", "trumpet": "1F3BA",
"tulip": "1F337", "tulip": "1F337",

View File

@ -77,11 +77,14 @@ def htmlSearchEmoji(baseDir: str,searchStr: str) -> str:
for emojiName,filename in emojiJson.items(): for emojiName,filename in emojiJson.items():
if emojiName in searchStr: if emojiName in searchStr:
results[emojiName] = filename+'.png' results[emojiName] = filename+'.png'
if len(results.items())>0: headingShown=False
emojiForm+='<center><h5>Copy the text then paste it into your post</h5></center>'
emojiForm+='<center>' emojiForm+='<center>'
for emojiName,filename in results.items(): for emojiName,filename in results.items():
emojiForm+='<h3>:'+emojiName+':<img class="searchEmoji" src="/emoji/'+filename+'"/></h3>' if os.path.isfile(baseDir+'/emoji/'+filename):
if not headingShown:
emojiForm+='<center><h5>Copy the text then paste it into your post</h5></center>'
headingShown=True
emojiForm+='<h3>:'+emojiName+':<img class="searchEmoji" src="/emoji/'+filename+'"/></h3>'
emojiForm+='</center>' emojiForm+='</center>'
emojiForm+=htmlFooter() emojiForm+=htmlFooter()