diff --git a/config.ini b/config.ini index 8e061fa..aa4a5ec 100644 --- a/config.ini +++ b/config.ini @@ -1,2 +1,4 @@ [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 diff --git a/ftracker/core.py b/ftracker/core.py index 4fce052..7433622 100644 --- a/ftracker/core.py +++ b/ftracker/core.py @@ -9,7 +9,8 @@ if not config: 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