# Path: farmsList/settings.py
# class ProdConfig(Config):
#     """Production configuration."""
#     ENV = 'prod'
#     DEBUG = False
#     SQLALCHEMY_DATABASE_URI = os_env.get('HEROKU_POSTGRESQL_IVORY_URL')
#     DEBUG_TB_ENABLED = False  # Disable Debug toolbar
#     HTTP_SERVER = "acres.herokuapp.com"
# 
# class DevConfig(Config):
#     """Development configuration."""
#     ENV = 'dev'
#     DEBUG = True
#     MAIL_DEBUG = True
#     DB_NAME = 'dev.db'
#     # Put the db file in project root
#     # DB_PATH = os.path.join(Config.PROJECT_ROOT, DB_NAME)
#     SQLALCHEMY_DATABASE_URI = 'postgresql://urbanlandlocatoradmin:@localhost/urban_land_locator' #'sqlite:///{0}'.format(DB_PATH)
#     DEBUG_TB_ENABLED = True
#     ASSETS_DEBUG = True  # Don't bundle/minify static assets
#     HTTP_SERVER = "localhost:5001"


import os
import urllib2
from datetime import datetime
from HTMLParser import HTMLParser
from sqlalchemy import create_engine
from farmsList.settings import ProdConfig, DevConfig
from updaters import WestSacParcelUpdater, WestSacWaterUpdater, SoilUpdater, FoodDesertUpdater
'''
	This is where we want to go through and check for any updates to the remote data sets that we're using.
	If a remote data set has been updated, we will fetch it and populate the updates to our database.
'''


# establish connection with the database we want to be using
if os.environ.get("FARMSLIST_ENV") == 'prod':

# Path: farmsList/settings.py
# class ProdConfig(Config):
#     """Production configuration."""
#     ENV = 'prod'
#     DEBUG = False
#     SQLALCHEMY_DATABASE_URI = os_env.get('HEROKU_POSTGRESQL_IVORY_URL')
#     DEBUG_TB_ENABLED = False  # Disable Debug toolbar
#     HTTP_SERVER = "acres.herokuapp.com"
# 
# class DevConfig(Config):
#     """Development configuration."""
#     ENV = 'dev'
#     DEBUG = True
#     MAIL_DEBUG = True
#     DB_NAME = 'dev.db'
#     # Put the db file in project root
#     # DB_PATH = os.path.join(Config.PROJECT_ROOT, DB_NAME)
#     SQLALCHEMY_DATABASE_URI = 'postgresql://urbanlandlocatoradmin:@localhost/urban_land_locator' #'sqlite:///{0}'.format(DB_PATH)
#     DEBUG_TB_ENABLED = True
#     ASSETS_DEBUG = True  # Don't bundle/minify static assets
#     HTTP_SERVER = "localhost:5001"


# Path: farmsList/imports.py
import os
import urllib2
from datetime import datetime
from HTMLParser import HTMLParser
from sqlalchemy import create_engine
from farmsList.settings import ProdConfig, DevConfig
from updaters import WestSacParcelUpdater, WestSacWaterUpdater, SoilUpdater, FoodDesertUpdater

'''
	This is where we want to go through and check for any updates to the remote data sets that we're using.
	If a remote data set has been updated, we will fetch it and populate the updates to our database.
'''


# establish connection with the database we want to be using
if os.environ.get("FARMSLIST_ENV") == 'prod':

	engine = create_engine(ProdConfig().SQLALCHEMY_DATABASE_URI)