Back to index

scribus-ng  1.3.4.dfsg+svn20071115
stripNamesListTxt.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 """ Simple unicode map with comments strip for Scribus
00004 It converts original file taken from:
00005 http://www.unicode.org/Public/5.0.0/ucd/NamesList.txt
00006 into simple hex:comment values map used in UnicodeSearch
00007 class
00008 Petr Vanek <petr@scribus.info>
00009 """
00010 print 'start stripping'
00011 
00012 f = open('NamesList.txt', 'r')
00013 
00014 out = {}
00015 for i in f:
00016     if i[:1] == '@' or i[:1] == '\t':
00017         continue
00018     str = i.split('\t')
00019     out[str[0]] = ' '.join(str[1:]).strip()
00020 
00021 f.close()
00022 
00023 print 'writting output'
00024 
00025 f = open('unicodenameslist.txt', 'w')
00026 for i in out:
00027     f.write("%s:%s\n" % (i, out[i]))
00028 f.close()
00029 
00030 print 'done'
00031