Fix temp storage config

This commit is contained in:
Oskar Winkels 2020-11-30 18:10:05 +01:00 committed by Oskar
parent 3fdd8859ce
commit 859a962aac
2 changed files with 4 additions and 1 deletions

View File

@ -1,2 +1,4 @@
[global] [global]
# Persistent file for storage of times, in .json format.
# Remove or leave empty for temporary (/tmp/ftracker-db.json) storage
db_file = db.json db_file = db.json

View File

@ -9,7 +9,8 @@ if not config:
from tinydb import TinyDB from tinydb import TinyDB
db = TinyDB(config.get('global','db_file', fallback='/tmp/ftracker-db.json'), indent=4) dbfile = config['global'].get('db_file') or '/tmp/ftracker-db.json'
db = TinyDB(dbfile, indent=4)
# TODO: Load name list if needed # TODO: Load name list if needed