From 4de90f9f6082d0681a9917fcc82b528731217079 Mon Sep 17 00:00:00 2001 From: jnmclarty Date: Sat, 21 Mar 2015 22:47:36 -0400 Subject: [PATCH] Create default DB in-memory, and remove setup.py prompts --- setup.py | 16 ++++++++++------ trump/config/trump.cfg_sample | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 6a8b478..065d3fc 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ import os import shutil import sys +import time from setuptools import setup, find_packages from setuptools.command.install import install @@ -16,12 +17,15 @@ def copy_cfg_sample_if_not_exists(p): print "\nCreating {} from sample file.".format(newf) shutil.copy(os.path.join(p,f),os.path.join(p,newf)) else: - ans = raw_input("\n{} already exists, overwrite? [y/n]".format(newf)) - if ans.upper()[0] == 'Y': - print "Overwriting {} from sample file.".format(newf) - shutil.copy(os.path.join(p,f),os.path.join(p,newf)) - else: - print "Skipping {}.".format(newf) + print "\n{} already exists, will overwrite momentarily. Break execution to stop.".format(newf) + for i in range(5): + sys.stdout.write(".") + time.sleep(1) + #if ans.upper()[0] == 'Y': + print "Overwriting {} from sample file.".format(newf) + shutil.copy(os.path.join(p,f),os.path.join(p,newf)) + #else: + # print "Skipping {}.".format(newf) class TrumpInstall(install): def run(self): diff --git a/trump/config/trump.cfg_sample b/trump/config/trump.cfg_sample index 5764acd..0813b17 100644 --- a/trump/config/trump.cfg_sample +++ b/trump/config/trump.cfg_sample @@ -3,7 +3,8 @@ debug: false ;for reference, a SQLAlchemy's connection string is of the form dialect[+driver]://user:password@host/dbname[?key=value..] [readwrite] -engine: '{dialect}://{user}:{password}@{host}:{port}/{name}' +;engine: {dialect}://{user}:{password}@{host}:{port}/{name} +engine: sqlite:// ;for reference, a SQLAlchemy's connection string is of the form dialect[+driver]://user:password@host/dbname[?key=value..] [read]