<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setDiscoveryTriples(win,table="discovery"):
 """Provide user with a list of triples that could be discovery triples"""


    win.help("Getting a list of pointings with triples from the CFEPS db")

    pointings=getPointingsWithTriples()
    win.help("Select the "+table+" triple form the list...")
    import time
    for pointing in pointings:
        header="%10s %10s %8s %10s %8s" % (pointing[1],'mjdate','Elongation','Filter', 'IQ')
        triples=getTriples(pointing=pointing[0])
        choices=[]
        triplist=[]
	no_type=0
	previous_list=[]
        for triple in triples:
	    #win.help(str(triple))
            tripinfo=getTripInfo(triple[0])
            if not tripinfo[table]==None:
	        previous_list.append(triple[0])
	    #if not abs(180-tripinfo['elongation'])< 20:
	    #	continue
            triplist.append(triple)
            if str(tripinfo['iq'])=='None':
                    tripinfo['iq']=-1.0 
            obs_type=' '
	    if tripinfo['discovery']:
	    	obs_type='D'
	    elif tripinfo['checkup']:
	        obs_type='C'
            elif tripinfo['recovery']:
	        obs_type='R'
	    if obs_type==' ':
	        no_type+=1
            line=(obs_type,tripinfo['mjdate'], tripinfo['elongation'],
                  tripinfo['filter'], tripinfo['iq'], tripinfo['block'] ) 
            choices.append('%10s %10s %8.2f %10s %8.2f %8s' % line)
        if len(choices)==0 or no_type==0:
            continue
	#if len(previous_list)==1:
	#    continue
        win.help("Choose a "+table+" triple (space) [no choice means skip] then press enter\n (q) to exit")
        choice=win.list(header,choices)
        if choice==None:
            win.help("Loading next triple")
            break
    ### Record which triplet is a discovery triplet
        if len(choice)!=1:
            win.help("Loading next triple\n")
            continue
        discovery_triple=triplist[choice[0]]
	for triple in previous_list:
	    sql="DELETE FROM "+table+" WHERE triple=%s "
	    cfeps.execute(sql,triple)
        sql="INSERT INTO "+table+" ( triple ) VALUES ( %s ) "
        cfeps.execute(sql,discovery_triple)