diff options
author | BulbyVR <26726264+TheDrawingCoder-Gamer@users.noreply.github.com> | 2022-04-22 10:46:43 -0400 |
---|---|---|
committer | BulbyVR <26726264+TheDrawingCoder-Gamer@users.noreply.github.com> | 2022-04-24 12:25:01 -0400 |
commit | 90b88eb592f89c2b4de02f53ba5db5c3d7fc54d9 (patch) | |
tree | 875b2b39a6b90e3df94c5f9d87672302d962a953 /scripts/emoji_codegen.py | |
parent | Run make lint (diff) | |
download | nheko-90b88eb592f89c2b4de02f53ba5db5c3d7fc54d9.tar.xz |
Keep old codes alongside new ones
Signed-off-by: BulbyVR <26726264+TheDrawingCoder-Gamer@users.noreply.github.com>
Diffstat (limited to 'scripts/emoji_codegen.py')
-rwxr-xr-x | scripts/emoji_codegen.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/scripts/emoji_codegen.py b/scripts/emoji_codegen.py index 37ad3cec..5da3fb26 100755 --- a/scripts/emoji_codegen.py +++ b/scripts/emoji_codegen.py @@ -78,26 +78,26 @@ if __name__ == '__main__': char, name = re.match(r'^(\S+) E\d+\.\d+ (.*)$', charAndName).groups() - # drop "face" part - + #TODO: Handle skintone modifiers in a sane way if name in shortcodeDict: - name = shortcodeDict[name] + # TODO: this duplicates emoji + categories[current_category].append(Emoji(code, shortcodeDict[name])) + + if name.endswith(' face'): + name = name[:-5] + elif name.endswith(' button'): + name = name[:-7] else: - if name.endswith(' face'): - name = name[:-5] - elif name.endswith(' button'): - name = name[:-7] - else: - matchobj = re.match(r'^flag: (.*)$', name) - if matchobj: - country, = matchobj.groups() - name = country + " flag" - name = name.replace(" ", "_") - name = name.replace("“", "") - name = name.replace("”", "") - name = name.replace(":", "") - name = name.lower() - name = unidecode(name) + matchobj = re.match(r'^flag: (.*)$', name) + if matchobj: + country, = matchobj.groups() + name = country + " flag" + name = name.replace(" ", "_") + name = name.replace("“", "") + name = name.replace("”", "") + name = name.replace(":", "") + name = name.lower() + name = unidecode(name) categories[current_category].append(Emoji(code, name)) # Use xclip to pipe the output to clipboard. |