|
|
@ -66,6 +66,7 @@ if __name__ == '__main__': |
|
|
|
'Flags': flags |
|
|
|
'Flags': flags |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
previous_name = '' |
|
|
|
current_category = '' |
|
|
|
current_category = '' |
|
|
|
for line in open(filename, 'r'): |
|
|
|
for line in open(filename, 'r'): |
|
|
|
if line.startswith('# group:'): |
|
|
|
if line.startswith('# group:'): |
|
|
@ -80,16 +81,17 @@ if __name__ == '__main__': |
|
|
|
|
|
|
|
|
|
|
|
code, qualification, charAndName = segments |
|
|
|
code, qualification, charAndName = segments |
|
|
|
|
|
|
|
|
|
|
|
# skip fully qualified versions of same unicode |
|
|
|
|
|
|
|
if code.endswith('FE0F'): |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if qualification == 'component': |
|
|
|
if qualification == 'component': |
|
|
|
continue |
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
char, name = re.match(r'^(\S+) E\d+\.\d+ (.*)$', charAndName).groups() |
|
|
|
char, name = re.match(r'^(\S+) E\d+\.\d+ (.*)$', charAndName).groups() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# skip less fully qualified versions of same unicode |
|
|
|
|
|
|
|
if name == previous_name: |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
categories[current_category].append(Emoji(char, name)) |
|
|
|
categories[current_category].append(Emoji(char, name)) |
|
|
|
|
|
|
|
previous_name = name |
|
|
|
|
|
|
|
|
|
|
|
# Use xclip to pipe the output to clipboard. |
|
|
|
# Use xclip to pipe the output to clipboard. |
|
|
|
# e.g ./codegen.py emoji.json | xclip -sel clip |
|
|
|
# e.g ./codegen.py emoji.json | xclip -sel clip |
|
|
@ -101,4 +103,4 @@ if __name__ == '__main__': |
|
|
|
generate_code(objects, 'objects') |
|
|
|
generate_code(objects, 'objects') |
|
|
|
generate_code(symbols, 'symbols') |
|
|
|
generate_code(symbols, 'symbols') |
|
|
|
generate_code(flags, 'flags') |
|
|
|
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) |
|
|
|