aboutsummaryrefslogtreecommitdiffstats
path: root/glutte_serial_web.py
diff options
context:
space:
mode:
Diffstat (limited to 'glutte_serial_web.py')
-rwxr-xr-xglutte_serial_web.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/glutte_serial_web.py b/glutte_serial_web.py
index 5ca905c..7710c9e 100755
--- a/glutte_serial_web.py
+++ b/glutte_serial_web.py
@@ -45,16 +45,7 @@ def index():
@app.route('/history')
def history():
- hist = []
- if config.CACHE_FILE:
- with open(config.CACHE_FILE) as fd:
- hist = json.load(fd)
-
- def format_entry(entry):
- dt = datetime.datetime.fromtimestamp(entry['ts']).isoformat()
- return f"{dt} {entry['line']}"
-
- text = "\n".join(format_entry(entry) for entry in hist)
+ text = "\n".join(f"{entry['ts'].isoformat()} {entry['line']}" for entry in ser.get_cache())
return Response(text, mimetype='text/plain')
@app.route('/stats')