2013-10-17 14:05:27 +00:00
|
|
|
#!/usr/bin/env python
|
2016-11-08 19:01:11 +00:00
|
|
|
|
2010-08-26 15:02:46 +00:00
|
|
|
import sys
|
|
|
|
import fileinput
|
|
|
|
|
|
|
|
def main(argv):
|
|
|
|
state = 0
|
|
|
|
for line in fileinput.input():
|
|
|
|
line = line.strip()
|
|
|
|
if not line or line.startswith('#'):
|
|
|
|
if state == 1:
|
|
|
|
state = 2
|
2014-06-15 03:14:33 +00:00
|
|
|
print ('}\n')
|
|
|
|
print (line)
|
2010-08-26 15:02:46 +00:00
|
|
|
continue
|
|
|
|
if state == 0:
|
2014-06-15 03:14:33 +00:00
|
|
|
print ('\nglyphname2unicode = {')
|
2010-08-26 15:02:46 +00:00
|
|
|
state = 1
|
|
|
|
(name,x) = line.split(';')
|
|
|
|
codes = x.split(' ')
|
2014-06-15 03:14:33 +00:00
|
|
|
print (' %r: u\'%s\',' % (name, ''.join( '\\u%s' % code for code in codes )))
|
2010-08-26 15:02:46 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__': sys.exit(main(sys.argv))
|