various typo fixes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Finbarr O'Callaghan · committed by Finbarr O'Callaghan · parent 80b2689 · Browse files · 6 files·+18 added−18 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+18 added−18 removed
- other:+18 added−18 removed
Provenance
- Commit
48f7cdd- Tree
8c19025- Author
Finbarr O'Callaghan <finbarr.ocallaghan@gmail.com>- Committer
Finbarr O'Callaghan <finbarr.ocallaghan@gmail.com>- Parent
80b2689
6 files changed+18 added−18 removed
modified:docs/appcontext.rst+2 added-2 removed
35 unmodified lines36 37 Purpose of the Application Context38 ----------------------------------39 40-The main reason for the application's context existance is that in the40+The main reason for the application's context existence is that in the41 past a bunch of functionality was attached to the request context in lack42 of a better solution. Since one of the pillar's of Flask's design is that43 you can have more than one application in the same Python process.44 12 unmodified lines57 58 To make an application context there are two ways. The first one is the59 implicit one: whenever a request context is pushed, an application context60 will be created alongside if this is necessary. As a result of that, you61-can ignore the existance of the application context unless you need it.61+can ignore the existence of the application context unless you need it.62 63 The second way is the explicit way using the64 :meth:`~flask.Flask.app_context` method::65 22 unmodified linesmodified:docs/upgrading.rst+1 added-1 removed
189 unmodified lines190 ``````````````````````````````191 192 While it is still possible to attach error handlers to193 :attr:`Flask.error_handlers` it's discouraged to do so and in fact194-deprecated. In generaly we no longer recommend custom error handler194+deprecated. In generally we no longer recommend custom error handler195 attaching via assignments to the underlying dictionary due to the more196 complex internal handling to support arbitrary exception classes and197 blueprints. See :meth:`Flask.errorhandler` for more information.198 148 unmodified linesmodified:flask/testsuite/subclassing.py+4 added-4 removed
16 unmodified lines17 18 19 class FlaskSubclassingTestCase(FlaskTestCase):20 21- 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 pass25 26 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))30 31 @app.route('/')32 def index():14 unmodified linesmodified:flask/app.py+9 added-9 removed
539 unmodified lines540 in debug mode. This logger can be used to (surprise) log messages.541 Here some examples::542 543 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')546 547 .. versionadded:: 0.3548 """549 if self._logger and self._logger.name == self.logger_name:295 unmodified lines845 """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:253 unmodified lines1107 must take one parameter, a :attr:`response_class` object and return1108 a new response object or the same (see :meth:`process_response`).1109 1110 As of Flask 0.7 this function might not be executed at the end of the1111- request in case an unhandled exception ocurred.1111+ request in case an unhandled exception occurred.1112 """1113 self.after_request_funcs.setdefault(None, []).append(f)1114 return f1115 15 unmodified lines1131 functions are called just before the request context moves from the1132 stack of active contexts. This becomes relevant if you are using1133 such constructs in tests.1134 1135- Generally teardown functions must take every necesary step to avoid1135+ Generally teardown functions must take every necessary step to avoid1136 that they will fail. If they do execute code that might fail they1137 will have to surround the execution of these code by try/except1138- statements and log ocurring errors.1138+ statements and log occurring errors.1139 1140 When a teardown function was called because of a exception it will1141 be passed an error object.1142 """121 unmodified lines1264 raise exc_type, exc_value, tb1265 1266 def handle_exception(self, e):1267 """Default exception handling that kicks in when an exception1268- occours that is not caught. In debug mode the exception will1268+ occurs that is not caught. In debug mode the exception will1269 be re-raised immediately, otherwise it is logged and the handler1270 for a 500 internal server error is used. If no such handler1271 exists, a default 500 internal server error message is displayed.1272 248 unmodified lines1521 if it was the return value from the view and further1522 request handling is stopped.1523 1524 This also triggers the :meth:`url_value_processor` functions before1525- the actualy :meth:`before_request` functions are called.1525+ the actually :meth:`before_request` functions are called.1526 """1527 bp = _request_ctx_stack.top.request.blueprint1528 1529 funcs = self.url_value_preprocessors.get(None, ())144 unmodified lines1674 .. versionchanged:: 0.71675 The behavior of the before and after request callbacks was changed1676 under error conditions and a new callback was added that will1677 always execute at the end of the request, independent on if an1678- error ocurred or not. See :ref:`callbacks-and-errors`.1678+ error occurred or not. See :ref:`callbacks-and-errors`.1679 1680 :param environ: a WSGI environment1681 :param start_response: a callable accepting a status code,1682 a list of headers and an optional19 unmodified linesmodified:flask/exthook.py+1 added-1 removed
108 unmodified lines109 # name shows up properly here. Success!110 if module_name == important_module:111 return True112 113- # 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 linesmodified:flask/wrappers.py+1 added-1 removed
106 unmodified lines107 return self.on_json_loading_failed(e)108 109 def on_json_loading_failed(self, e):110 """Called if decoding of the JSON data failed. The return value of111- this method is used by :attr:`json` when an error ocurred. The default111+ this method is used by :attr:`json` when an error occurred. The default112 implementation raises a :class:`JSONBadRequest`, which is a subclass of113 :class:`~werkzeug.exceptions.BadRequest` which sets the114 ``Content-Type`` to ``application/json`` and provides a JSON-formatted115 error description::33 unmodified lines