MCPcopy Create free account
hub / github.com/PyWavelets/pywt / load_name_map

Function load_name_map

util/authors.py:141–161  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

139
140
141def load_name_map(filename):
142 name_map = {}
143
144 with open(filename, encoding='utf-8') as f:
145 for line in f:
146 line = line.strip()
147 if line.startswith("#") or not line:
148 continue
149
150 m = re.match(r'^(.*?)\s*<(.*?)>(.*?)\s*<(.*?)>\s*$', line)
151 if not m:
152 print(f"Invalid line in .mailmap: '{line!r}'", file=sys.stderr)
153 sys.exit(1)
154
155 new_name = m.group(1).strip()
156 old_name = m.group(3).strip()
157
158 if old_name and new_name:
159 name_map[old_name] = new_name
160
161 return name_map
162
163
164#------------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected