1
0

style: Format code for improved readability and consistency

This commit is contained in:
Jon Michael Aanes 2025-04-08 22:52:29 +02:00 committed by Jon Michael Aanes (aider)
parent 0e1779cca0
commit b60b8c7416

View File

@ -1,7 +1,6 @@
import datetime
import json
import logging import logging
from pathlib import Path from pathlib import Path
import bottle import bottle
from personal_data import csv_import from personal_data import csv_import
@ -19,7 +18,7 @@ def newest_entry(csv_type: str):
finds the newest entry based on the 'time.current' column, and returns it as JSON. finds the newest entry based on the 'time.current' column, and returns it as JSON.
""" """
path = ROOT_DIRECTORY/f'{csv_type}.csv' path = ROOT_DIRECTORY / f'{csv_type}.csv'
bottle.response.content_type = 'application/json' bottle.response.content_type = 'application/json'
@ -41,7 +40,10 @@ def newest_entry(csv_type: str):
else: else:
newest = data[-1] newest = data[-1]
return {csv_import.csv_safe_value(k):csv_import.csv_safe_value(v) for k,v in newest.items()} return {
csv_import.csv_safe_value(k): csv_import.csv_safe_value(v)
for k, v in newest.items()
}
if __name__ == '__main__': if __name__ == '__main__':