示例#1
0
def exit_cleanup():
    global simulations
    logger = logging.getLogger("mdig")

    logger.debug("Cleaning up")

    # clean up simulations and save changes
    for exp in simulations:
        exp.clean_up()
        exp.save_model()

    # clean up web server
    from mdig.webui import shutdown_webapp
    shutdown_webapp()

    # clean up GRASS environment
    if grass.get_g(False) is not None:
        grass.get_g().clean_up()

    # save config changes
    config.get_config().write()

    from mdig.tempresource import trm
    trm.cleanup()

    logger.debug("Finished at %s" % repr(datetime.now().ctime()))
示例#2
0
 def test_start_webapp(self,m_run,m_g):
     webui.start_web_service()
     webui.shutdown_webapp()
示例#3
0
 def test_shutdown_webapp(self):
     webui.shutdown_webapp()
     webui.app = self.app
     webui.shutdown_webapp()