MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / yieldroutes

Function yieldroutes

thirdparty/bottle/bottle.py:3501–3518  ·  view source on GitHub ↗

Return a generator for routes that match the signature (name, args) of the func parameter. This may yield more than one route if the function takes optional keyword arguments. The output is best described by example:: a() -> '/a' b(x, y) -> '/b/ / '

(func)

Source from the content-addressed store, hash-verified

3499
3500
3501def yieldroutes(func):
3502 """ Return a generator for routes that match the signature (name, args)
3503 of the func parameter. This may yield more than one route if the function
3504 takes optional keyword arguments. The output is best described by example::
3505
3506 a() -> '/a'
3507 b(x, y) -> '/b/<x>/<y>'
3508 c(x, y=5) -> '/c/<x>' and '/c/<x>/<y>'
3509 d(x=5, y=6) -> '/d' and '/d/<x>' and '/d/<x>/<y>'
3510 """
3511 path = '/' + func.__name__.replace('__', '/').lstrip('/')
3512 spec = getargspec(func)
3513 argc = len(spec[0]) - len(spec[3] or [])
3514 path += ('/<%s>' * argc) % tuple(spec[0][:argc])
3515 yield path
3516 for arg in spec[0][argc:]:
3517 path += '/<%s>' % arg
3518 yield path
3519
3520
3521def path_shift(script_name, path_info, shift=1):

Callers 1

decoratorMethod · 0.85

Calls 2

getargspecFunction · 0.70
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…