MCPcopy
hub / github.com/pallets/werkzeug / href

Function href

examples/simplewiki/utils.py:54–64  ·  view source on GitHub ↗

Simple function for URL generation. Position arguments are used for the URL path and keyword arguments are used for the url parameters.

(*args, **kw)

Source from the content-addressed store, hash-verified

52
53
54def href(*args, **kw):
55 """
56 Simple function for URL generation. Position arguments are used for the
57 URL path and keyword arguments are used for the url parameters.
58 """
59 result = [f"{request.script_root if request else ''}/"]
60 for idx, arg in enumerate(args):
61 result.append(f"{'/' if idx else ''}{quote(arg)}")
62 if kw:
63 result.append(f"?{urlencode(kw)}")
64 return "".join(result)
65
66
67def format_datetime(obj):

Callers 6

dispatch_requestMethod · 0.85
utils.pyFile · 0.85
previousMethod · 0.85
nextMethod · 0.85
on_editFunction · 0.85
on_revertFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected