summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-01-23 23:25:52 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-01-23 23:25:52 +0100
commit577d403be7b83ac8530a23a393f3a4d90853f487 (patch)
tree704ebb42191e3a95f9b0cacf80f293ee4dd0bcf5 /scripts
parentRequest unknown message indices (diff)
downloadnheko-577d403be7b83ac8530a23a393f3a4d90853f487.tar.xz
Fix emoji update script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/emoji_codegen.py23
1 files changed, 1 insertions, 22 deletions
diff --git a/scripts/emoji_codegen.py b/scripts/emoji_codegen.py
index b39feb34..588b026b 100755
--- a/scripts/emoji_codegen.py
+++ b/scripts/emoji_codegen.py
@@ -11,19 +11,6 @@ class Emoji(object):
         self.code = repr(code.encode('utf-8'))[1:].strip("'")
         self.shortname = shortname
 
-def generate_code(emojis, category):
-    tmpl = Template('''
-const std::vector<Emoji> emoji::Provider::{{ category }} = {
-    // {{ category.capitalize() }}
-    {%- for e in emoji %}
-        Emoji{QString::fromUtf8("{{ e.code }}"), "{{ e.shortname }}", emoji::EmojiCategory::{{ category.capitalize() }}},
-    {%- endfor %}
-};
-    ''')
-
-    d = dict(category=category, emoji=emojis)
-    print(tmpl.render(d))
-
 def generate_qml_list(**kwargs):
     tmpl = Template('''
 const QVector<Emoji> emoji::Provider::emoji = {
@@ -93,12 +80,4 @@ if __name__ == '__main__':
 
     # Use xclip to pipe the output to clipboard.
     # e.g ./codegen.py emoji.json | xclip -sel clip
-    generate_code(people, 'people')
-    generate_code(nature, 'nature')
-    generate_code(food, 'food')
-    generate_code(activity, 'activity')
-    generate_code(travel, 'travel')
-    generate_code(objects, 'objects')
-    generate_code(symbols, 'symbols')
-    generate_code(flags, 'flags')
-    generate_qml_list(people=people, nature=nature, food=food, activity=activity, travel=travel, objects=objects, symbols=symbols, flags=flags)
\ No newline at end of file
+    generate_qml_list(people=people, nature=nature, food=food, activity=activity, travel=travel, objects=objects, symbols=symbols, flags=flags)