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

Function R_filename_handler

src/packagedcode/alpine.py:1092–1104  ·  view source on GitHub ↗

Return a new current_file FileReference in current_dir. Add to the ``file_references`` list (create it if not provided) Return a mapping of {'current_file': current_file, 'file_references': file_references}

(value, current_dir, file_references=None, **kwargs)

Source from the content-addressed store, hash-verified

1090
1091
1092def R_filename_handler(value, current_dir, file_references=None, **kwargs):
1093 """
1094 Return a new current_file FileReference in current_dir. Add to the
1095 ``file_references`` list (create it if not provided)
1096
1097 Return a mapping of {'current_file': current_file, 'file_references': file_references}
1098 """
1099 # operate on a copy for safety and create an empty list on first use
1100 file_references = file_references[:] if file_references else []
1101
1102 current_file = models.FileReference(path=posixpath.join(current_dir, value))
1103 file_references.append(current_file.to_dict())
1104 return {'current_file': current_file, 'file_references': file_references}
1105
1106
1107def Z_checksum_handler(value, current_file, **kwargs):

Callers

nothing calls this directly

Calls 3

joinMethod · 0.45
appendMethod · 0.45
to_dictMethod · 0.45

Tested by

no test coverage detected