Skip to content

Commit 06ab5d9

Browse files
committed
Update code to find the license text correctly.
1 parent d74d8e4 commit 06ab5d9

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

about_code_tool/about.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,7 @@ def write_to_csv(self, output_path):
10861086
row_data = about_object.get_row_data(relative_path)
10871087
csv_writer.writerow(row_data)
10881088

1089-
def generate_attribution(self, template_path=None,
1090-
limit_to=None):
1089+
def generate_attribution(self, template_path=None, limit_to=None):
10911090
"""
10921091
Generates an attribution file from the current list of ABOUT objects.
10931092
The optional `limit_to` parameter allows to restrict the generated

about_code_tool/genattrib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def update_path_to_about(input_list):
7373
for row in input_list:
7474
if not row.endswith('.ABOUT'):
7575
if row.endswith('/'):
76-
row = row.rpartition('/')[0]
76+
row += basename(dirname(row))
7777
output_list.append(row + '.ABOUT')
7878
else:
7979
output_list.append(row)

about_code_tool/tests/test_genattrib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_check_have_about_file_not_start_with_slash(self):
5555

5656
def test_update_path_to_about(self):
5757
input_list = ['/test/test1.ABOUT', '/test/test2/', 'test/test3.c']
58-
expected_list = ['/test/test1.ABOUT', '/test/test2.ABOUT', 'test/test3.c.ABOUT']
58+
expected_list = ['/test/test1.ABOUT', '/test/test2/test2.ABOUT', 'test/test3.c.ABOUT']
5959
output = genattrib.update_path_to_about(input_list)
6060
self.assertTrue(expected_list == output)
6161

0 commit comments

Comments
 (0)