diff --git a/call.cgi b/call.cgi index fd9623d..e429e7c 100755 --- a/call.cgi +++ b/call.cgi @@ -111,9 +111,8 @@ lines.sort(lambda x,y: cmp(x[6],y[6])) for room in ["GRL", "ML1", "ML2", "HSJ"]: + wb.remove(wb[room+u"出席表"]) if room in form: - wb.remove(wb.get_sheet_by_name(room+u"出席表")) - #.remove() ws = wb.create_sheet(title = room+u"出席表") extract = [[host, str(student_no),logon[-5:],logoff[-5:], name, reading, dep] for host, logon, logoff, _, _, @@ -169,6 +168,8 @@ showLastColumn=False, showRowStripes=True, showColumnStripes=False) tab.tableStyleInfo = style ws.add_table(tab) + else: + wb.remove(wb[room+u"座席表"]) filename="attendancebook"+fr.strftime("%Y%m%d%H%M")+".xlsx" tname= tempfile.mktemp(filename)