def _register_module(module, static_path):
    def _register(state):
        state.app.modules[module.name] = module
        # do not register the rule if the static folder of the
        # module is the same as the one from the application.
        if state.app.root_path == module.root_path:
            return
        path = static_path
        if path is None:
            path = state.app.static_path
        if state.url_prefix:
            path = state.url_prefix + path
        state.app.add_url_rule(path + '/<path:filename>',
                               endpoint='%s.static' % module.name,
                               view_func=module.send_static_file)
    return _register
Internal helper function that returns a function for recording
dataset/ETHPy150Open hhstore/flask-annotated/flask-0.5/flask/module.py/_register_module