示例#1
0
def get_state_manager_from_config(config_path, working_dir):
    """Return a state manager from the configuration.
    """
    config_manager = manager.ConfigManager(config_path)
    config_container = config_manager.load()
    state_config = config_container.get_master().state_persistence
    with tool_utils.working_dir(working_dir):
        return PersistenceManagerFactory.from_config(state_config)
示例#2
0
def get_state_manager_from_config(config_path, working_dir):
    """Return a state manager from the configuration.
    """
    config_manager = manager.ConfigManager(config_path)
    config_container = config_manager.load()
    state_config = config_container.get_master().state_persistence
    with tool_utils.working_dir(working_dir):
        return PersistenceManagerFactory.from_config(state_config)
def main(config_path, working_dir):
    container = get_container(config_path)
    config = container.get_master().state_persistence
    with tool_utils.working_dir(working_dir):
        display_report(config, *get_state(container))
示例#4
0
 def test_working_dir_nested(self):
     with tool_utils.working_dir(self.temp_dir):
         with tool_utils.working_dir(self.second_dir):
             assert_equal(os.getcwd(), self.second_dir)
         assert_equal(os.getcwd(), self.temp_dir)
     assert_equal(os.getcwd(), self.cwd)
示例#5
0
 def with_exc():
     with tool_utils.working_dir(self.temp_dir):
         assert_equal(os.getcwd(), self.temp_dir)
         raise Exception("oops")
def main(config_path, working_dir):
    container = get_container(config_path)
    config    = container.get_master().state_persistence
    with tool_utils.working_dir(working_dir):
        display_report(config, *get_state(container))
示例#7
0
 def test_working_dir_nested(self):
     with tool_utils.working_dir(self.temp_dir):
         with tool_utils.working_dir(self.second_dir):
             assert_equal(os.getcwd(), self.second_dir)
         assert_equal(os.getcwd(), self.temp_dir)
     assert_equal(os.getcwd(), self.cwd)
示例#8
0
 def with_exc():
     with tool_utils.working_dir(self.temp_dir):
         assert_equal(os.getcwd(), self.temp_dir)
         raise Exception("oops")