def main(tags, *args, **kwargs): # Create a new fetch index. last_fetch_index = QuestionSnapshot.select(fn.Max(QuestionSnapshot.fetch_index)).scalar() or 0 fetch_index = last_fetch_index + 1 with open(tags) as tag_file: tag_list = [t.strip() for t in tag_file.readlines()] for tag in tag_list: fetch_questions_for_tag(tag, fetch_index)
def main(tags, *args, **kwargs): # Create a new fetch index. last_fetch_index = QuestionSnapshot.select( fn.Max(QuestionSnapshot.fetch_index)).scalar() or 0 fetch_index = last_fetch_index + 1 with open(tags) as tag_file: tag_list = [t.strip() for t in tag_file.readlines()] for tag in tag_list: fetch_questions_for_tag(tag, fetch_index)