MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / get_doc

Function get_doc

openlibrary/plugins/admin/code.py:110–114  ·  view source on GitHub ↗
(key: str, revision: int)

Source from the content-addressed store, hash-verified

108 """
109
110 def get_doc(key: str, revision: int) -> dict:
111 if revision == 0:
112 return {"key": key, "type": {"key": "/type/delete"}}
113 else:
114 return web.ctx.site.get(key, revision).dict()
115
116 site = web.ctx.site
117 docs = [get_doc(c["key"], c["revision"] - 1) for cid in changeset_ids for c in site.get_change(cid).changes]

Callers 1

revert_changesetsFunction · 0.70

Calls 2

dictMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected