def add_routes(app, module_name):
    n = module_name.rfind('.')
    if (n == (- 1)):
        mod = __import__(module_name, globals(), locals())
    else:
        name = module_name[(n + 1):]
        mod = getattr(__import__(module_name[:n], globals(), locals(), [name]), name)
    for attr in dir(mod):
        if attr.startswith('_'):
            continue
        fn = getattr(mod, attr)
        if callable(fn):
            method = getattr(fn, '__method__', None)
            path = getattr(fn, '__route__', None)
            if (method and path):
                add_route(app, fn)
def add_routes(app, module_name):
    n = module_name.rfind('.')
    if (n == (- 1)):
        mod = __import__(module_name, globals(), locals())
    else:
        name = module_name[(n + 1):]
        mod = getattr(__import__(module_name[:n], globals(), locals(), [name]), name)
    for attr in dir(mod):
        if attr.startswith('_'):
            continue
        fn = getattr(mod, attr)
        if callable(fn):
            method = getattr(fn, '__method__', None)
            path = getattr(fn, '__route__', None)
            if (method and path):
                add_route(app, fn)