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
Provenance
- Commit
39329bf- Tree
7737f9b- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
c9a7fdf- Parent 2
e93447f
6 files changed+17 added−17 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
208 unmodified lines209 ``````````````````````````````210 211 While it is still possible to attach error handlers to212 :attr:`Flask.error_handlers` it's discouraged to do so and in fact213-deprecated. In generaly we no longer recommend custom error handler213+deprecated. In general we no longer recommend custom error handler214 attaching via assignments to the underlying dictionary due to the more215 complex internal handling to support arbitrary exception classes and216 blueprints. See :meth:`Flask.errorhandler` for more information.217 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+8 added-8 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:291 unmodified lines1145 must take one parameter, a :attr:`response_class` object and return1146 a new response object or the same (see :meth:`process_response`).1147 1148 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 lines1169 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.1172 1173- 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.1177 1178 When a teardown function was called because of a exception it will1179 be passed an error object.1180 """378 unmodified lines1559 if it was the return value from the view and further1560 request handling is stopped.1561 1562 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.blueprint1566 1567 funcs = self.url_value_preprocessors.get(None, ())144 unmodified lines1712 .. 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`.1717 1718 :param environ: a WSGI environment1719 :param start_response: a callable accepting a status code,1720 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
104 unmodified lines105 return self.on_json_loading_failed(e)106 107 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