@@ -72,21 +72,21 @@ def generate(abouts, template=None, variables=None):
7272 license_file_key_and_license_key = {}
7373 # FIXME: This need to be simplified
7474 for about in abouts :
75- # about.license_file.value is a OrderDict with license_text_name as
75+ # about.license_file.value is a OrderDict with license_file_name as
7676 # the key and the license text as the value
7777 if about .license_file :
78- # We want to create a dictionary which have the license name as
78+ # We want to create a dictionary which have the license file name as
7979 # the key and license text as the value
8080 # The reason we want to use license file name as the key instead of the
8181 # license key is because there is a scenario such that the input only provide
8282 # license_file but not license_key
83- for license_text_name in about .license_file .value :
84- if not license_text_name in captured_license :
85- captured_license .append (license_text_name )
86- license_file_key = get_license_file_key (license_text_name )
87- license_file_key_and_context [license_file_key ] = about .license_file .value [license_text_name ]
83+ for license_file_name in about .license_file .value :
84+ if not license_file_name in captured_license :
85+ captured_license .append (license_file_name )
86+ license_file_key = get_license_file_key (license_file_name )
87+ license_file_key_and_context [license_file_key ] = about .license_file .value [license_file_name ]
8888 sorted_license_file_key_and_context = collections .OrderedDict (sorted (license_file_key_and_context .items ()))
89- license_file_name_and_license_file_key [license_text_name ] = license_file_key
89+ license_file_name_and_license_file_key [license_file_name ] = license_file_key
9090
9191 lic_list = []
9292 lic_name_list = []
@@ -114,12 +114,12 @@ def generate(abouts, template=None, variables=None):
114114 # linking feature in the jinja2 template
115115 about .license_key .value = about .license_file .value .keys ()
116116 lic_list = about .license_file .value .keys ()
117-
117+
118118 lic_name_list = about .license_name .value
119119
120120 # The order of the license_name and key should be the same
121121 # The length for both list should be the same
122- assert len (lic_name_list ) == len (lic_list )
122+ assert len (lic_name_list ) == len (lic_list )
123123
124124 # Map the license key to license name
125125 index_for_license_name_list = 0
@@ -142,18 +142,18 @@ def generate(abouts, template=None, variables=None):
142142 lic_name_expression = ' ' .join (lic_name_expression_list )
143143
144144 # Add the license name expression string into the about object
145- about .license_name_expression = lic_name_expression
145+ about .license_name_expression = lic_name_expression
146146
147147 # Get the current UTC time
148148 utcnow = datetime .datetime .utcnow ()
149149 rendered = template .render (
150150 abouts = abouts , common_licenses = COMMON_LICENSES ,
151151 license_file_key_and_context = sorted_license_file_key_and_context ,
152+ license_file_key_and_license_key = license_file_key_and_license_key ,
152153 license_file_name_and_license_file_key = license_file_name_and_license_file_key ,
154+ license_key_and_license_file_name = license_key_and_license_file_name ,
153155 license_key_and_license_name = license_key_and_license_name ,
154156 license_name_and_license_key = license_name_and_license_key ,
155- license_key_and_license_file_name = license_key_and_license_file_name ,
156- license_file_key_and_license_key = license_file_key_and_license_key ,
157157 utcnow = utcnow ,
158158 tkversion = __version__ ,
159159 variables = variables
0 commit comments