Skip to content
Myr

Replace 'module' with 'blueprint' in docstrings.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Ron DuPlain · committed by Ron DuPlain · parent 0313c8b · Browse files · 1 file+20 added−20 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+20 added−20 removed

  • other:+20 added−20 removed

1 file+20 added−20 removed

modified:flask/blueprints.py+20 added-20 removed
110 unmodified lines
111 for deferred in self.deferred_functions:112 deferred(state)113114 def route(self, rule, **options):115 """Like :meth:`Flask.route` but for a module. The endpoint for the116 :func:`url_for` function is prefixed with the name of the module.115 """Like :meth:`Flask.route` but for a blueprint. The endpoint for the116 :func:`url_for` function is prefixed with the name of the blueprint.117 """118 def decorator(f):119 self.add_url_rule(rule, f.__name__, f, **options)120 return f121 return decorator122123 def add_url_rule(self, rule, endpoint=None, view_func=None, **options):124 """Like :meth:`Flask.add_url_rule` but for a module. The endpoint for125 the :func:`url_for` function is prefixed with the name of the module.124 """Like :meth:`Flask.add_url_rule` but for a blueprint. The endpoint for125 the :func:`url_for` function is prefixed with the name of the blueprint.126 """127 self.record(lambda s:128 s.add_url_rule(rule, endpoint, view_func, **options))129130 def endpoint(self, endpoint):131 """Like :meth:`Flask.endpoint` but for a module. This does not132 prefix the endpoint with the module name, this has to be done131 """Like :meth:`Flask.endpoint` but for a blueprint. This does not132 prefix the endpoint with the blueprint name, this has to be done133 explicitly by the user of this method. If the endpoint is prefixed134 with a `.` it will be registered to the current blueprint, otherwise135 it's an application independent endpoint.136 """
4 unmodified lines
141 return f142 return decorator143144 def before_request(self, f):145 """Like :meth:`Flask.before_request` but for a module. This function145 """Like :meth:`Flask.before_request` but for a blueprint. This function146 is only executed before each request that is handled by a function of147 that module.147 that blueprint.148 """149 self.record_once(lambda s: s.app.before_request_funcs150 .setdefault(self.name, []).append(f))151 return f152153 def before_app_request(self, f):154 """Like :meth:`Flask.before_request`. Such a function is executed155 before each request, even if outside of a module.155 before each request, even if outside of a blueprint.156 """157 self.record_once(lambda s: s.app.before_request_funcs158 .setdefault(None, []).append(f))159 return f160161 def after_request(self, f):162 """Like :meth:`Flask.after_request` but for a module. This function162 """Like :meth:`Flask.after_request` but for a blueprint. This function163 is only executed after each request that is handled by a function of164 that module.164 that blueprint.165 """166 self.record_once(lambda s: s.app.after_request_funcs167 .setdefault(self.name, []).append(f))168 return f169170 def after_app_request(self, f):171 """Like :meth:`Flask.after_request` but for a module. Such a function172 is executed after each request, even if outside of the module.171 """Like :meth:`Flask.after_request` but for a blueprint. Such a function172 is executed after each request, even if outside of the blueprint.173 """174 self.record_once(lambda s: s.app.after_request_funcs175 .setdefault(None, []).append(f))176 return f177178 def context_processor(self, f):179 """Like :meth:`Flask.context_processor` but for a module. This180 function is only executed for requests handled by a module.179 """Like :meth:`Flask.context_processor` but for a blueprint. This180 function is only executed for requests handled by a blueprint.181 """182 self.record_once(lambda s: s.app.template_context_processors183 .setdefault(self.name, []).append(f))184 return f185186 def app_context_processor(self, f):187 """Like :meth:`Flask.context_processor` but for a module. Such a188 function is executed each request, even if outside of the module.187 """Like :meth:`Flask.context_processor` but for a blueprint. Such a188 function is executed each request, even if outside of the blueprint.189 """190 self.record_once(lambda s: s.app.template_context_processors191 .setdefault(None, []).append(f))192 return f193194 def app_errorhandler(self, code):195 """Like :meth:`Flask.errorhandler` but for a module. This196 handler is used for all requests, even if outside of the module.195 """Like :meth:`Flask.errorhandler` but for a blueprint. This196 handler is used for all requests, even if outside of the blueprint.197 """198 def decorator(f):199 self.record_once(lambda s: s.app.errorhandler(code)(f))200 return f
8 unmodified lines
209 .setdefault(self.name, []).append(f))210 return f211212 def url_defaults(self, f):213 """Callback function for URL defaults for this module. It's called213 """Callback function for URL defaults for this blueprint. It's called214 with the endpoint and values and should update the values passed215 in place.216 """217 self.record_once(lambda s: s.app.url_default_functions
35 unmodified lines