(root, args)
| 7 | return [unquote_plus(x) for x in url.split("/") if x!=''] |
| 8 | |
| 9 | def 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 | |
| 20 | def run(fun, args, input, output): |
| 21 | sys.stdin = input |