MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / add_files

Function add_files

src/summarycode/tallies.py:444–455  ·  view source on GitHub ↗

Update in-place every package mapping in the `packages` list by updating or creating the the "files" attribute from the `resource`. Yield back the packages.

(packages, resource)

Source from the content-addressed store, hash-verified

442
443
444def add_files(packages, resource):
445 """
446 Update in-place every package mapping in the `packages` list by updating or
447 creating the the "files" attribute from the `resource`. Yield back the
448 packages.
449 """
450 for package in packages:
451 files = package['files'] = package.get('files') or []
452 fil = resource.to_dict(skinny=True)
453 if fil not in files:
454 files.append(fil)
455 yield package
456
457
458def package_tallies(resource, children, keep_details=False):

Callers 1

package_talliesFunction · 0.85

Calls 3

getMethod · 0.65
to_dictMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected