예제 #1
0
파일: db_gather.py 프로젝트: rosedu/cspay
                                                 temp1['nume_scurt'],
                                                 temp2['nume_scurt']))
                                  
        vacante=[]
        cursor.execute(""" SELECT data_start, data_stop FROM vacante""")
        result_set = cursor.fetchall()
        for row in result_set:
                vacante.append((row['data_start'], row['data_stop']))

        cursor.close ()
        conn.close()

        if i:
                print "No pay-per-hour found for", name
        else:
                output_table(input, vacante, used_par)
	

def build_course(row, clas, fac):
        """Build a course structure from a database table row, the name
           of the course, and the name of the faculty
        """
        course = {'functie': "", 'nr_post': 0, 'facultate': "", 'zi': 0,
                  'tip': "", 'disciplina': "", 'grupa': "", 'ore': "",
                  'parit': 0, 'pari_st': 0}
        course['functie'] = conv_grade(row['grad_post'])
        course['nr_post'] = row['nr_post']
        course['zi'] = conv_day(row['zi'])
        course['tip'] = row['tip_ora']
        course['grupa'] = row['an_grupa']
        course['ore'] = row['ora']
예제 #2
0
파일: db_gather.py 프로젝트: rosedu/cspay
        result_set = cursor.fetchall()
        for row in result_set:
                vacante.append((row['data_start'], row['data_stop']))

        cursor.close ()
        conn.close()

        if i:
                if function:
                        print "No hour found for", name
                else:
                        print "No pay-per-hour found for", name
        else:
                if not function:
                        try:
                                output_table(input, vacante, used_par, path)
                        except:
                                print "Eroare export tabela: ",sys.exc_info()
                elif function == 1:
                        try:
                                output_orar(input, path)
                        except:
                              print "Eroare export orar xls: ",sys.exc_info()  
                else:
                        try:
                                output_ical(input, vacante, used_par, path)
                        except:
                                print "Eroareexport orar ics: ",sys.exc_info() 

        print "OK"