UI/SymbolsWidget.py

changeset 2603
2efe1c237c33
parent 2302
f29e9405c851
child 2605
20036ebbf50a
child 3163
9f50365a0870
equal deleted inserted replaced
2597:951e631c9c1d 2603:2efe1c237c33
5 5
6 """ 6 """
7 Module implementing a widget to select a symbol in various formats. 7 Module implementing a widget to select a symbol in various formats.
8 """ 8 """
9 9
10 import sys
10 import unicodedata 11 import unicodedata
11 import html.entities 12 import html.entities
12 13
13 from PyQt4.QtCore import pyqtSlot, pyqtSignal, QAbstractTableModel, QModelIndex, Qt, \ 14 from PyQt4.QtCore import pyqtSlot, pyqtSignal, QAbstractTableModel, QModelIndex, Qt, \
14 qVersion 15 qVersion
39 self.trUtf8("Hex"), 40 self.trUtf8("Hex"),
40 self.trUtf8("HTML"), 41 self.trUtf8("HTML"),
41 self.trUtf8("Name"), 42 self.trUtf8("Name"),
42 ] 43 ]
43 44
44 self.__tables = ( 45 self.__tables = [
45 # first last display name 46 # first last display name
46 (0x0, 0x1f, self.trUtf8("Control Characters")), 47 (0x0, 0x1f, self.trUtf8("Control Characters")),
47 (0x20, 0x7f, self.trUtf8("Basic Latin")), 48 (0x20, 0x7f, self.trUtf8("Basic Latin")),
48 (0x80, 0x100, self.trUtf8("Latin-1 Supplement")), 49 (0x80, 0x100, self.trUtf8("Latin-1 Supplement")),
49 (0x100, 0x180, self.trUtf8("Latin Extended A")), 50 (0x100, 0x180, self.trUtf8("Latin Extended A")),
148 (0xfe50, 0xfe6f, self.trUtf8("Small Form Variants")), 149 (0xfe50, 0xfe6f, self.trUtf8("Small Form Variants")),
149 (0xfe70, 0xfefe, self.trUtf8("Arabic Presentation Forms-B")), 150 (0xfe70, 0xfefe, self.trUtf8("Arabic Presentation Forms-B")),
150 (0xfeff, 0xfeff, self.trUtf8("Specials")), 151 (0xfeff, 0xfeff, self.trUtf8("Specials")),
151 (0xff00, 0xffef, self.trUtf8("Half- and Fullwidth Forms")), 152 (0xff00, 0xffef, self.trUtf8("Half- and Fullwidth Forms")),
152 (0xfff0, 0xffff, self.trUtf8("Specials")), 153 (0xfff0, 0xffff, self.trUtf8("Specials")),
153 (0x10300, 0x1032f, self.trUtf8("Old Italic")), 154 ]
154 (0x10330, 0x1034f, self.trUtf8("Gothic")), 155 if sys.maxunicode > 0xffff:
155 (0x10400, 0x1044f, self.trUtf8("Deseret")), 156 self.__tables.extend([
156 (0x1d000, 0x1d0ff, self.trUtf8("Byzantine Musical Symbols")), 157 (0x10300, 0x1032f, self.trUtf8("Old Italic")),
157 (0x1d100, 0x1d1ff, self.trUtf8("Musical Symbols")), 158 (0x10330, 0x1034f, self.trUtf8("Gothic")),
158 (0x1d400, 0x1d7ff, self.trUtf8("Mathematical Alphanumeric Symbols")), 159 (0x10400, 0x1044f, self.trUtf8("Deseret")),
159 (0x20000, 0x2a6d6, self.trUtf8("CJK Unified Ideogr. Ext. B")), 160 (0x1d000, 0x1d0ff, self.trUtf8("Byzantine Musical Symbols")),
160 (0x2f800, 0x2fa1f, self.trUtf8("CJK Compatapility Ideogr. Suppl.")), 161 (0x1d100, 0x1d1ff, self.trUtf8("Musical Symbols")),
161 (0xe0000, 0xe007f, self.trUtf8("Tags")), 162 (0x1d400, 0x1d7ff, self.trUtf8("Mathematical Alphanumeric Symbols")),
162 ) 163 (0x20000, 0x2a6d6, self.trUtf8("CJK Unified Ideogr. Ext. B")),
164 (0x2f800, 0x2fa1f, self.trUtf8("CJK Compatapility Ideogr. Suppl.")),
165 (0xe0000, 0xe007f, self.trUtf8("Tags")),
166 ])
163 self.__currentTableIndex = 0 167 self.__currentTableIndex = 0
164 168
165 def getTableNames(self): 169 def getTableNames(self):
166 """ 170 """
167 Public method to get a list of table names. 171 Public method to get a list of table names.

eric ide

mercurial