MCPcopy
hub / github.com/mikumifa/biliTickerBuy / update

Method update

util/Storage/KVDatabase.py:135–148  ·  view source on GitHub ↗

更新已存在的 key。 如果 key 不存在,抛出 KeyError。

(self, key: str, value: Any)

Source from the content-addressed store, hash-verified

133 return bool(value)
134
135 def update(self, key: str, value: Any) -> None:
136 """
137 更新已存在的 key。
138
139 如果 key 不存在,抛出 KeyError。
140 """
141 with self._lock:
142 if self.db.contains(self.KeyValue.key == key):
143 self.db.update(
144 {"value": value},
145 self.KeyValue.key == key,
146 )
147 else:
148 raise KeyError(f"Key '{key}' not found in database.")
149
150 def delete(self, key: str) -> None:
151 """

Callers 15

merged_withMethod · 0.80
generate_ticket_configFunction · 0.80
_update_managed_statusFunction · 0.80
with_overridesMethod · 0.80
input_https_proxyFunction · 0.80
clear_https_proxyFunction · 0.80
test_proxy_connectivityFunction · 0.80
show_proxy_test_loadingFunction · 0.80
fetch_proxy_from_apiFunction · 0.80
save_proxy_api_configFunction · 0.80
inner_input_serverchanFunction · 0.80

Calls 1

containsMethod · 0.80

Tested by 1

test_proxy_connectivityFunction · 0.64