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
def __exit__(self, *exc): from guild import model assert self._model_path0 is not None model.set_path(self._model_path0)
def __enter__(self): from guild import model self._model_path0 = model.get_path() model.set_path(self.model_path)