MCPcopy
hub / github.com/rsms/inter / loadNamesFromDiff

Function loadNamesFromDiff

misc/tools/restore-diacritics-kerning.py:98–116  ·  view source on GitHub ↗
(diffFilename)

Source from the content-addressed store, hash-verified

96
97
98def loadNamesFromDiff(diffFilename):
99 with open(diffFilename, 'r') as f:
100 diffLines = [s.strip() for s in f.read().splitlines() if s.startswith('+\t')]
101 diffLines = [s for s in diffLines if not s.startswith('<int')]
102 namesInDiff = set()
103 for s in diffLines:
104 if s.startswith('<int') or s.startswith('<arr') or s.startswith('</'):
105 continue
106 p = s.find('>')
107 if p != -1:
108 p2 = s.find('<', p+1)
109 if p2 != -1:
110 name = s[p+1:p2]
111 try:
112 int(name)
113 except:
114 if not name.startswith('@'):
115 namesInDiff.add(s[p+1:p2])
116 return namesInDiff
117
118
119def loadGroups(filename):

Callers 1

mainFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…