|
57 | 57 |
|
58 | 58 | # The 'dje_license_key' will be removed and will use the 'dje_license' instead. |
59 | 59 | SUPPORTED_FIELDS = about.OPTIONAL_FIELDS + about.MANDATORY_FIELDS + \ |
60 | | - ('about_file', 'dje_license_key',) |
| 60 | + ('about_file',) |
61 | 61 |
|
62 | 62 | Warn = namedtuple('Warn', 'field_name field_value message',) |
63 | 63 | Error = namedtuple('Error', 'field_name field_value message',) |
@@ -247,7 +247,7 @@ def request_license_data(self, url, username, api_key, license_key): |
247 | 247 | self.extract_dje_license_error = True |
248 | 248 | self.errors.append(Error('username/key', username + '/' + api_key, error_msg)) |
249 | 249 | else: |
250 | | - self.errors.append(Error('dje_license_key', license_key, "Invalid 'dje_license_key'")) |
| 250 | + self.errors.append(Error('dje_license', license_key, "Invalid 'dje_license_key'")) |
251 | 251 | return {} |
252 | 252 | except urllib2.URLError: |
253 | 253 | if about.check_network_connection(): |
@@ -321,28 +321,28 @@ def get_dje_license_list(self, gen_location, input_list, gen_license): |
321 | 321 | self.errors.append(Error('license_text_file', license_file, "The 'license_text_file' does not exist.")) |
322 | 322 | else: |
323 | 323 | if gen_license: |
324 | | - if line['dje_license_key']: |
| 324 | + if line['dje_license']: |
325 | 325 | license_output_list.append(self.gen_license_list(line)) |
326 | 326 | else: |
327 | | - self.warnings.append(Warn('dje_license_key', '', |
328 | | - "Missing 'dje_license_key' for " + line['about_file'])) |
| 327 | + self.warnings.append(Warn('dje_license', '', |
| 328 | + "Missing 'dje_license' for " + line['about_file'])) |
329 | 329 | # This except condition will force the tool to create the |
330 | 330 | # 'license_text_file' key column from the self.gen_license_list(line) |
331 | 331 | except Exception as e: |
332 | 332 | if gen_license: |
333 | | - if line['dje_license_key']: |
| 333 | + if line['dje_license']: |
334 | 334 | license_output_list.append(self.gen_license_list(line)) |
335 | 335 | else: |
336 | | - self.warnings.append(Warn('dje_license_key', '', |
337 | | - "Missing 'dje_license_key' for " + line['about_file'])) |
| 336 | + self.warnings.append(Warn('dje_license', '', |
| 337 | + "Missing 'dje_license' for " + line['about_file'])) |
338 | 338 | return license_output_list |
339 | 339 |
|
340 | 340 | def pre_generation(self, gen_location, input_list, action_num, all_in_one, api_url, api_username, api_key): |
341 | 341 | output_list = [] |
342 | 342 | for line in input_list: |
343 | 343 | try: |
344 | | - if api_url and line['dje_license_key']: |
345 | | - line['dje_license'] = self.get_license_name_from_api(api_url, api_username, api_key, line['dje_license_key']) |
| 344 | + if api_url and line['dje_license']: |
| 345 | + line['dje_license_name'] = self.get_license_name_from_api(api_url, api_username, api_key, line['dje_license']) |
346 | 346 | except Exception as e: |
347 | 347 | pass |
348 | 348 | component_list = [] |
@@ -387,7 +387,7 @@ def pre_generation(self, gen_location, input_list, action_num, all_in_one, api_u |
387 | 387 |
|
388 | 388 | @staticmethod |
389 | 389 | def gen_license_list(line): |
390 | | - dje_key = line['dje_license_key'] |
| 390 | + dje_key = line['dje_license'] |
391 | 391 | file_location = line['about_file'] |
392 | 392 | if file_location.endswith('/'): |
393 | 393 | file_location = file_location.rpartition('/')[0] |
@@ -651,11 +651,11 @@ def main(parser, options, args): |
651 | 651 | sys.exit(errno.EINVAL) |
652 | 652 | for line in input_list: |
653 | 653 | try: |
654 | | - if line['dje_license_key']: |
| 654 | + if line['dje_license']: |
655 | 655 | break |
656 | 656 | except Exception as e: |
657 | 657 | print(repr(e)) |
658 | | - print("The input does not have the 'dje_license_key' key which is required.") |
| 658 | + print("The input does not have the 'dje_license' key which is required.") |
659 | 659 | sys.exit(errno.EINVAL) |
660 | 660 |
|
661 | 661 | dje_license_list = gen.get_dje_license_list(output_path, input_list, gen_license) |
|
0 commit comments