Skip to content

Commit e981f3d

Browse files
committed
the unified_dict_list is not working. restore the code base.
1 parent f7f24de commit e981f3d

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

about_code_tool/genabout.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
# ============================================================================
16-
1716
"""
1817
This is a tool to generate ABOUT files based on the input file.
1918
The input file should be a csv format which contains information about the
@@ -22,25 +21,25 @@
2221

2322
from __future__ import print_function
2423

24+
from collections import namedtuple
2525
import copy
2626
import csv
2727
import errno
2828
import json
2929
import logging
3030
import optparse
31+
from os import makedirs
3132
import os
33+
from os.path import exists, dirname, join, abspath, isdir, normpath, basename, expanduser
3234
import shutil
3335
import sys
3436
import urllib
3537
import urllib2
36-
37-
from collections import namedtuple
3838
from urlparse import urljoin, urlparse
39-
from os import makedirs
40-
from os.path import exists, dirname, join, abspath, isdir, normpath, basename, expanduser
4139

4240
import about
4341

42+
4443
__version__ = '2.0.2'
4544

4645
__copyright__ = """
@@ -597,22 +596,19 @@ def format_output(input_list):
597596
"""
598597
components_list = []
599598
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])
603599
component = []
604-
component_name = unified_dict_list.get('name', '')
605-
component_version = unified_dict_list.get('version', '')
600+
component_name = about_dict_list.get('name', '')
601+
component_version = about_dict_list.get('version', '')
606602
context = 'about_resource: %s\nname: %s\nversion: %s\n\n' % (
607-
unified_dict_list['about_resource'], component_name, component_version)
603+
about_dict_list['about_resource'], component_name, component_version)
608604

609-
for item in sorted(unified_dict_list.iterkeys()):
605+
for item in sorted(about_dict_list.iterkeys()):
610606
if item == 'about_file':
611607
continue
612608
if not item in about.MANDATORY_FIELDS:
613609
# The purpose of the replace('\n', '\n ') is used to
614610
# format the continuation strings
615-
value = unified_dict_list[item].replace('\n', '\n ')
611+
value = about_dict_list[item].replace('\n', '\n ')
616612
if (value or item in about.MANDATORY_FIELDS) and not item\
617613
in about.ERROR_WARN_FIELDS and not item == 'about_resource':
618614
context += item + ': ' + value + '\n'

0 commit comments

Comments
 (0)