diff --git a/call.cgi b/call.cgi index ec34d8d..03a6847 100755 --- a/call.cgi +++ b/call.cgi @@ -125,11 +125,12 @@ if candidate[-1][1].startswith("?"): candidate[-1][1] = "?〜"+date.strftime(datefmt) else: - if date.time() > dt.time(19,55) and date.time() > dt.time(18,45): + sdate = date.strftime(datefmt) + if date.time() > dt.time(19,55) or candidate[-1][1] > sdate: candidate[-1][1] += "〜記録無" candidate[-1][10] = "ログオフ記録無" else: - candidate[-1][1] += "〜" + date.strftime(datefmt) + candidate[-1][1] += "〜" + sdate elif fr < date and to > date: # no candidate to_entry = date.strftime(datefmt) entry = date.strftime(datefmt) @@ -184,7 +185,7 @@ else: prefix = room table_prefix = room - extract = [[host, str(student_no),logon[:5],logoff[-5:], name, reading, dep, "", pos] + extract = [[host, str(student_no),logon[:5],logoff[-5:], name, reading, dep, "-", pos] for host, logon, logoff, _, _, student_no, name, reading, dep, pos, status in lines if host != None and host.startswith(prefix)] @@ -209,9 +210,12 @@ "K01","K03","61"]; for e in extract: login = dt.time.fromisoformat(e[2]) - logout = dt.time.fromisoformat(e[3]) + if e[3] != "---": + logout = dt.time.fromisoformat(e[3]) + else: + logout = None font = None - if dt.time(18,45) >= login and logout >= dt.time(19,50): + if dt.time(18,45) >= login and logout and logout >= dt.time(19,50): e[3] = "記録無" e[7] = "ログオフ記録無" font = xlfont(color = "b00000") @@ -256,7 +260,7 @@ ws.append(['合計', '=COUNTA(StudentTable'+table_prefix+'[学籍番号])', '人']) ws.append([]) ws.append(["スタッフ"]) - ws.append(["ホスト名", "ユーザ名", "開始", "終了", "名前", "よみ", "所属","ステータス"]) + ws.append(["ホスト名", "ユーザ名", "開始", "終了", "名前", "よみ", "所属","備考"]) staff_start = ws.max_row for e in stafflist: ws.append(e)