Skip to content
Myr

Merge pull request #591 from finbarrocallaghan/master

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

fixed some typos

authored by Armin Ronacher · committed by Armin Ronacher · parents c9a7fdf, e93447f · Browse files · 6 files+17 added−17 removed
This commit

State

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

Diff stats

6 files+17 added−17 removed

  • other:+17 added−17 removed

6 files+17 added−17 removed

modified:docs/appcontext.rst+2 added-2 removed
35 unmodified lines
3637Purpose of the Application Context38----------------------------------3940The main reason for the application's context existance is that in the40The main reason for the application's context existence is that in the41past a bunch of functionality was attached to the request context in lack42of a better solution. Since one of the pillar's of Flask's design is that43you can have more than one application in the same Python process.44
12 unmodified lines
5758To make an application context there are two ways. The first one is the59implicit one: whenever a request context is pushed, an application context60will be created alongside if this is necessary. As a result of that, you61can ignore the existance of the application context unless you need it.61can ignore the existence of the application context unless you need it.6263The second way is the explicit way using the64:meth:`~flask.Flask.app_context` method::65
22 unmodified lines
modified:docs/upgrading.rst+1 added-1 removed
208 unmodified lines
209``````````````````````````````210211While it is still possible to attach error handlers to212:attr:`Flask.error_handlers` it's discouraged to do so and in fact213deprecated. In generaly we no longer recommend custom error handler213deprecated. In general we no longer recommend custom error handler214attaching via assignments to the underlying dictionary due to the more215complex internal handling to support arbitrary exception classes and216blueprints. See :meth:`Flask.errorhandler` for more information.217
148 unmodified lines
modified:flask/testsuite/subclassing.py+4 added-4 removed
16 unmodified lines
171819class FlaskSubclassingTestCase(FlaskTestCase):2021 def test_supressed_exception_logging(self):22 class SupressedFlask(flask.Flask):21 def test_suppressed_exception_logging(self):22 class SuppressedFlask(flask.Flask):23 def log_exception(self, exc_info):24 pass2526 out = StringIO()27 app = SupressedFlask(__name__)28 app.logger_name = 'flask_tests/test_supressed_exception_logging'27 app = SuppressedFlask(__name__)28 app.logger_name = 'flask_tests/test_suppressed_exception_logging'29 app.logger.addHandler(StreamHandler(out))3031 @app.route('/')32 def index():
14 unmodified lines
modified:flask/app.py+8 added-8 removed
539 unmodified lines
540 in debug mode. This logger can be used to (surprise) log messages.541 Here some examples::542543 app.logger.debug('A value for debugging')544 app.logger.warning('A warning ocurred (%d apples)', 42)545 app.logger.error('An error occoured')544 app.logger.warning('A warning occurred (%d apples)', 42)545 app.logger.error('An error occurred')546547 .. versionadded:: 0.3548 """549 if self._logger and self._logger.name == self.logger_name:
295 unmodified lines
845 """846 first_registration = False847 if blueprint.name in self.blueprints:848 assert self.blueprints[blueprint.name] is blueprint, \849 'A blueprint\'s name collision ocurred between %r and ' \849 'A blueprint\'s name collision occurred between %r and ' \850 '%r. Both share the same name "%s". Blueprints that ' \851 'are created on the fly need unique names.' % \852 (blueprint, self.blueprints[blueprint.name], blueprint.name)853 else:
291 unmodified lines
1145 must take one parameter, a :attr:`response_class` object and return1146 a new response object or the same (see :meth:`process_response`).11471148 As of Flask 0.7 this function might not be executed at the end of the1149 request in case an unhandled exception ocurred.1149 request in case an unhandled exception occurred.1150 """1151 self.after_request_funcs.setdefault(None, []).append(f)1152 return f1153
15 unmodified lines
1169 functions are called just before the request context moves from the1170 stack of active contexts. This becomes relevant if you are using1171 such constructs in tests.11721173 Generally teardown functions must take every necesary step to avoid1173 Generally teardown functions must take every necessary step to avoid1174 that they will fail. If they do execute code that might fail they1175 will have to surround the execution of these code by try/except1176 statements and log ocurring errors.1176 statements and log occurring errors.11771178 When a teardown function was called because of a exception it will1179 be passed an error object.1180 """
378 unmodified lines
1559 if it was the return value from the view and further1560 request handling is stopped.15611562 This also triggers the :meth:`url_value_processor` functions before1563 the actualy :meth:`before_request` functions are called.1563 the actual :meth:`before_request` functions are called.1564 """1565 bp = _request_ctx_stack.top.request.blueprint15661567 funcs = self.url_value_preprocessors.get(None, ())
144 unmodified lines
1712 .. versionchanged:: 0.71713 The behavior of the before and after request callbacks was changed1714 under error conditions and a new callback was added that will1715 always execute at the end of the request, independent on if an1716 error ocurred or not. See :ref:`callbacks-and-errors`.1716 error occurred or not. See :ref:`callbacks-and-errors`.17171718 :param environ: a WSGI environment1719 :param start_response: a callable accepting a status code,1720 a list of headers and an optional
19 unmodified lines
modified:flask/exthook.py+1 added-1 removed
108 unmodified lines
109 # name shows up properly here. Success!110 if module_name == important_module:111 return True112113 # Some python verisons will will clean up modules so early that the113 # Some python versions will will clean up modules so early that the114 # module name at that point is no longer set. Try guessing from115 # the filename then.116 filename = os.path.abspath(tb.tb_frame.f_code.co_filename)117 test_string = os.path.sep + important_module.replace('.', os.path.sep)
2 unmodified lines
modified:flask/wrappers.py+1 added-1 removed
104 unmodified lines
105 return self.on_json_loading_failed(e)106107 def on_json_loading_failed(self, e):108 """Called if decoding of the JSON data failed. The return value of109 this method is used by :attr:`json` when an error ocurred. The default109 this method is used by :attr:`json` when an error occurred. The default110 implementation raises a :class:`JSONBadRequest`, which is a subclass of111 :class:`~werkzeug.exceptions.BadRequest` which sets the112 ``Content-Type`` to ``application/json`` and provides a JSON-formatted113 error description::
33 unmodified lines