Skip to content

Commit a8234e3

Browse files
committed
Fixed #114
The problem is the tool trying to find the license in a different location.
1 parent 06ab5d9 commit a8234e3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

about_code_tool/genabout.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from collections import namedtuple
2525
from os import makedirs
26-
from os.path import exists, dirname, join, abspath, isdir
26+
from os.path import exists, dirname, join, abspath, isdir, normpath
2727

2828
import about
2929

@@ -317,10 +317,10 @@ def get_dje_license_list(self, gen_location, input_list, gen_license, dje_licens
317317
# update/overwrite the 'license_text_file' with 'dje_license_key'
318318
if line['license_text_file']:
319319
file_location = line['about_file']
320-
if file_location.endswith('/'):
321-
file_location = file_location.rpartition('/')[0]
320+
#if file_location.endswith('/'):
321+
# file_location = file_location.rpartition('/')[0]
322322
about_parent_dir = dirname(file_location)
323-
license_file = gen_location.rpartition('/')[0] + join(about_parent_dir, line['license_text_file'])
323+
license_file = normpath(gen_location.rpartition('/')[0] + join(about_parent_dir, line['license_text_file']))
324324
if not _exists(license_file):
325325
self.errors.append(Error('license_text_file', license_file, "The 'license_text_file' does not exist."))
326326
else:

about_code_tool/tests/test_genabout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_get_dje_license_list_dir_no_gen_license_with_license_text_file_key_exis
218218
gen_location = join(TESTDATA_PATH, "test_files_for_genabout/")
219219
input_list = [{'about_file': '/ABOUT/', 'version': '0.8.1',
220220
'about_resource': '.', 'name': 'ABOUT tool',
221-
'license_text_file': '../../../../apache2.LICENSE'}]
221+
'license_text_file': '../../../../../apache2.LICENSE'}]
222222
expected_output_list = []
223223
gen_license = False
224224
dje_license_dict = {}

0 commit comments

Comments
 (0)