def check_chapters(): cards = get_cards() good_files, bad_files = [], [] for card in cards: m_ref = Ref(card.replace('Rambam ', '')) with codecs.open('{}.txt'.format(card), 'r', 'utf-8') as infile: tester = TagTester(u'@00', infile, u'@00\u05e4\u05e8\u05e7') tags = tester.grab_each_header() if len(tags) == len( m_ref.all_subrefs()) or card == 'Rambam Pirkei Avot': good_files.append(card) else: bad_files.append(card) return {'good': good_files, 'bad': bad_files}
def check_chapters(): cards = get_cards() good_files, bad_files = [], [] for card in cards: m_ref = Ref(card.replace('Rambam ', '')) with codecs.open('{}.txt'.format(card), 'r', 'utf-8') as infile: tester = TagTester(u'@00', infile, u'@00\u05e4\u05e8\u05e7') tags = tester.grab_each_header() if len(tags) == len(m_ref.all_subrefs()) or card == 'Rambam Pirkei Avot': good_files.append(card) else: bad_files.append(card) return { 'good': good_files, 'bad': bad_files }