MCPcopy
hub / github.com/psycopg/psycopg / update_entry

Function update_entry

tools/update_backer.py:52–67  ·  view source on GitHub ↗
(opt, filedata, entry)

Source from the content-addressed store, hash-verified

50
51
52def update_entry(opt, filedata, entry):
53 # entry is an username or an user entry daat
54 if isinstance(entry, str):
55 username = entry
56
57 if not (entry := [e for e in filedata if e["username"] == username]):
58 raise Exception(f"{username} not found")
59 entry = entry[0]
60 else:
61 username = entry["username"]
62
63 userdata = get_user_data(fetch_user(username))
64 for k, v in userdata.items():
65 if entry.get("keep_" + k):
66 continue
67 entry[k] = v
68
69
70def main():

Callers 1

mainFunction · 0.85

Calls 3

get_user_dataFunction · 0.85
fetch_userFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected