@@ -351,8 +351,20 @@ def get_dje_license_list(self, gen_location, input_list, gen_license, dje_licens
351351 if gen_license :
352352 if line ['dje_license' ]:
353353 license_output_list .append (self .gen_license_list (line ))
354- line ['license_text_file' ] = dje_license_dict [line ['dje_license_name' ]][0 ]\
355- + '.LICENSE'
354+ license_name_list = []
355+ if '\n ' in line ['dje_license_name' ]:
356+ license_name_list = line ['dje_license_name' ].split ('\n ' )
357+ else :
358+ license_name_list = [line ['dje_license_name' ]]
359+ for lic_name in license_name_list :
360+ try :
361+ if line ['license_text_file' ]:
362+ line ['license_text_file' ] += '\n '
363+ line ['license_text_file' ] += dje_license_dict [lic_name ][0 ]\
364+ + '.LICENSE'
365+ except :
366+ line ['license_text_file' ] = dje_license_dict [lic_name ][0 ]\
367+ + '.LICENSE'
356368 else :
357369 self .warnings .append (Warn ('dje_license' , '' ,
358370 "Missing 'dje_license' for " + line ['about_file' ]))
@@ -362,8 +374,20 @@ def get_dje_license_list(self, gen_location, input_list, gen_license, dje_licens
362374 if gen_license :
363375 if line ['dje_license' ]:
364376 license_output_list .append (self .gen_license_list (line ))
365- line ['license_text_file' ] = dje_license_dict [line ['dje_license_name' ]][0 ]\
366- + '.LICENSE'
377+ license_name_list = []
378+ if '\n ' in line ['dje_license_name' ]:
379+ license_name_list = line ['dje_license_name' ].split ('\n ' )
380+ else :
381+ license_name_list = [line ['dje_license_name' ]]
382+ for lic_name in license_name_list :
383+ try :
384+ if line ['license_text_file' ]:
385+ line ['license_text_file' ] += '\n '
386+ line ['license_text_file' ] += dje_license_dict [lic_name ][0 ]\
387+ + '.LICENSE'
388+ except :
389+ line ['license_text_file' ] = dje_license_dict [lic_name ][0 ]\
390+ + '.LICENSE'
367391 else :
368392 self .warnings .append (Warn ('dje_license' , '' ,
369393 "Missing 'dje_license' for " + line ['about_file' ]))
@@ -375,18 +399,28 @@ def pre_process_and_dje_license_dict(self, input_list, api_url, api_username, ap
375399 for line in input_list :
376400 try :
377401 if line ['dje_license' ]:
378- if not line ['dje_license' ] in license_dict :
379- detail_list = []
380- detail = self .get_license_details_from_api (api_url , api_username , api_key , line ['dje_license' ])
381- license_dict [line ['dje_license' ]] = detail [0 ]
382- line ['dje_license_name' ] = detail [0 ]
383- dje_key = detail [1 ]
384- license_context = detail [2 ]
385- detail_list .append (dje_key )
386- detail_list .append (license_context )
387- key_text_dict [line ['dje_license_name' ]] = detail_list
402+ license_list = []
403+ if '\n ' in line ['dje_license' ]:
404+ license_list = line ['dje_license' ].split ('\n ' )
388405 else :
389- line ['dje_license_name' ] = license_dict [line ['dje_license' ]]
406+ license_list = [line ['dje_license' ]]
407+ for lic in license_list :
408+ if not lic in license_dict :
409+ detail_list = []
410+ detail = self .get_license_details_from_api (api_url , api_username , api_key , lic )
411+ license_dict [lic ] = detail [0 ]
412+ try :
413+ if line ['dje_license_name' ]:
414+ line ['dje_license_name' ] += "\n " + detail [0 ]
415+ except :
416+ line ['dje_license_name' ] = detail [0 ]
417+ dje_key = detail [1 ]
418+ license_context = detail [2 ]
419+ detail_list .append (dje_key )
420+ detail_list .append (license_context )
421+ key_text_dict [detail [0 ]] = detail_list
422+ else :
423+ line ['dje_license_name' ] = license_dict [lic ]
390424 except Exception as e :
391425 self .warnings .append (Warn ('dje_license' , '' ,
392426 "Missing 'dje_license' for " + line ['about_file' ]))
@@ -395,17 +429,23 @@ def pre_process_and_dje_license_dict(self, input_list, api_url, api_username, ap
395429 def process_dje_licenses (self , dje_license_list , dje_license_dict , output_path ):
396430 license_list_context = []
397431 for gen_path , license_name in dje_license_list :
432+ license_list = []
433+ if '\n ' in license_name :
434+ license_list = license_name .split ('\n ' )
435+ else :
436+ license_list = license_name
398437 if gen_path .startswith ('/' ):
399438 gen_path = gen_path .partition ('/' )[2 ]
400- license_key = dje_license_dict [license_name ][0 ]
401- gen_license_path = join (output_path , gen_path , license_key ) + '.LICENSE'
402- if not _exists (gen_license_path ) and not self .extract_dje_license_error :
403- context = dje_license_dict [license_name ][1 ]
404- if context :
405- gen_path_context = []
406- gen_path_context .append (gen_license_path )
407- gen_path_context .append (context .encode ('utf8' ))
408- license_list_context .append (gen_path_context )
439+ for license in license_list :
440+ license_key = dje_license_dict [license ][0 ]
441+ gen_license_path = join (output_path , gen_path , license_key ) + '.LICENSE'
442+ if not _exists (gen_license_path ) and not self .extract_dje_license_error :
443+ context = dje_license_dict [license ][1 ]
444+ if context :
445+ gen_path_context = []
446+ gen_path_context .append (gen_license_path )
447+ gen_path_context .append (context .encode ('utf8' ))
448+ license_list_context .append (gen_path_context )
409449 return license_list_context
410450
411451 def pre_generation (self , gen_location , input_list , action_num , all_in_one ):
0 commit comments