candidates = [] for filename in [xforx in self.__get_dictionaries(context) ifx in self.__cache]: candidates.append(self.__cache[filename].candidates) return {'sorted_candidates': candidates}
def __make_cache(self, context): for filename in self.__get_dictionaries(context): mtime = getmtime(filename) if filename in self.__cache and self.__cache[ filename].mtime == mtime: continue with open(filename, 'r', errors='replace') asf: self.__cache[filename] = DictCacheItem( mtime, [{'word': x.split('\t')[0], 'kind': x.split('\t')[1]} forx in sorted([x.strip() forx in f], key=str.lower) iflen(x.split('\t')) > 1] )