diff options
author | Rasmus Andersson <rasmus@notion.se> | 2018-01-14 00:52:47 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2018-01-14 00:52:47 +0300 |
commit | c026473d55667362f19373623d8c45e6c6afc3b7 (patch) | |
tree | 10668731f1ce289e6d2956531877bb627e59603b /misc/show-changes.py | |
parent | e2a8d2a702195548022dc8200221676aee9f12af (diff) | |
download | inter-c026473d55667362f19373623d8c45e6c6afc3b7.tar.xz |
misc/show-changes.py: handle removed glyphs
Diffstat (limited to 'misc/show-changes.py')
-rwxr-xr-x | misc/show-changes.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/misc/show-changes.py b/misc/show-changes.py index 4e5a7ef37..59f79b3e5 100755 --- a/misc/show-changes.py +++ b/misc/show-changes.py @@ -47,14 +47,18 @@ def main(): ufoPrefix = 'src/Inter-UI-' changes = OrderedDict() + deleted = [] for line in out.split('\n'): changeType, name = line.split('\t') if name.startswith(ufoPrefix) and name.endswith('.glif'): weight = name[len(ufoPrefix):name.find('.ufo/')] filename = os.path.join(rootdir, name) - doc = xmlParseFile(filename) - # print(changeType, weight, name) + try: + doc = xmlParseFile(filename) + except: + deleted.append('%s/%s' % (weight, os.path.basename(name))) + continue g = doc.documentElement gname = g.attributes['name'].value @@ -62,8 +66,6 @@ def main(): 'U+' + u.attributes['hex'].value for u in g.getElementsByTagName('unicode') ]) - # print('gname', gname) - # print('unicodes:', unicodes) c = changes.get(gname) if c is None: @@ -76,8 +78,6 @@ def main(): c['unicodes'] = c['unicodes'].union(unicodes) c['weights'].append((weight, changeType)) - # break - longestName = 0 names = sorted(changes.keys()) @@ -106,4 +106,10 @@ def main(): weightss = ' & '.join(weights) print('%s%s %s' % (name.ljust(longestName), unicodess, weightss)) + if len(deleted): + print('\nDeleted files') + for filename in deleted: + print('- %s' % filename) + + main()
\ No newline at end of file |