''' This script provides information about the environment SMART runs in. '''

import os

def get_resources_path():
    if is_running_locally():
        try:
            return os.environ['ARTICONF_RESOURCES_PATH']
        except:
            return '/srv/articonf'
    else:
        return '/srv/articonf'

def is_running_locally():
    '''Set env var ARTICONF_LOCAL=1 to run locally.'''
    server = True
    try:
        if str(os.environ['ARTICONF_LOCAL']) == '1':
            server = False
    except KeyError:
        pass

    return not server