mirror of
https://github.com/rsms/inter.git
synced 2024-11-27 09:49:07 +03:00
misc/show-changes.py: handle removed glyphs
This commit is contained in:
parent
e2a8d2a702
commit
c026473d55
@ -47,14 +47,18 @@ def main():
|
|||||||
|
|
||||||
ufoPrefix = 'src/Inter-UI-'
|
ufoPrefix = 'src/Inter-UI-'
|
||||||
changes = OrderedDict()
|
changes = OrderedDict()
|
||||||
|
deleted = []
|
||||||
|
|
||||||
for line in out.split('\n'):
|
for line in out.split('\n'):
|
||||||
changeType, name = line.split('\t')
|
changeType, name = line.split('\t')
|
||||||
if name.startswith(ufoPrefix) and name.endswith('.glif'):
|
if name.startswith(ufoPrefix) and name.endswith('.glif'):
|
||||||
weight = name[len(ufoPrefix):name.find('.ufo/')]
|
weight = name[len(ufoPrefix):name.find('.ufo/')]
|
||||||
filename = os.path.join(rootdir, name)
|
filename = os.path.join(rootdir, name)
|
||||||
|
try:
|
||||||
doc = xmlParseFile(filename)
|
doc = xmlParseFile(filename)
|
||||||
# print(changeType, weight, name)
|
except:
|
||||||
|
deleted.append('%s/%s' % (weight, os.path.basename(name)))
|
||||||
|
continue
|
||||||
|
|
||||||
g = doc.documentElement
|
g = doc.documentElement
|
||||||
gname = g.attributes['name'].value
|
gname = g.attributes['name'].value
|
||||||
@ -62,8 +66,6 @@ def main():
|
|||||||
'U+' + u.attributes['hex'].value
|
'U+' + u.attributes['hex'].value
|
||||||
for u in g.getElementsByTagName('unicode')
|
for u in g.getElementsByTagName('unicode')
|
||||||
])
|
])
|
||||||
# print('gname', gname)
|
|
||||||
# print('unicodes:', unicodes)
|
|
||||||
|
|
||||||
c = changes.get(gname)
|
c = changes.get(gname)
|
||||||
if c is None:
|
if c is None:
|
||||||
@ -76,8 +78,6 @@ def main():
|
|||||||
c['unicodes'] = c['unicodes'].union(unicodes)
|
c['unicodes'] = c['unicodes'].union(unicodes)
|
||||||
c['weights'].append((weight, changeType))
|
c['weights'].append((weight, changeType))
|
||||||
|
|
||||||
# break
|
|
||||||
|
|
||||||
longestName = 0
|
longestName = 0
|
||||||
names = sorted(changes.keys())
|
names = sorted(changes.keys())
|
||||||
|
|
||||||
@ -106,4 +106,10 @@ def main():
|
|||||||
weightss = ' & '.join(weights)
|
weightss = ' & '.join(weights)
|
||||||
print('%s%s %s' % (name.ljust(longestName), unicodess, weightss))
|
print('%s%s %s' % (name.ljust(longestName), unicodess, weightss))
|
||||||
|
|
||||||
|
if len(deleted):
|
||||||
|
print('\nDeleted files')
|
||||||
|
for filename in deleted:
|
||||||
|
print('- %s' % filename)
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
Loading…
Reference in New Issue
Block a user