diff options
author | emkael <emkael@tlen.pl> | 2017-01-05 13:17:18 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-01-05 13:17:18 +0100 |
commit | 8a6b5981795fc65c994d8e42c78f23a6c8d10498 (patch) | |
tree | e20c52832c9369d6098cf2460d4c7c9a6a9b652d /ausbutler/db.py | |
parent | 830aaabd3e8105ad47460628587660cb496f507e (diff) |
Refactoring - config loading helper
Diffstat (limited to 'ausbutler/db.py')
-rw-r--r-- | ausbutler/db.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ausbutler/db.py b/ausbutler/db.py index 940c69d..e40fee5 100644 --- a/ausbutler/db.py +++ b/ausbutler/db.py @@ -1,15 +1,11 @@ -import json -from os import path - from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker -import __main__ +from .config import load_config def get_session(): session = sessionmaker(bind=create_engine( "mysql://{0[user]}:{0[pass]}@{0[host]}/{0[db]}".format( - json.load(open( - path.join(path.dirname(__main__.__file__), 'config', 'db.json') - ))))) + load_config('db') + ))) return session() |