Permalink
Browse files

Switch to explicit Werkzeug imports

  • Loading branch information...
1 parent 6ca321c commit 2866ccda1fe19a42adc735d75abaf304f8aed27b @mitsuhiko mitsuhiko committed Jul 15, 2011
Showing with 17 additions and 10 deletions.
  1. +2 −1 flask/__init__.py
  2. +3 −3 flask/app.py
  3. +1 −1 flask/config.py
  4. +1 −1 flask/globals.py
  5. +7 −1 flask/helpers.py
  6. +1 −1 flask/testing.py
  7. +2 −2 flask/wrappers.py
View
@@ -14,7 +14,8 @@
# utilities we import from Werkzeug and Jinja2 that are unused
# in the module but are exported as public interface.
-from werkzeug import abort, redirect
+from werkzeug.exceptions import abort
+from werkzeug.utils import redirect
from jinja2 import Markup, escape
from .app import Flask, Request, Response
View
@@ -16,7 +16,7 @@
from datetime import timedelta
from itertools import chain
-from werkzeug import ImmutableDict
+from werkzeug.datastructures import ImmutableDict
from werkzeug.routing import Map, Rule
from werkzeug.exceptions import HTTPException, InternalServerError, \
MethodNotAllowed
@@ -551,7 +551,7 @@ def run(self, host='127.0.0.1', port=5000, **options):
Werkzeug server. See :func:`werkzeug.run_simple`
for more information.
"""
- from werkzeug import run_simple
+ from werkzeug.serving import run_simple
if 'debug' in options:
self.debug = options.pop('debug')
options.setdefault('use_reloader', self.debug)
@@ -1267,7 +1267,7 @@ def test_request_context(self, *args, **kwargs):
:func:`werkzeug.create_environ` for more information, this
function accepts the same arguments).
"""
- from werkzeug import create_environ
+ from werkzeug.test import create_environ
environ_overrides = kwargs.setdefault('environ_overrides', {})
if self.config.get('SERVER_NAME'):
server_name = self.config.get('SERVER_NAME')
View
@@ -15,7 +15,7 @@
import os
import errno
-from werkzeug import import_string
+from werkzeug.utils import import_string
class ConfigAttribute(object):
View
@@ -11,7 +11,7 @@
"""
from functools import partial
-from werkzeug import LocalStack, LocalProxy
+from werkzeug.local import LocalStack, LocalProxy
def _lookup_object(name):
top = _request_ctx_stack.top
View
@@ -36,9 +36,15 @@
json_available = False
-from werkzeug import Headers, wrap_file
+from werkzeug.datastructures import Headers
from werkzeug.exceptions import NotFound
+# this was moved in 0.7
+try:
+ from werkzeug.wsgi import wrap_file
+except ImportError:
+ from werkzeug.utils import wrap_file
+
from jinja2 import FileSystemLoader
from .globals import session, _request_ctx_stack, current_app, request
View
@@ -10,7 +10,7 @@
:license: BSD, see LICENSE for more details.
"""
-from werkzeug import Client, EnvironBuilder
+from werkzeug.test import Client, EnvironBuilder
from flask import _request_ctx_stack
View
@@ -9,8 +9,8 @@
:license: BSD, see LICENSE for more details.
"""
-from werkzeug import Request as RequestBase, Response as ResponseBase, \
- cached_property
+from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
+from werkzeug.utils import cached_property
from .helpers import json, _assert_have_json
from .globals import _request_ctx_stack

0 comments on commit 2866ccd

Please sign in to comment.