# Path: settings.py
# TARGET_ENV = os.environ.get('TARGET_ENVIRONMENT', 'PRODUCTION')
# TEMP_CSET_DIR = 'tmpcset'
# MAILDIR = '/var/spool/news/mozilla/dev/tree-alerts'


from contextlib import closing
from functools import wraps
from pymysql import connect
from settings import DATABASE as db_config




def database_conn(func):
    """Provides db cursor for decorated func."""
    @wraps(func)
    def wrapper(*args, **kwargs):
        db = connect(host=db_config['host'],
                             user=db_config['username'],
                             passwd=db_config['password'],

# Path: settings.py
# TARGET_ENV = os.environ.get('TARGET_ENVIRONMENT', 'PRODUCTION')
# TEMP_CSET_DIR = 'tmpcset'
# MAILDIR = '/var/spool/news/mozilla/dev/tree-alerts'


# Path: lib/decorators.py
from contextlib import closing
from functools import wraps
from pymysql import connect
from settings import DATABASE as db_config





def database_conn(func):
    """Provides db cursor for decorated func."""
    @wraps(func)
    def wrapper(*args, **kwargs):
        db = connect(host=db_config['host'],
                             user=db_config['username'],
                             passwd=db_config['password'],

                             db=db_config['database'])