Skip to content

Commit 2956c00

Browse files
committed
The previous changes are incorrect. The previous code log all the resources in the limit_to as not found and generate attribution on all the resources that are not in the limit_to.
1 parent 33fd0ae commit 2956c00

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

about_code_tool/about.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,8 @@ def generate_attribution(self, template_path, limit_to=None):
12561256
about_object_fields = []
12571257
about_content_dict = {}
12581258

1259+
not_process_components = list(limit_to)
1260+
12591261
for about_object in self:
12601262
# FIXME: what is the meaning of this partition?
12611263
# PO created the var some_path to provide some clarity
@@ -1264,8 +1266,14 @@ def generate_attribution(self, template_path, limit_to=None):
12641266
# FIXME: a path starting with / is NOT relative
12651267
about_relative_path = '/' + file_name
12661268

1267-
if limit_to and about_relative_path in limit_to:
1268-
continue
1269+
if limit_to:
1270+
try:
1271+
not_process_components.remove(about_relative_path)
1272+
except Exception as e:
1273+
continue
1274+
1275+
#if limit_to and about_relative_path in limit_to:
1276+
# continue
12691277

12701278
about_content = about_object.validated_fields
12711279
# Add information in the dictionary if not in the ABOUT file
@@ -1298,7 +1306,7 @@ def generate_attribution(self, template_path, limit_to=None):
12981306

12991307
# find paths requested in the limit_to paths arg that do not point to
13001308
# a corresponding ABOUT file
1301-
for path in limit_to:
1309+
for path in not_process_components:
13021310
path = posix_path(path)
13031311
afp = join(self.location, path)
13041312
msg = ('The requested ABOUT file: %(afp)r does not exist. '

0 commit comments

Comments
 (0)