default DB_URI = ~/.config/larigira/db.json

fixes #8
This commit is contained in:
boyska 2015-05-22 16:27:29 +02:00
parent e0eeceb31a
commit 27ca7fac03
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -37,6 +37,7 @@ setup(name='larigira',
license='AGPL',
packages=['larigira', 'larigira.dbadmin'],
install_requires=[
'pyxdg',
'gevent',
'flask',
'flask-bootstrap',