MCPcopy Create free account
hub / github.com/ElementsProject/elements / gather_file_info

Function gather_file_info

contrib/devtools/copyright_header.py:149–173  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

147 return open(filename, 'r', encoding="utf8").read()
148
149def gather_file_info(filename):
150 info = {}
151 info['filename'] = filename
152 c = read_file(filename)
153 info['contents'] = c
154
155 info['all_copyrights'] = get_count_of_copyrights_of_any_style_any_holder(c)
156
157 info['classified_copyrights'] = 0
158 info['dominant_style'] = {}
159 info['year_list_style'] = {}
160 info['without_c_style'] = {}
161 for holder_name in EXPECTED_HOLDER_NAMES:
162 has_dominant_style = (
163 file_has_dominant_style_copyright_for_holder(c, holder_name))
164 has_year_list_style = (
165 file_has_year_list_style_copyright_for_holder(c, holder_name))
166 has_without_c_style = (
167 file_has_without_c_style_copyright_for_holder(c, holder_name))
168 info['dominant_style'][holder_name] = has_dominant_style
169 info['year_list_style'][holder_name] = has_year_list_style
170 info['without_c_style'][holder_name] = has_without_c_style
171 if has_dominant_style or has_year_list_style or has_without_c_style:
172 info['classified_copyrights'] = info['classified_copyrights'] + 1
173 return info
174
175################################################################################
176# report execution

Callers 1

exec_reportFunction · 0.85

Tested by

no test coverage detected