Keep old codes alongside new ones
Signed-off-by: BulbyVR <26726264+TheDrawingCoder-Gamer@users.noreply.github.com>
This commit is contained in:
parent
79399d8118
commit
90b88eb592
4 changed files with 52 additions and 18 deletions
6
scripts/codegen.sh
Normal file
6
scripts/codegen.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
ROOT=$(realpath "$PWD/$(dirname "$0")/..")
|
||||
cd $ROOT
|
||||
cat resources/provider-header.txt > src/emoji/Provider.cpp
|
||||
|
||||
scripts/emoji_codegen.py resources/emoji-test.txt resources/shortcodes.txt >> src/emoji/Provider.cpp
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue