예제 #1
0
def _resolve_cwd_model(model_ref):
    cwd_guildfile = cmd_impl_support.cwd_guildfile()
    if not cwd_guildfile:
        return None
    path_save = modellib.get_path()
    modellib.set_path([cwd_guildfile.dir], clear_cache=True)
    model = _match_one_model(model_ref, cwd_guildfile)
    modellib.set_path(path_save)
    return model
예제 #2
0
    def __exit__(self, *exc):
        from guild import model

        assert self._model_path0 is not None
        model.set_path(self._model_path0)
예제 #3
0
    def __enter__(self):
        from guild import model

        self._model_path0 = model.get_path()
        model.set_path(self.model_path)