From f40d8d15b59378c90d0847f0cef7328d9be73332 Mon Sep 17 00:00:00 2001 From: Jussi Kuokkanen Date: Sat, 29 Aug 2020 00:29:46 +0300 Subject: [PATCH] undo changes to emoji_codegen.py --- scripts/emoji_codegen.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/emoji_codegen.py b/scripts/emoji_codegen.py index 466246ed..b39feb34 100755 --- a/scripts/emoji_codegen.py +++ b/scripts/emoji_codegen.py @@ -11,15 +11,12 @@ class Emoji(object): self.code = repr(code.encode('utf-8'))[1:].strip("'") self.shortname = shortname -def to_shortcode(shortname): - return shortname.replace(" ", "-").replace(":", "-") - def generate_code(emojis, category): tmpl = Template(''' const std::vector emoji::Provider::{{ category }} = { // {{ category.capitalize() }} {%- for e in emoji %} - Emoji{QString::fromUtf8("{{ e.code }}"), "{{ e.shortname }}", "{{ to_shortcode(e.shortname) }}", emoji::EmojiCategory::{{ category.capitalize() }}}, + Emoji{QString::fromUtf8("{{ e.code }}"), "{{ e.shortname }}", emoji::EmojiCategory::{{ category.capitalize() }}}, {%- endfor %} }; ''') @@ -33,7 +30,7 @@ const QVector emoji::Provider::emoji = { {%- for c in kwargs.items() %} // {{ c[0].capitalize() }} {%- for e in c[1] %} - Emoji{QString::fromUtf8("{{ e.code }}"), "{{ e.shortname }}", "{{ to_shortcode(e.shortname) }}", emoji::EmojiCategory::{{ c[0].capitalize() }}}, + Emoji{QString::fromUtf8("{{ e.code }}"), "{{ e.shortname }}", emoji::EmojiCategory::{{ c[0].capitalize() }}}, {%- endfor %} {%- endfor %} }; @@ -104,4 +101,4 @@ if __name__ == '__main__': 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) + 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