MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / _attributes_push_outer

Method _attributes_push_outer

masfactory/core/node.py:114–127  ·  view source on GitHub ↗

Push output fields to outer attributes according to `push_keys`.

(self,outer_env:dict[str,object]|None, update_env:dict[str,object]|None)

Source from the content-addressed store, hash-verified

112 raise ValueError("push_keys encountered an unexpected error")
113
114 def _attributes_push_outer(self,outer_env:dict[str,object]|None, update_env:dict[str,object]|None):
115 """Push output fields to outer attributes according to `push_keys`."""
116 if update_env is not None and outer_env is not None:
117 if self._push_keys is None:
118 if self._pull_keys is not None:
119 self._update_env(outer_env, update_env, self._pull_keys)
120 else:
121 self._update_env(outer_env, update_env, None)
122 elif len(self._push_keys) == 0:
123 pass
124 elif len(self._push_keys) > 0:
125 self._update_env(outer_env, update_env, self._push_keys)
126 else:
127 raise ValueError("push_keys encountered an unexpected error")
128
129 def _update_env(self, updated_env:dict[str,object], update_env:dict[str,object], update_keys:dict[str,str]|None):
130 """Update selected keys from `update_env` into `updated_env`."""

Callers 2

executeMethod · 0.95
executeMethod · 0.80

Calls 1

_update_envMethod · 0.95

Tested by

no test coverage detected