예제 #1
0
파일: logic_proto.py 프로젝트: rosedu/cspay
def output_table(input, holidays, parities):

    F = dw.initializeWB("utf8")
    months = input["luni"]
    year1, year2 = input["an"].split("/")
    when = str(year1) + "-" + str(year2)
    try:
        where = unicode(input["functie_baza"], "utf8")
    except TypeError:
        where = input["functie_baza"]
    try:
        who = unicode(input["profesor"], "utf8")
    except TypeError:
        who = input["profesor"]
    title = when + " " + where + " " + who
    title = title.replace(" ", "_")
    print title

    for month in months:
        if month < 8:
            year = int(year2)
        else:
            year = int(year1)
        i = 0
        C_count = {"prof": [], "conf": [], "sl": [], "as": []}
        A_count = {"prof": [], "conf": [], "sl": [], "as": []}
        S = dw.initializeWS(F, ro_month(month).capitalize())
        write_header(
            S,
            input["universitate"],
            input["facultate"],
            input["catedra"],
            input["functie_baza"],
            input["profesor"],
            input["statut"],
            month,
        )

        courses = input["ore"]
        for curs in courses:
            i = insert_course(S, i, curs, year, month, input["semestru"], holidays, parities, C_count, A_count)
        write_totals(S, i + 7, C_count, A_count)
        write_footer(S, i + 16, input["profesor"], input["titular_curs"], input["sef_catedra"], input["decan"])
    dw.finish(F, title)
예제 #2
0
파일: logic_proto.py 프로젝트: rosedu/cspay
def output_table(input, holidays, parities, path):

	F= dw.initializeWB("utf8")
	months = input['luni']
	year1, year2 = input['an'].split('/')
	when = str(year1) + "-" + str (year2) 
	where = strip_diacritics(input['functie_baza'])
	who = strip_diacritics(input['profesor'])
	title = when + ' ' + where + ' ' + who
	title=path+title.replace(" ","_")
	
	for month in months:
		if month < 8:
			year = int(year2)
		else:
			year = int(year1)

		i = 0
		C_count = {'prof': [], 'conf': [], 'sl': [], 'as': [] }
		A_count = {'prof': [], 'conf': [], 'sl': [], 'as': [] }
		S = dw.initializeWS(F, ro_month(month).capitalize())
		write_header(S, input['universitate'], input['facultate'],
                             input['catedra'], input['functie_baza'],
                             input['profesor'], input['statut'], month)
		
#		print "written header for month", month
		courses = input['ore']
		for curs in courses:
#			print "prepare to insert (", S, ", ", i, ", ", curs, ", ", year, ", ", month, ", ", input['semestru'], ", ", holidays, ", ", parities, ", ", C_count, ", ", A_count, ")"
			i = insert_course(S, i, curs, year, month,
                                          input['semestru'], holidays, parities, C_count, A_count)
#			print "inserted (", S, ", ", i, ", ", curs, ", ", year, ", ", month, ", ", input['semestru'], ", ", holidays, ", ", parities, ", ", C_count, ", ", A_count, ")"

#		print "written courses for month", month

		write_totals(S, i + 7, C_count, A_count)
		write_footer(S, i + 16, input['profesor'],
                             input['titular_curs'], input['sef_catedra'],
                             input['decan'])

#		print "written info for month", month

	dw.finish(F, title)
예제 #3
0
파일: orar.py 프로젝트: rosedu/cspay
def output_orar(input, path):

	F = dw.initializeWB("utf8")
	months = input['luni']
	year1, year2 = input['an'].split('/')
	when = str(year1) + "-" + str (year2) 
	who = strip_diacritics(input['profesor'])
	title = "Orar" + ' ' + who + ' ' + when
	title = path + title.replace(" ","_")

	
	S = dw.initializeWS(F, input['profesor'], 1)
	write_header(S, input['universitate'], input['facultate'],
                             input['catedra'], 
                             input['profesor'], input['statut'])
	for i in range(0, 5):
		courses = get_day(input['ore'], i)
		if courses:
			courses.sort(cmp=order_by_h)
			insert_course(S, i, courses)
		else:
			jump(S, 7, 21, 2*i+1)
	dw.finish(F, title)