From 1b0d3cbb39c899cb3fc6a756c02e4b777a8006b3 Mon Sep 17 00:00:00 2001 From: Harshit Bansal Date: Sat, 4 Feb 2017 21:44:32 +0000 Subject: [PATCH] tools/build_emoji: Generate `name_to_codepoint.json` file. Generate the `name_to_codepoint.json` file in build_emoji which will be used by bugdown/ to map emoji names to codepoints directly. --- tools/setup/emoji/build_emoji | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/setup/emoji/build_emoji b/tools/setup/emoji/build_emoji index 4d7eb3b2d2..4c6e2ab753 100755 --- a/tools/setup/emoji/build_emoji +++ b/tools/setup/emoji/build_emoji @@ -252,5 +252,11 @@ def dump_emojis(cache_path): }) emoji_codes_file.close() + NAME_TO_CODEPOINT_PATH = os.path.join(cache_path, 'name_to_codepoint.json') + name_to_codepoint_file = open(NAME_TO_CODEPOINT_PATH, 'w') + + name_to_codepoint_file.write(json.dumps(emoji_map)) + name_to_codepoint_file.close() + if __name__ == "__main__": main()