def __tryOpenWithOldApi(self, variant): lib = getVoikkoCLibrary() handle = c_int(-1) error = lib.voikko_init_with_path(byref(handle), variant, 0, self.dataDir.getDirectory()) isOk = not bool(error) lib.voikko_terminate(handle) return isOk
def __tryOpenWithNewApi(self, variant): lib = getVoikkoCLibrary() error = c_char_p() handle = lib.voikkoInit(byref(error), variant, self.dataDir.getDirectory()) if error.value == None: lib.voikkoTerminate(handle) return True else: return False