Update to unicode 15 and make script jinja:3 compatible
This commit is contained in:
parent
a4524cd9af
commit
7e0ea12ebb
4 changed files with 234 additions and 180 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue