Skip to content
Snippets Groups Projects
Commit 077f6441 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Fix timestamps in overview page

parent 7ff7dbae
No related branches found
No related tags found
1 merge request!757Fix timestamps in overview page
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment