Merge branch 'main' of gitlab.com:bashrc2/epicyon

merge-requests/30/head
Bob Mottram 2022-03-29 22:40:23 +01:00
commit 8f18940cab
1882 changed files with 2713 additions and 800 deletions

View File

@ -551,7 +551,10 @@ def _add_emoji(base_dir: str, word_str: str,
return False
emoji_filename = base_dir + '/emoji/' + emoji_dict[emoji] + '.png'
if not os.path.isfile(emoji_filename):
return False
emoji_filename = \
base_dir + '/emojicustom/' + emoji_dict[emoji] + '.png'
if not os.path.isfile(emoji_filename):
return False
emoji_url = http_prefix + "://" + domain + \
"/emoji/" + emoji_dict[emoji] + '.png'
post_tags[emoji] = {
@ -940,21 +943,15 @@ def add_html_tags(base_dir: str, http_prefix: str,
emoji_dict = load_json(base_dir + '/emoji/emoji.json')
# append custom emoji to the dict
if os.path.isfile(base_dir + '/emojicustom/emoji.json'):
custom_emoji_dict = \
load_json(base_dir + '/emojicustom/emoji.json')
custom_emoji_filename = base_dir + '/emojicustom/emoji.json'
if os.path.isfile(custom_emoji_filename):
custom_emoji_dict = load_json(custom_emoji_filename)
if custom_emoji_dict:
emojis_combined = True
try:
emoji_dict = dict(emoji_dict, **custom_emoji_dict)
except BaseException:
emojis_combined = False
if not emojis_combined:
# combine emoji dicts one by one
for ename, eitem in custom_emoji_dict.items():
if ename and eitem:
if not emoji_dict.get(ename):
emoji_dict[ename] = eitem
# combine emoji dicts one by one
for ename, eitem in custom_emoji_dict.items():
if ename and eitem:
if not emoji_dict.get(ename):
emoji_dict[ename] = eitem
# print('TAG: looking up emoji for :' + word_str2 + ':')
_add_emoji(base_dir, ':' + word_str2 + ':', http_prefix,
@ -1387,3 +1384,29 @@ def bold_reading_string(text: str) -> str:
new_text += '<p>' + new_parag + '</p>'
return new_text
def import_emoji(base_dir: str, import_filename: str, session) -> None:
"""Imports emoji from the given filename
"""
if not os.path.isfile(import_filename):
return
emoji_dict = load_json(base_dir + '/emoji/default_emoji.json', 0, 1)
added = 0
with open(import_filename, "r") as fp_emoji:
lines = fp_emoji.readlines()
for line in lines:
url = line.split(', ')[0]
tag = line.split(', ')[1].strip()
tag = tag.split(':')[1]
if emoji_dict.get(tag):
continue
emoji_image_filename = base_dir + '/emoji/' + tag + '.png'
if os.path.isfile(emoji_image_filename):
continue
if download_image(session, base_dir, url,
emoji_image_filename, True, False):
emoji_dict[tag] = tag
added += 1
save_json(emoji_dict, base_dir + '/emoji/default_emoji.json')
print(str(added) + ' custom emoji added')

BIN
emoji/000.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
emoji/0120.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

BIN
emoji/0point.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
emoji/0w0.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
emoji/1000.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
emoji/100_gay.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
emoji/100a.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

BIN
emoji/100awoo.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
emoji/110.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
emoji/11tea.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

BIN
emoji/184.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
emoji/18only.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
emoji/Clojure.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
emoji/MJJ.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
emoji/NeonNOU.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
emoji/WSHHFANS.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
emoji/YEEEEEE.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
emoji/YujinMeh.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
emoji/YuriTT.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
emoji/aaa.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

BIN
emoji/aaaaa.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
emoji/ablobcool.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
emoji/abloblamp.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
emoji/ablobowo.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
emoji/ablobspin.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
emoji/ac_amazed.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
emoji/ac_angry.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
emoji/ac_cry.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
emoji/ac_dazzle.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
emoji/ac_dozing.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
emoji/ac_happy.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
emoji/ac_heart.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
emoji/ac_joy.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
emoji/ac_music.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
emoji/ac_pride.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Some files were not shown because too many files have changed in this diff Show More