datasette.fixtures module, closes #2733

https://gist.github.com/simonw/613be79094d491dd08f45e05f4f70691
This commit is contained in:
Simon Willison 2026-05-21 23:05:37 -07:00
commit 1000d50220
10 changed files with 545 additions and 407 deletions

View file

@ -155,9 +155,15 @@ Column = namedtuple(
functions_marked_as_documented = []
def documented(fn):
functions_marked_as_documented.append(fn)
return fn
def documented(fn=None, *, label=None):
def decorate(fn):
fn._datasette_docs_label = label or "internals_utils_{}".format(fn.__name__)
functions_marked_as_documented.append(fn)
return fn
if fn is None:
return decorate
return decorate(fn)
@documented