Permalink
Browse files

fixed db-path not expanding tilden to user home dir

  • Loading branch information...
1 parent 50d2f74 commit d30d9482516e8e4ebfb6bf9b19dbfb8a1f402273 @artnez committed May 26, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/faceoff/db.py
View
@@ -32,10 +32,12 @@ def init_app(app):
for the application's threads and subprocesses to use.
"""
db_path = app.config['DB_PATH']
- if not db_path:
+ if db_path:
+ db_path = os.path.expanduser(db_path)
+ if not os.path.exists(db_path):
+ db_path = make_new_db(db_path)
+ else:
db_path = make_temp_db()
- elif not os.path.exists(db_path):
- db_path = make_new_db(db_path)
app.db = Factory(db_path)
set_global_factory(app.db)

0 comments on commit d30d948

Please sign in to comment.