def init_database(self): os.chdir(self.proj_dir) cmd = SetupAppCommand(Bunch(options=Bunch(verbose_level=1)), Bunch()) try: cmd.run(Bunch(config_file='config:test.ini', section_name=None)) except: # DB already initialised, ignore it. pass
def setup_app(section_name=None): """Setup the application.""" engine = config['tg.app_globals'].sa_engine inspector = reflection.Inspector.from_engine(engine) metadata = MetaData() logger.debug(setup_app, 'Before setup...') cmd = SetupAppCommand(Bunch(options=Bunch(verbose_level=1)), Bunch()) logger.debug(setup_app, 'After setup, before run...') cmd.run(Bunch(config_file='config:test.ini', section_name=section_name)) logger.debug(setup_app, 'After run...')
def setup_app(): """Setup the application.""" cmd = SetupAppCommand(Bunch(options=Bunch(verbose_level=1)), Bunch()) cmd.run(Bunch(config_file='config:test.ini', section_name=None))