diff --git a/webservice/serve_overview.py b/webservice/serve_overview.py index 2aaf6fecc6f172e3952290234c3299d89b460be5..1e445cf70ef642d42468280dfda8102a74665016 100644 --- a/webservice/serve_overview.py +++ b/webservice/serve_overview.py @@ -4,6 +4,7 @@ import os import shlex import sqlite3 from datetime import datetime, timezone +from dateutil.parser import parse as parse_datetime from http.server import BaseHTTPRequestHandler, HTTPServer from pathlib import Path from shutil import copyfileobj @@ -257,6 +258,8 @@ class RequestHandler(BaseHTTPRequestHandler): f"{in_folder}/r{run:04d}/*{mp}*.h5"): tsize += os.stat(f).st_size + timestamp = parse_datetime(timestamp).strftime('%Y-%m-%d %H:%M:%S') + last_chars[key] = {"in_path": in_folder, "out_path": out_folder, "runs": runs, @@ -294,9 +297,10 @@ class RequestHandler(BaseHTTPRequestHandler): pdfs.sort(key=os.path.getmtime, reverse=True) pdfs = {p.split("/")[-1]: p for p in pdfs} + timestamp = parse_datetime(timestamp).strftime('%Y-%m-%d %H:%M') if not any(r[1:3] == (proposal, runs[0]) for r in inst_records): inst_records.append(( - timestamp[:-4], proposal, runs[0], pdfs + timestamp, proposal, runs[0], pdfs )) return last_calib