Skip to content

Commit f7f24de

Browse files
committed
Unify the value in the dictionary list to work with unicode.
1 parent 5a5b639 commit f7f24de

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

about_code_tool/genabout.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,19 +597,22 @@ def format_output(input_list):
597597
"""
598598
components_list = []
599599
for about_file_location, about_dict_list in input_list:
600+
unified_dict_list = {}
601+
for key in about_dict_list:
602+
unified_dict_list[key] = u''.join(about_dict_list[key])
600603
component = []
601-
component_name = about_dict_list.get('name', '')
602-
component_version = about_dict_list.get('version', '')
604+
component_name = unified_dict_list.get('name', '')
605+
component_version = unified_dict_list.get('version', '')
603606
context = 'about_resource: %s\nname: %s\nversion: %s\n\n' % (
604-
about_dict_list['about_resource'], component_name, component_version)
607+
unified_dict_list['about_resource'], component_name, component_version)
605608

606-
for item in sorted(about_dict_list.iterkeys()):
609+
for item in sorted(unified_dict_list.iterkeys()):
607610
if item == 'about_file':
608611
continue
609612
if not item in about.MANDATORY_FIELDS:
610613
# The purpose of the replace('\n', '\n ') is used to
611614
# format the continuation strings
612-
value = about_dict_list[item].replace('\n', '\n ')
615+
value = unified_dict_list[item].replace('\n', '\n ')
613616
if (value or item in about.MANDATORY_FIELDS) and not item\
614617
in about.ERROR_WARN_FIELDS and not item == 'about_resource':
615618
context += item + ': ' + value + '\n'

0 commit comments

Comments
 (0)