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

Class LoadHCinTable

python/cinbase/__init__.py:3390–3416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3388
3389
3390class LoadHCinTable(threading.Thread):
3391 def __init__(self, cbTS, HCinTable):
3392 threading.Thread.__init__(self)
3393 self.cbTS = cbTS
3394 self.HCinTable = HCinTable
3395
3396 def run(self):
3397 if DEBUG_MODE:
3398 self.cbTS.debug.setStartTimer("LoadHCinTable")
3399
3400 self.HCinTable.loading = True
3401 selCinFile = CinBase.hcinFileList[self.cbTS.cfg.selHCinType]
3402 jsonPath = os.path.join(self.cbTS.jsondir, selCinFile)
3403
3404 if self.HCinTable.cin is not None and hasattr(self.HCinTable.cin, '__del__'):
3405 self.HCinTable.cin.__del__()
3406
3407 self.HCinTable.cin = None
3408
3409 with io.open(jsonPath, 'r', encoding='utf8') as fs:
3410 self.HCinTable.cin = HCin(fs, self.cbTS.imeDirName)
3411 self.HCinTable.curCinType = self.cbTS.cfg.selHCinType
3412 self.HCinTable.loading = False
3413
3414 if DEBUG_MODE:
3415 self.cbTS.debug.setEndTimer("LoadHCinTable")
3416 self.cbTS.debugLog[time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + " [H]"] = self.cbTS.debug.info['brand'] + ":「" + self.cbTS.debug.jsonNameDict[selCinFile] + "」同音字碼表載入時間約為 " + self.cbTS.debug.getDurationTime("LoadHCinTable") + " 秒"

Callers 1

checkConfigChangeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected