Skip to content

Commit

Permalink
Create default DB in-memory, and remove setup.py prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
jnmclarty committed Mar 22, 2015
1 parent cd3a728 commit 4de90f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
16 changes: 10 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import shutil
import sys
import time

from setuptools import setup, find_packages
from setuptools.command.install import install
Expand All @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion trump/config/trump.cfg_sample
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 4de90f9

Please sign in to comment.