# Path: config.py
# def get_config():
#     op = OptionParser()
#     op.add_option("--config",
#         action="store", type="string", dest="config",
#         default=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.ini'),
#         help="path to the config file [config.ini]")
# 
#     options, args = op.parse_args()
# 
#     if not os.path.exists(options.config):
#         print "ERROR: %s doesn't exist" % (os.path.abspath(options.config))
#         sys.exit(1)
# 
#     parser = ConfigParser.RawConfigParser(defaults={'debug': 'false'})
#     parser.read(options.config)
# 
#     def now():
#         return Date.eod().value
# 
#     def today():
#         return Date.today().value
# 
#     try:
#         const = CNV.string2datetime(parser.get('alerts', 'now'))
# 
#         def now():
#             return const
# 
#         today = now
#     except Exception:
#         pass
# 
# 
#     return {
#         'username': parser.get('alerts', 'username'),
#         'password': parser.get('alerts', 'password'),
#         'host': parser.get('alerts', 'host'),
#         'database': parser.get('alerts', 'database'),
#         'maildir': parser.get('alerts', 'maildir'),
#         'now': now,
#         'today': today,
#         'DEBUG': parser.getboolean('alerts', 'debug'),
#     }


import sys
from config import get_config
from pyLibrary.sql.db import DB
# encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#


configuration = get_config()

sys.stdout.write("THIS WILL OVERWRITE THE '%s' SCHEMA AT %s!! CONTINUE? [y/N]:" % (configuration["database"], configuration["host"]))
choice = raw_input().lower()
if choice not in ["yes", "y"]:

# Path: config.py
# def get_config():
#     op = OptionParser()
#     op.add_option("--config",
#         action="store", type="string", dest="config",
#         default=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.ini'),
#         help="path to the config file [config.ini]")
# 
#     options, args = op.parse_args()
# 
#     if not os.path.exists(options.config):
#         print "ERROR: %s doesn't exist" % (os.path.abspath(options.config))
#         sys.exit(1)
# 
#     parser = ConfigParser.RawConfigParser(defaults={'debug': 'false'})
#     parser.read(options.config)
# 
#     def now():
#         return Date.eod().value
# 
#     def today():
#         return Date.today().value
# 
#     try:
#         const = CNV.string2datetime(parser.get('alerts', 'now'))
# 
#         def now():
#             return const
# 
#         today = now
#     except Exception:
#         pass
# 
# 
#     return {
#         'username': parser.get('alerts', 'username'),
#         'password': parser.get('alerts', 'password'),
#         'host': parser.get('alerts', 'host'),
#         'database': parser.get('alerts', 'database'),
#         'maildir': parser.get('alerts', 'maildir'),
#         'now': now,
#         'today': today,
#         'DEBUG': parser.getboolean('alerts', 'debug'),
#     }


# Path: tests/resources/scripts/create_db.py
import sys
from config import get_config
from pyLibrary.sql.db import DB

# encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#


configuration = get_config()

sys.stdout.write("THIS WILL OVERWRITE THE '%s' SCHEMA AT %s!! CONTINUE? [y/N]:" % (configuration["database"], configuration["host"]))
choice = raw_input().lower()
if choice not in ["yes", "y"]:

    exit()