tod_tasklist))) for i in range(0, len(tod_tasklist)): tod_tasks.append(TodTask(tod_tasklist[i].data)) # tod_tasks = (list(filter(lambda x: x['due'] != None and x['checked'] == 0 and x['is_deleted'] == 0 and x['due'] != None and x['due']['date'][:10] == today, tod_tasklist))) # pdb.set_trace() """ Okay, I want to write a little script that checks whether or not a task is there or not and, if not, ports it. """ matchDict = main.openMatchDict() #Also, update lists of tasks with matchDict file... matchDict = main.update_tod_matchDict(tod_tasks, matchDict) matchDict = main.update_hab_matchDict(hab_tasks, matchDict) #We'll want to just... pull all the unmatched completed tasks out of our lists of tasks. Yeah? tod_uniq, hab_uniq = main.get_uniqs(matchDict, tod_tasks, hab_tasks) #Okay, so what if there are two matched tasks in the two uniq lists that really should be paired? matchDict = main.check_newMatches(matchDict, tod_uniq, hab_uniq) tod_uniq = [] hab_uniq = [] tod_uniq, hab_uniq = main.get_uniqs(matchDict, tod_tasks, hab_tasks) #Here anything new in tod gets added to hab for tod in tod_uniq: tid = tod.id if tod.recurring == "Yes": new_hab = main.make_daily_from_tod(tod) else: new_hab = main.make_hab_from_tod(tod)
tod_tasks.append(TodTask(tod_tasklist[i].data)) """ Okay, I want to write a little script that checks whether or not a task is there or not and, if not, ports it. """ pkl_file = open('habtod_matchDict.pkl','rb') try: matchDict = pickle.load(pkl_file) except: matchDict = {} pkl_file.close() #We'll want to just... pull all the unmatched completed tasks out of our lists of tasks. Yeah? tod_uniq, hab_uniq = main.get_uniqs(matchDict, tod_tasks, hab_tasks) #Also, update main matchDict file... main.update_tod_matchDict(tod_tasks, matchDict) main.update_hab_matchDict(hab_tasks, matchDict) #Dailies in Habitica and recurring tasks in Todoist are a smidge weird, so we want to pull them both out and treat them a little separately hab_dailies = [] tod_recurring = [] r = [] #check to pull out all the unmatched tasks we DON'T see in matchDict, our dictionary of paired habitica and todoist tasks for tod_task in tod_uniq: for hab_task in hab_uniq: if tod_task.name == hab_task.name: tid = tod_task.id