def loader(self, db_session, output, clear_workers): from dallinger.deployment import LoaderDeployment from dallinger.heroku.tools import HerokuLocalWrapper loader = LoaderDeployment(self.exp_id, output, verbose=True, exp_config={}) loader.notify = mock.Mock(return_value=HerokuLocalWrapper.MONITOR_STOP) yield loader
def load(app, verbose, replay, exp_config=None): """Import database state from an exported zip file and leave the server running until stopping the process with <control>-c. """ if replay: exp_config = exp_config or {} exp_config["replay"] = True log(header, chevrons=False) loader = LoaderDeployment(app, Output(), verbose, exp_config) loader.run()
def replay_loader(self, db_session, env, output, clear_workers): from dallinger.deployment import LoaderDeployment loader = LoaderDeployment(self.exp_id, output, verbose=True, exp_config={"replay": True}) loader.keep_running = mock.Mock(return_value=False) def launch_and_finish(self): from dallinger.heroku.tools import HerokuLocalWrapper loader.out.log("Launching replay browser...") return HerokuLocalWrapper.MONITOR_STOP loader.start_replay = mock.Mock(return_value=None, side_effect=launch_and_finish) yield loader