MCPcopy Create free account
hub / github.com/alibaba/GraphScope / update_and_write

Method update_and_write

python/graphscope/gsctl/config.py:142–154  ·  view source on GitHub ↗
(self, context: Context)

Source from the content-addressed store, hash-verified

140 )
141
142 def update_and_write(self, context: Context):
143 if context.name not in self._contexts:
144 raise RuntimeError(f"Failed to get context: {context.name}")
145
146 # update
147 self._contexts[context.name] = context
148
149 # write
150 contexts = [v.to_dict() for _, v in self._contexts.items()]
151 write_yaml_file(
152 {"contexts": contexts, "current-context": self._current_context},
153 GS_CONFIG_DEFAULT_LOCATION,
154 )
155
156 def remove_and_write(self, current_context: Context):
157 # remove

Callers 2

get_command_collectionFunction · 0.80
switch_contextFunction · 0.80

Calls 3

write_yaml_fileFunction · 0.90
itemsMethod · 0.80
to_dictMethod · 0.45

Tested by

no test coverage detected