Skip to content

Commit 2e517d0

Browse files
committed
Fixed #112
Handle multiple files with newline chara
1 parent 0060f60 commit 2e517d0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

about_code_tool/genabout.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,20 @@ def get_dje_license_list(self, gen_location, input_list, gen_license, dje_licens
333333
# If there is value in 'license_text_file', the tool will not
334334
# update/overwrite the 'license_text_file' with 'dje_license_key'
335335
if line['license_text_file']:
336+
file_value = []
337+
license_file_list = []
336338
file_location = line['about_file']
337-
#if file_location.endswith('/'):
338-
# file_location = file_location.rpartition('/')[0]
339339
about_parent_dir = dirname(file_location)
340-
license_file = normpath(gen_location.rpartition('/')[0] + join(about_parent_dir, line['license_text_file']))
341-
if not _exists(license_file):
342-
self.errors.append(Error('license_text_file', license_file, "The 'license_text_file' does not exist."))
340+
if '\n' in line['license_text_file']:
341+
file_value = line['license_text_file'].split('\n')
342+
else:
343+
file_value = [line['license_text_file']]
344+
for license_text_file in file_value:
345+
license_file_list.append(normpath(gen_location.rpartition('/')[0] + join(about_parent_dir, license_text_file)))
346+
print(license_file_list)
347+
for license_file in license_file_list:
348+
if not _exists(license_file):
349+
self.errors.append(Error('license_text_file', license_file, "The 'license_text_file' does not exist."))
343350
else:
344351
if gen_license:
345352
if line['dje_license']:

0 commit comments

Comments
 (0)