From 03e6d6e39cc3694a4157b48e3afe76cfa8c85dd2 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 21 Oct 2019 16:03:06 +0100 Subject: [PATCH] map_pua_emoji: use itertools.chain() to concatenate dict.items() --- map_pua_emoji.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/map_pua_emoji.py b/map_pua_emoji.py index 912ddac50..bd8e10273 100644 --- a/map_pua_emoji.py +++ b/map_pua_emoji.py @@ -19,6 +19,7 @@ __author__ = 'roozbeh@google.com (Roozbeh Pournader)' import sys +import itertools from fontTools import ttLib @@ -53,8 +54,9 @@ def add_pua_cmap(source_file, target_file): """Add PUA characters to the cmap of the first font and save as second.""" font = ttLib.TTFont(source_file) cmap = font_data.get_cmap(font) - for pua, (ch1, ch2) in (list(add_emoji_gsub.EMOJI_KEYCAPS.items()) - + list(add_emoji_gsub.EMOJI_FLAGS.items())): + for pua, (ch1, ch2) in itertools.chain( + add_emoji_gsub.EMOJI_KEYCAPS.items(), add_emoji_gsub.EMOJI_FLAGS.items() + ): if pua not in cmap: glyph_name = get_glyph_name_from_gsub([ch1, ch2], font) if glyph_name is not None: