From 27ca7fac03972dbe360fd0c40e3e370934781d04 Mon Sep 17 00:00:00 2001 From: boyska Date: Fri, 22 May 2015 16:27:29 +0200 Subject: [PATCH] default DB_URI = ~/.config/larigira/db.json fixes #8 --- larigira/config.py | 7 ++++++- setup.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/larigira/config.py b/larigira/config.py index 9143b64..d571115 100644 --- a/larigira/config.py +++ b/larigira/config.py @@ -6,15 +6,20 @@ Taken from flask-appconfig import json import os +from xdg import BaseDirectory + def get_conf(prefix='LARIGIRA_'): '''This is where everyone should get configuration from''' + conf_dir = os.path.join(BaseDirectory.xdg_config_home, 'larigira') + if not os.path.exists(conf_dir): + os.mkdir(conf_dir) conf = {} conf['CONTINOUS_AUDIODESC'] = dict(kind='mpd', howmany=1) conf['MPD_HOST'] = os.getenv('MPD_HOST', 'localhost') conf['MPD_PORT'] = int(os.getenv('MPD_PORT', '6600')) conf['CACHING_TIME'] = 10 - conf['DB_URI'] = 'larigira.db' + conf['DB_URI'] = os.path.join(conf_dir, 'db.json') conf['BOOTSTRAP_SERVE_LOCAL'] = True conf['SECRET_KEY'] = 'Please replace me!' conf['MPD_WAIT_START'] = True diff --git a/setup.py b/setup.py index 0894aab..dbf6b6a 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ setup(name='larigira', license='AGPL', packages=['larigira', 'larigira.dbadmin'], install_requires=[ + 'pyxdg', 'gevent', 'flask', 'flask-bootstrap',