# Path: common/settings.py



from collections import defaultdict
from functools import wraps
from os import environ
from os.path import join, isdir
from fabric.api import local
from common.settings import obfuscated_dir, project_name
import logging
import peewee as pwe




logging.debug('data.base: Starting')
###############
# Connect to db
###############
# Note: This module is loaded as part of the pymixup.py initialization.
#       Therefore, is run before the parsing of the command-line options,
#       which specifies the platform. So, the build and use of the db uses
#       a db folder under the project name, not the platform.
if 'IS_PYMIXUP_TEST' in environ and environ['IS_PYMIXUP_TEST'] in (1, '1'):
    obfuscatedb = pwe.SqliteDatabase(':memory:', autocommit=False)
else:
    to_dir = join(obfuscated_dir, project_name)
    if not isdir(to_dir):
        local(' '.join(['mkdir', to_dir]))
    if not isdir(join(to_dir, 'db')):
        local(' '.join(['mkdir', join(to_dir, 'db')]))
    obfuscatedb = pwe.SqliteDatabase(join(obfuscated_dir,

# Path: common/settings.py



# Path: data/base.py
from collections import defaultdict
from functools import wraps
from os import environ
from os.path import join, isdir
from fabric.api import local
from common.settings import obfuscated_dir, project_name
import logging
import peewee as pwe





logging.debug('data.base: Starting')
###############
# Connect to db
###############
# Note: This module is loaded as part of the pymixup.py initialization.
#       Therefore, is run before the parsing of the command-line options,
#       which specifies the platform. So, the build and use of the db uses
#       a db folder under the project name, not the platform.
if 'IS_PYMIXUP_TEST' in environ and environ['IS_PYMIXUP_TEST'] in (1, '1'):
    obfuscatedb = pwe.SqliteDatabase(':memory:', autocommit=False)
else:
    to_dir = join(obfuscated_dir, project_name)
    if not isdir(to_dir):
        local(' '.join(['mkdir', to_dir]))
    if not isdir(join(to_dir, 'db')):
        local(' '.join(['mkdir', join(to_dir, 'db')]))
    obfuscatedb = pwe.SqliteDatabase(join(obfuscated_dir,

                                          project_name,