Return a mapping with a single 'copyrights' key with a value that is a list of mappings for copyright detected in the file at `location`.
(
location,
deadline=sys.maxsize,
**kwargs,
)
| 46 | |
| 47 | |
| 48 | def get_copyrights( |
| 49 | location, |
| 50 | deadline=sys.maxsize, |
| 51 | **kwargs, |
| 52 | ): |
| 53 | """ |
| 54 | Return a mapping with a single 'copyrights' key with a value that is a list |
| 55 | of mappings for copyright detected in the file at `location`. |
| 56 | """ |
| 57 | from cluecode.copyrights import detect_copyrights |
| 58 | from cluecode.copyrights import Detection |
| 59 | |
| 60 | detections = detect_copyrights( |
| 61 | location, |
| 62 | include_copyrights=True, |
| 63 | include_holders=True, |
| 64 | include_authors=True, |
| 65 | include_copyright_years=True, |
| 66 | include_copyright_allrights=False, |
| 67 | deadline=deadline, |
| 68 | ) |
| 69 | |
| 70 | copyrights, holders, authors = Detection.split(detections, to_dict=True) |
| 71 | |
| 72 | results = dict([ |
| 73 | ('copyrights', copyrights), |
| 74 | ('holders', holders), |
| 75 | ('authors', authors), |
| 76 | ]) |
| 77 | |
| 78 | # TODO: do something if we missed the deadline |
| 79 | return results |
| 80 | |
| 81 | |
| 82 | def get_emails( |
nothing calls this directly
no test coverage detected