Show More
@@ -503,7 +503,6 b' sqlalchemy.url = sqlite:///%(here)s/kall' | |||
|
503 | 503 | |
|
504 | 504 | # see sqlalchemy docs for others |
|
505 | 505 | |
|
506 | sqlalchemy.echo = false | |
|
507 | 506 | sqlalchemy.pool_recycle = 3600 |
|
508 | 507 | |
|
509 | 508 | ################################ |
@@ -63,12 +63,11 b' def notify(msg):' | |||
|
63 | 63 | |
|
64 | 64 | |
|
65 | 65 | class DbManage(object): |
|
66 |
def __init__(self |
|
|
66 | def __init__(self, dbconf, root, tests=False, SESSION=None, cli_args=None): | |
|
67 | 67 | self.dbname = dbconf.split('/')[-1] |
|
68 | 68 | self.tests = tests |
|
69 | 69 | self.root = root |
|
70 | 70 | self.dburi = dbconf |
|
71 | self.log_sql = log_sql | |
|
72 | 71 | self.db_exists = False |
|
73 | 72 | self.cli_args = cli_args or {} |
|
74 | 73 | self.init_db(SESSION=SESSION) |
@@ -86,7 +85,7 b' class DbManage(object):' | |||
|
86 | 85 | self.sa = SESSION |
|
87 | 86 | else: |
|
88 | 87 | #init new sessions |
|
89 |
engine = create_engine(self.dburi |
|
|
88 | engine = create_engine(self.dburi) | |
|
90 | 89 | init_model(engine) |
|
91 | 90 | self.sa = Session() |
|
92 | 91 |
@@ -95,7 +95,7 b' class Command(BasePasterCommand):' | |||
|
95 | 95 | conf = paste.deploy.appconfig('config:' + path_to_ini_file) |
|
96 | 96 | |
|
97 | 97 | dbconf = conf['sqlalchemy.url'] |
|
98 |
dbmanage = DbManage( |
|
|
98 | dbmanage = DbManage(dbconf=dbconf, root=conf['here'], | |
|
99 | 99 | tests=False, cli_args=vars(opts)) |
|
100 | 100 | dbmanage.create_tables(override=True) |
|
101 | 101 | opts = dbmanage.config_prompt(None) |
@@ -507,7 +507,6 b' sqlalchemy.url = mysql://user:pass@local' | |||
|
507 | 507 | %endif |
|
508 | 508 | # see sqlalchemy docs for others |
|
509 | 509 | |
|
510 | sqlalchemy.echo = false | |
|
511 | 510 | sqlalchemy.pool_recycle = 3600 |
|
512 | 511 | |
|
513 | 512 | <%text>################################</%text> |
@@ -329,7 +329,7 b' def create_test_env(repos_test_path, con' | |||
|
329 | 329 | log.debug('Creating testdir %s', repos_test_path) |
|
330 | 330 | os.makedirs(repos_test_path) |
|
331 | 331 | |
|
332 |
dbmanage = DbManage( |
|
|
332 | dbmanage = DbManage(dbconf=dbconf, root=config['here'], | |
|
333 | 333 | tests=True) |
|
334 | 334 | dbmanage.create_tables(override=True) |
|
335 | 335 | # for tests dynamically set new root paths based on generated content |
General Comments 0
You need to be logged in to leave comments.
Login now