summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-10-07 23:16:00 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-10-08 00:27:57 +0200
commit7e0ea12ebbbb7465fc9258cfc5f26b2d153b93fc (patch)
tree192905a22ec8a579d5177c97fa01ab8c79b574a4 /scripts
parentFix date separator (diff)
downloadnheko-7e0ea12ebbbb7465fc9258cfc5f26b2d153b93fc.tar.xz
Update to unicode 15 and make script jinja:3 compatible
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/emoji_codegen.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/emoji_codegen.py b/scripts/emoji_codegen.py
index a0758454..7e4f4702 100755
--- a/scripts/emoji_codegen.py
+++ b/scripts/emoji_codegen.py
@@ -13,8 +13,9 @@ class Emoji(object):
         self.unicodename = unicodename
 
 def generate_qml_list(**kwargs):
+    entrycount = sum([len(c[1]) for c in kwargs.items()])
     tmpl = Template('''
-const std::array<Emoji, {{ sum([len(c[1]) for c in kwargs.items()]) }}> emoji::Provider::emoji = {
+const std::array<Emoji, {{ entrycount }} > emoji::Provider::emoji = {
     {%- for c in kwargs.items() %}
     // {{ c[0].capitalize() }}
     {%- for e in c[1] %}
@@ -23,7 +24,7 @@ const std::array<Emoji, {{ sum([len(c[1]) for c in kwargs.items()]) }}> emoji::P
     {%- endfor %}
 };
     ''')
-    d = dict(kwargs=kwargs)
+    d = dict(kwargs=kwargs, entrycount=entrycount)
     print(tmpl.render(d))
 if __name__ == '__main__':
     if len(sys.argv) < 3: