def reload(self): raw_dic = json_com.parse(self.cfg['path_to_dict']) stat = json_com.parse(self.cfg['path_to_stat']) self.cards = set() for en_word, transcription, ru_words in raw_dic: c = card.Card(en_word, transcription, ru_words.split(',')) if en_word in stat: c.unpack(stat[en_word]) self.cards.add(c)
def get_dic(self): dic = json_com.parse(self.path) for key in default_config.keys(): dic[key] = dic.get(key, default_config[key]) return dic