@author: theoklitos
'''
# begin with some package checks
import sys
import os
sys.path.append(os.path.abspath('..'))
from util import configuration, misc_utils
from control import brew_logic

__import__('hardware.chestfreezer_gpio')
try:
    __import__('api')
except ImportError:
    sys.exit('You don\'t have bottle.py installed. Try apt-get install python-bottle')    
if configuration.db_type() == configuration.DATABASE_IN_DISK_CONFIG_VALUE:
    try:
        __import__('MySQLdb')
    except ImportError:
        sys.exit('You don\'t have the python mysql connector installed. Try apt-get install python-mysqldb')

import urllib2
from hardware import chestfreezer_gpio, temperature_probes
from database import db_adapter
import time
import termios
from util import data_for_testing
import control.brew_logic as logic
import api.chestfreezer_api as api

def do_sound_check():
def _is_memory_db():
    """returns true if the database is only in-memory (sqlite3). Otherwise itc can be assumed that MySQL is being used """    
    if configuration.db_type() == configuration.DATABASE_IN_DISK_CONFIG_VALUE: 
        return False  
    elif configuration.db_type() == configuration.DATABASE_IN_MEMORY_CONFIG_VALUE:
        return True