py3 generate_emoji_html.py
This commit is contained in:
parent
018aa149d6
commit
e604c969d3
|
@ -181,7 +181,7 @@ def _collect_aux_info(dir_infos, keys):
|
||||||
|
|
||||||
# now we need to invert the map
|
# now we need to invert the map
|
||||||
aux_info = collections.defaultdict(set)
|
aux_info = collections.defaultdict(set)
|
||||||
for key, index in target_key_to_info_index.iteritems():
|
for key, index in target_key_to_info_index.items():
|
||||||
aux_info[index].add(key)
|
aux_info[index].add(key)
|
||||||
|
|
||||||
return aux_info
|
return aux_info
|
||||||
|
@ -352,7 +352,7 @@ def _get_dir_infos(
|
||||||
|
|
||||||
|
|
||||||
def _add_aliases(keys, aliases):
|
def _add_aliases(keys, aliases):
|
||||||
for k, v in sorted(aliases.iteritems()):
|
for k, v in sorted(aliases.items()):
|
||||||
k_str = unicode_data.seq_to_string(k)
|
k_str = unicode_data.seq_to_string(k)
|
||||||
v_str = unicode_data.seq_to_string(v)
|
v_str = unicode_data.seq_to_string(v)
|
||||||
if k in keys:
|
if k in keys:
|
||||||
|
@ -360,7 +360,7 @@ def _add_aliases(keys, aliases):
|
||||||
print('have alias image %s, should use %s%s' % (k_str, v_str, msg))
|
print('have alias image %s, should use %s%s' % (k_str, v_str, msg))
|
||||||
elif v not in keys:
|
elif v not in keys:
|
||||||
print('can\'t use alias %s, no image matching %s' % (k_str, v_str))
|
print('can\'t use alias %s, no image matching %s' % (k_str, v_str))
|
||||||
to_add = {k for k, v in aliases.iteritems() if k not in keys and v in keys}
|
to_add = {k for k, v in aliases.items() if k not in keys and v in keys}
|
||||||
return keys | to_add
|
return keys | to_add
|
||||||
|
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ def _get_keys(dir_infos, aliases, limit, all_emoji, emoji_sort, ignore_missing):
|
||||||
|
|
||||||
|
|
||||||
def _generate_info_text(args):
|
def _generate_info_text(args):
|
||||||
lines = ['%s: %r' % t for t in sorted(args.__dict__.iteritems())]
|
lines = ['%s: %r' % t for t in sorted(args.__dict__.items())]
|
||||||
lines.append('generated by %s on %s' % (
|
lines.append('generated by %s on %s' % (
|
||||||
path.basename(__file__), datetime.datetime.now()))
|
path.basename(__file__), datetime.datetime.now()))
|
||||||
return '\n '.join(lines)
|
return '\n '.join(lines)
|
||||||
|
@ -546,7 +546,7 @@ def _get_canonical_aliases():
|
||||||
def canon(seq):
|
def canon(seq):
|
||||||
return unicode_data.get_canonical_emoji_sequence(seq) or seq
|
return unicode_data.get_canonical_emoji_sequence(seq) or seq
|
||||||
aliases = add_aliases.read_default_emoji_aliases()
|
aliases = add_aliases.read_default_emoji_aliases()
|
||||||
return {canon(k): canon(v) for k, v in aliases.iteritems()}
|
return {canon(k): canon(v) for k, v in aliases.items()}
|
||||||
|
|
||||||
def _get_canonical_excluded():
|
def _get_canonical_excluded():
|
||||||
def canon(seq):
|
def canon(seq):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user