Skip to content

Commit 5598b8a

Browse files
committed
Fixed #148 - input dir path doesn't need to end with '/'
1 parent a03dca1 commit 5598b8a

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

about_code_tool/about.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,12 +1332,12 @@ def generate_attribution(self, template_path=None, limit_to=None):
13321332
#if not_process_components:
13331333
for component in not_process_components:
13341334
for about_object in self:
1335-
# FIXME: what is the meaning of this partition?
1336-
# PO created the var some_path to provide some clarity
1337-
# but what does the second element means?
1338-
file_name = about_object.location.partition(self.location)[2]
1339-
# FIXME: a path starting with / is NOT relative
1340-
about_relative_path = '/' + file_name
1335+
# The about_object.location is the absolute path of the ABOUT
1336+
# file. The purpose of the following partition is to match
1337+
# the about_file's location with the input list.
1338+
about_relative_path = about_object.location.partition(
1339+
normpath(self.location))[2]
1340+
13411341
"""if limit_to:
13421342
try:
13431343
not_process_components.remove(about_relative_path)

about_code_tool/tests/test_about.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ def test_remove_blank_lines_and_no_colon_fields(self):
606606
self.assertEqual(expected_warnings[i][0], w.code)
607607
self.assertEqual(expected_warnings[i][1], w.field_value)
608608

609-
# FIXME: This is feeling because there is no component list provided
609+
# FIXME: This is failing because there is no component list provided
610610
def FAILING_test_generate_attribution_with_custom_template(self):
611611
expected = (u'notice_text:'
612612
'version:2.4.3'
@@ -618,7 +618,7 @@ def FAILING_test_generate_attribution_with_custom_template(self):
618618
result = collector.generate_attribution(template)
619619
self.assertEqual(expected, result)
620620

621-
# FIXME: This is feeling because there is no component list provided
621+
# FIXME: This is failing because there is no component list provided
622622
def FAILING_test_generate_attribution_with_default_template(self):
623623
f = open(join(TESTDATA_DIR, 'attrib/attrib.html'))
624624
expected = f.read()
@@ -685,7 +685,5 @@ def test_get_custom_field_keys(self):
685685
'redistribute_sources', 'about_format', 'usage',
686686
'scm_path', 'scm_tool', 'scm_rev', 'scm_tag',
687687
'organization']
688-
print(result)
689688
self.assertEqual(result, expected)
690689

691-

0 commit comments

Comments
 (0)