Switch to explicit Werkzeug imports
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent 6ca321c · Browse files · 7 files·+17 added−10 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+17 added−10 removed
- other:+17 added−10 removed
Provenance
- Commit
2866ccd- Tree
9d87acd- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
6ca321c
7 files changed+17 added−10 removed
modified:flask/__init__.py+2 added-1 removed
12 unmodified lines13 __version__ = '0.8-dev'14 15 # utilities we import from Werkzeug and Jinja2 that are unused16 # in the module but are exported as public interface.17-from werkzeug import abort, redirect17+from werkzeug.exceptions import abort18+from werkzeug.utils import redirect19 from jinja2 import Markup, escape20 21 from .app import Flask, Request, Response22 from .config import Config19 unmodified linesmodified:flask/app.py+3 added-3 removed
14 unmodified lines15 from threading import Lock16 from datetime import timedelta17 from itertools import chain18 19-from werkzeug import ImmutableDict19+from werkzeug.datastructures import ImmutableDict20 from werkzeug.routing import Map, Rule21 from werkzeug.exceptions import HTTPException, InternalServerError, \22 MethodNotAllowed23 526 unmodified lines550 :param options: the options to be forwarded to the underlying551 Werkzeug server. See :func:`werkzeug.run_simple`552 for more information.553 """554- from werkzeug import run_simple554+ from werkzeug.serving import run_simple555 if 'debug' in options:556 self.debug = options.pop('debug')557 options.setdefault('use_reloader', self.debug)558 options.setdefault('use_debugger', self.debug)707 unmodified lines1266 """Creates a WSGI environment from the given values (see1267 :func:`werkzeug.create_environ` for more information, this1268 function accepts the same arguments).1269 """1270- from werkzeug import create_environ1270+ from werkzeug.test import create_environ1271 environ_overrides = kwargs.setdefault('environ_overrides', {})1272 if self.config.get('SERVER_NAME'):1273 server_name = self.config.get('SERVER_NAME')1274 if ':' not in server_name:51 unmodified linesmodified:flask/config.py+1 added-1 removed
13 unmodified lines14 import imp15 import os16 import errno17 18-from werkzeug import import_string18+from werkzeug.utils import import_string19 20 21 class ConfigAttribute(object):22 """Makes an attribute forward to the config"""143 unmodified linesmodified:flask/globals.py+1 added-1 removed
9 unmodified lines10 :license: BSD, see LICENSE for more details.11 """12 13 from functools import partial14-from werkzeug import LocalStack, LocalProxy14+from werkzeug.local import LocalStack, LocalProxy15 16 def _lookup_object(name):17 top = _request_ctx_stack.top18 if top is None:9 unmodified linesmodified:flask/helpers.py+7 added-1 removed
34 unmodified lines35 except ImportError:36 json_available = False37 38 39-from werkzeug import Headers, wrap_file39+from werkzeug.datastructures import Headers40 from werkzeug.exceptions import NotFound41 42+# this was moved in 0.743+try:44+ from werkzeug.wsgi import wrap_file45+except ImportError:46+ from werkzeug.utils import wrap_file47+48 from jinja2 import FileSystemLoader49 50 from .globals import session, _request_ctx_stack, current_app, request51 539 unmodified linesmodified:flask/testing.py+1 added-1 removed
8 unmodified lines9 :copyright: (c) 2010 by Armin Ronacher.10 :license: BSD, see LICENSE for more details.11 """12 13-from werkzeug import Client, EnvironBuilder13+from werkzeug.test import Client, EnvironBuilder14 from flask import _request_ctx_stack15 16 17 class FlaskClient(Client):50 unmodified linesmodified:flask/wrappers.py+2 added-2 removed
7 unmodified lines8 :copyright: (c) 2010 by Armin Ronacher.9 :license: BSD, see LICENSE for more details.10 """11 12-from werkzeug import Request as RequestBase, Response as ResponseBase, \13- cached_property12+from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase13+from werkzeug.utils import cached_property14 15 from .helpers import json, _assert_have_json16 from .globals import _request_ctx_stack17 94 unmodified lines