Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/apidoc.py
Show First 20 Lines • Show All 479 Lines • ▼ Show 20 Lines | |||||
def format_docstring(**substitutions): | def format_docstring(**substitutions): | ||||
def decorator(f): | def decorator(f): | ||||
f.__doc__ = f.__doc__.format(**{**DEFAULT_SUBSTITUTIONS, **substitutions}) | f.__doc__ = f.__doc__.format(**{**DEFAULT_SUBSTITUTIONS, **substitutions}) | ||||
return f | return f | ||||
return decorator | return decorator | ||||
def set_docstring(docstring): | |||||
def decorator(f): | |||||
f.__doc__ = docstring | |||||
return f | |||||
return decorator |