Skip to content
Myr

Merge pull request #744 from ThomasWaldmann/sprint-branch

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

2 small fixes for metaclass and import usage

authored by Daniel Neuhäuser · committed by Daniel Neuhäuser · parents 3c5d7ba, 96b8ffb · Browse files · 7 files+8 added−9 removed
This commit

State

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

Diff stats

7 files+8 added−9 removed

  • other:+8 added−9 removed

7 files+8 added−9 removed

modified:flask/app.py+1 added-1 removed
32 unmodified lines
33from .templating import DispatchingJinjaLoader, Environment, \34 _default_template_ctx_processor35from .signals import request_started, request_finished, got_request_exception, \36 request_tearing_down, appcontext_tearing_down37from flask._compat import reraise, string_types, integer_types37from ._compat import reraise, string_types, integer_types3839# a lock used for logger initialization40_logger_lock = Lock()41
1774 unmodified lines
modified:flask/config.py+1 added-1 removed
12 unmodified lines
13import os14import errno1516from werkzeug.utils import import_string17from flask._compat import string_types17from ._compat import string_types181920class ConfigAttribute(object):21 """Makes an attribute forward to the config"""
147 unmodified lines
modified:flask/debughelpers.py+1 added-1 removed
6 unmodified lines
78 :copyright: (c) 2011 by Armin Ronacher.9 :license: BSD, see LICENSE for more details.10"""11from flask._compat import implements_to_string11from ._compat import implements_to_string121314class UnexpectedUnicodeError(AssertionError, UnicodeError):15 """Raised in places where we want some better error reporting for
72 unmodified lines
modified:flask/exthook.py+1 added-1 removed
19 unmodified lines
20 :license: BSD, see LICENSE for more details.21"""22import sys23import os24from flask._compat import reraise24from ._compat import reraise252627class ExtensionImporter(object):28 """This importer redirects imports from this submodule to other locations.
92 unmodified lines
modified:flask/helpers.py+1 added-1 removed
22 unmodified lines
232425from werkzeug.datastructures import Headers26from werkzeug.exceptions import NotFound27from flask._compat import string_types, text_type2728# this was moved in 0.729try:30 from werkzeug.wsgi import wrap_file
4 unmodified lines
3536from .signals import message_flashed37from .globals import session, _request_ctx_stack, _app_ctx_stack, \38 current_app, request39from ._compat import string_types, text_type404142# sentinel43_missing = object()
802 unmodified lines
modified:flask/testing.py+1 added-1 removed
11 unmodified lines
1213from contextlib import contextmanager14from werkzeug.test import Client, EnvironBuilder15from flask import _request_ctx_stack16from flask._compat import urlparse16from ._compat import urlparse171819def make_test_environ_builder(app, path='/', base_url=None, *args, **kwargs):20 """Creates a new test builder with some application defaults thrown in."""
100 unmodified lines
modified:flask/views.py+2 added-3 removed
7 unmodified lines
8 :copyright: (c) 2011 by Armin Ronacher.9 :license: BSD, see LICENSE for more details.10"""11from .globals import request12from ._compat import with_metaclass131415http_method_funcs = frozenset(['get', 'post', 'head', 'options',16 'delete', 'put', 'trace', 'patch'])
102 unmodified lines
119 rv.methods = sorted(methods)120 return rv121122122class MethodView(View):123class MethodView(with_metaclass(MethodViewType, View)):124 """Like a regular class-based view but that dispatches requests to125 particular methods. For instance if you implement a method called126 :meth:`get` it means you will response to ``'GET'`` requests and127 the :meth:`dispatch_request` implementation will automatically
10 unmodified lines
138 return 'OK'139140 app.add_url_rule('/counter', view_func=CounterAPI.as_view('counter'))141 """141 __metaclass__ = MethodViewType142142 def dispatch_request(self, *args, **kwargs):143 meth = getattr(self, request.method.lower(), None)144 # if the request method is HEAD and we don't have a handler for it145 # retry with GET
4 unmodified lines