diff --git a/call.cgi b/call.cgi index 14011c4..5b0c3f0 100755 --- a/call.cgi +++ b/call.cgi @@ -67,7 +67,7 @@ for date, action in db[machine]: if action.startswith("on:"): action, id_ = action.split(":") - id_ = id_.lower() + id_ = id_.lower() if date < to: if id_ in maildb: date = date.strftime(datefmt) @@ -80,10 +80,10 @@ # 7 8 maildb[id_]["reading"], maildb[id_]["dep"]]) elif action.startswith("reject") and candidate: # exclude double-login - action, id_, host = action.split(":") - if id_.lower() == candidate[-1][4]: - reject = True - candidate.pop() + action, id_, host = action.split(":") + if id_.lower() == candidate[-1][4]: + reject = True + candidate.pop() elif action.startswith("shutdown") and candidate: action = "off:" + candidate[-1][4] if action.startswith("off:"): @@ -118,7 +118,7 @@ wb.remove(wb[room+u"出席表"]) if room in form: ws = wb.create_sheet(title = room+u"出席表") - extract = [[host, str(student_no),logon[:5],logoff[-5:], name, reading, dep] + extract = [[host, str(student_no),logon[:5],logoff[-5:], name, reading, dep] for host, logon, logoff, _, _, student_no, name, reading, dep in lines if host.startswith(room)] @@ -127,13 +127,28 @@ ws.column_dimensions["E"].width =15.0; ws.column_dimensions["F"].width =18.0; ws.column_dimensions["G"].width =7.0; # setup width of each columns - ws.append(["学生", "","","", fr.strftime("%Y/%m/%d"), fr.strftime("%H:%M")+"〜"+ to.strftime("%H:%M")]) + ws.append(["学生", "","","", fr.strftime("%Y/%m/%d"), fr.strftime("%H:%M")+"〜"+ to.strftime("%H:%M")]) ws.append(["ホスト名", "学籍番号", "開始", "終了", "名前", "よみ", "所属"]) stafflist=[] prev = None row = None align = Alignment(wrap_text=True, vertical="center", horizontal="center") + HSJroomA = [ "01","02","03","04","05","06", + "11","12","13","14","15","16", + "21","22","23","24","25","26", + "31","32","33","34","35","36", + "41","42","43","44", + "51","52","53","54", + "K01","K03","61"]; for e in extract: + if room == "HSJ": + in_rooma = e[0][4:] in HSJroomA + if in_rooma: + if not "HSJ-A" in form: + continue + else: + if not "HSJ-B" in form: + continue if e[6] != "STAFF" and not e[1].startswith("M"): if prev == e[1]: row = str(ws.max_row)