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