| 3388 | |
| 3389 | |
| 3390 | class 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") + " 秒" |