MCPcopy Create free account
hub / github.com/ActiveState/code / locate

Function locate

recipes/Python/474094_UrlAppServer/recipe-474094.py:9–18  ·  view source on GitHub ↗
(root, args)

Source from the content-addressed store, hash-verified

7 return [unquote_plus(x) for x in url.split("/") if x!='']
8
9def locate(root, args):
10 curr = root
11 i = 0;
12 for a in args:
13 try:
14 curr = getattr(curr, a)
15 except AttributeError:
16 return curr, args[i:]
17 i += 1
18 return curr, []
19
20def run(fun, args, input, output):
21 sys.stdin = input

Callers 1

do_GETMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected