MCPcopy Create free account
hub / github.com/EasyIME/PIME / __init__

Method __init__

python/cinbase/cin.py:14–60  ·  view source on GitHub ↗
(self, fs, imeDirName, ignorePrivateUseArea)

Source from the content-addressed store, hash-verified

12 encoding = 'utf-8'
13
14 def __init__(self, fs, imeDirName, ignorePrivateUseArea):
15 self.imeDirName = imeDirName
16 self.ignorePrivateUseArea = ignorePrivateUseArea
17 self.curdir = os.path.abspath(os.path.dirname(__file__))
18
19 self.ename = ""
20 self.cname = ""
21 self.selkey = ""
22 self.keynames = {}
23 self.cincount = {}
24 self.chardefs = {}
25 self.privateuse = {}
26 self.dupchardefs = {}
27
28 self.charsetRange = {}
29 self.charsetRange['bopomofo'] = [int('0x3100', 16), int('0x3130', 16)]
30 self.charsetRange['bopomofoTone'] = [int('0x02D9', 16), int('0x02CA', 16), int('0x02C7', 16), int('0x02CB', 16)]
31 self.charsetRange['cjk'] = [int('0x4E00', 16), int('0x9FEB', 16)]
32 self.charsetRange['big5F'] = [int('0xA440', 16), int('0xC67F', 16)]
33 self.charsetRange['big5LF'] = [int('0xC940', 16), int('0xF9D6', 16)]
34 self.charsetRange['big5S'] = [int('0xA140', 16), int('0xA3C0', 16)]
35 self.charsetRange['cjkExtA'] = [int('0x3400', 16), int('0x4DB6', 16)]
36 self.charsetRange['cjkExtB'] = [int('0x20000', 16), int('0x2A6D7', 16)]
37 self.charsetRange['cjkExtC'] = [int('0x2A700', 16), int('0x2B735', 16)]
38 self.charsetRange['cjkExtD'] = [int('0x2B740', 16), int('0x2B81E', 16)]
39 self.charsetRange['cjkExtE'] = [int('0x2B820', 16), int('0x2CEA2', 16)]
40 self.charsetRange['cjkExtF'] = [int('0x2CEB0', 16), int('0x2EBE1', 16)]
41 self.charsetRange['pua'] = [int('0xE000', 16), int('0xF900', 16)]
42 self.charsetRange['puaA'] = [int('0xF0000', 16), int('0xFFFFE', 16)]
43 self.charsetRange['puaB'] = [int('0x100000', 16), int('0x10FFFE', 16)]
44 self.charsetRange['cjkCIa'] = [int('0xF900', 16), int('0xFA0E', 16)]
45 self.charsetRange['cjkCIb'] = [int('0xFA0E', 16), int('0xFA0F', 16), int('0xFA11', 16), int('0xFA13', 16), int('0xFA14', 16), int('0xFA1F', 16), int('0xFA21', 16), int('0xFA23', 16), int('0xFA24', 16), int('0xFA27', 16), int('0xFA28', 16), int('0xFA29', 16)]
46 self.charsetRange['cjkCIc'] = [int('0xFA10', 16), int('0xFA12', 16), int('0xFA15', 16), int('0xFA16', 16), int('0xFA17', 16), int('0xFA18', 16), int('0xFA19', 16), int('0xFA1A', 16), int('0xFA1B', 16), int('0xFA1C', 16), int('0xFA1D', 16), int('0xFA1E', 16), int('0xFA20', 16), int('0xFA22', 16), int('0xFA25', 16), int('0xFA26', 16), int('0xFA2A', 16), int('0xFA2B', 16), int('0xFA2C', 16), int('0xFA2D', 16)]
47 self.charsetRange['cjkCId'] = [int('0xFA2E', 16), int('0xFB00', 16)]
48 self.charsetRange['cjkCIS'] = [int('0x2F800', 16), int('0x2FA20', 16)]
49
50 self.__dict__.update(json.load(fs))
51
52 if self.ignorePrivateUseArea:
53 for key in self.privateuse:
54 newvalue = list(self.chardefs[key])
55 for value in self.privateuse[key]:
56 if value in newvalue:
57 newvalue.remove(value)
58 self.chardefs[key] = newvalue
59
60 self.saveCountFile()
61
62
63 def __del__(self):

Callers

nothing calls this directly

Calls 4

saveCountFileMethod · 0.95
listFunction · 0.85
updateMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected