Skip to content

Commit

Permalink
Fixed #114
Browse files Browse the repository at this point in the history
The problem is the tool trying to find the license in a different location.
  • Loading branch information
chinyeungli committed Jul 2, 2014
1 parent 06ab5d9 commit a8234e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions about_code_tool/genabout.py
Expand Up @@ -23,7 +23,7 @@

from collections import namedtuple
from os import makedirs
from os.path import exists, dirname, join, abspath, isdir
from os.path import exists, dirname, join, abspath, isdir, normpath

import about

Expand Down Expand Up @@ -317,10 +317,10 @@ def get_dje_license_list(self, gen_location, input_list, gen_license, dje_licens
# update/overwrite the 'license_text_file' with 'dje_license_key'
if line['license_text_file']:
file_location = line['about_file']
if file_location.endswith('/'):
file_location = file_location.rpartition('/')[0]
#if file_location.endswith('/'):
# file_location = file_location.rpartition('/')[0]
about_parent_dir = dirname(file_location)
license_file = gen_location.rpartition('/')[0] + join(about_parent_dir, line['license_text_file'])
license_file = normpath(gen_location.rpartition('/')[0] + join(about_parent_dir, line['license_text_file']))
if not _exists(license_file):
self.errors.append(Error('license_text_file', license_file, "The 'license_text_file' does not exist."))
else:
Expand Down
2 changes: 1 addition & 1 deletion about_code_tool/tests/test_genabout.py
Expand Up @@ -218,7 +218,7 @@ def test_get_dje_license_list_dir_no_gen_license_with_license_text_file_key_exis
gen_location = join(TESTDATA_PATH, "test_files_for_genabout/")
input_list = [{'about_file': '/ABOUT/', 'version': '0.8.1',
'about_resource': '.', 'name': 'ABOUT tool',
'license_text_file': '../../../../apache2.LICENSE'}]
'license_text_file': '../../../../../apache2.LICENSE'}]
expected_output_list = []
gen_license = False
dje_license_dict = {}
Expand Down

0 comments on commit a8234e3

Please sign in to comment.