Browse Source

Fix import order to accommodate pocoo style

pull/2275/head
wangbing 8 years ago
parent
commit
8f950ee2de
  1. 1
      flask/config.py
  2. 1
      flask/exthook.py
  3. 1
      flask/globals.py
  4. 2
      flask/helpers.py
  5. 7
      flask/json.py
  6. 5
      flask/logging.py
  7. 5
      flask/sessions.py
  8. 4
      flask/testing.py

1
flask/config.py

@ -14,6 +14,7 @@ import types
import errno import errno
from werkzeug.utils import import_string from werkzeug.utils import import_string
from ._compat import string_types, iteritems from ._compat import string_types, iteritems
from . import json from . import json

1
flask/exthook.py

@ -22,6 +22,7 @@
import sys import sys
import os import os
import warnings import warnings
from ._compat import reraise from ._compat import reraise

1
flask/globals.py

@ -11,6 +11,7 @@
""" """
from functools import partial from functools import partial
from werkzeug.local import LocalStack, LocalProxy from werkzeug.local import LocalStack, LocalProxy

2
flask/helpers.py

@ -18,7 +18,6 @@ from time import time
from zlib import adler32 from zlib import adler32
from threading import RLock from threading import RLock
import unicodedata import unicodedata
from werkzeug.routing import BuildError
from functools import update_wrapper from functools import update_wrapper
try: try:
@ -26,6 +25,7 @@ try:
except ImportError: except ImportError:
from urlparse import quote as url_quote from urlparse import quote as url_quote
from werkzeug.routing import BuildError
from werkzeug.datastructures import Headers, Range from werkzeug.datastructures import Headers, Range
from werkzeug.exceptions import BadRequest, NotFound, \ from werkzeug.exceptions import BadRequest, NotFound, \
RequestedRangeNotSatisfiable RequestedRangeNotSatisfiable

7
flask/json.py

@ -11,17 +11,16 @@
import io import io
import uuid import uuid
from datetime import date from datetime import date
from .globals import current_app, request
from ._compat import text_type, PY2
from .ctx import has_request_context
from werkzeug.http import http_date from werkzeug.http import http_date
from jinja2 import Markup from jinja2 import Markup
# Use the same json implementation as itsdangerous on which we # Use the same json implementation as itsdangerous on which we
# depend anyways. # depend anyways.
from itsdangerous import json as _json from itsdangerous import json as _json
from .globals import current_app, request
from ._compat import text_type, PY2
from .ctx import has_request_context
# Figure out if simplejson escapes slashes. This behavior was changed # Figure out if simplejson escapes slashes. This behavior was changed
# from one version to another without reason. # from one version to another without reason.

5
flask/logging.py

@ -12,10 +12,11 @@
from __future__ import absolute_import from __future__ import absolute_import
import sys import sys
from werkzeug.local import LocalProxy
from logging import getLogger, StreamHandler, Formatter, getLoggerClass, \ from logging import getLogger, StreamHandler, Formatter, getLoggerClass, \
DEBUG, ERROR DEBUG, ERROR
from werkzeug.local import LocalProxy
from .globals import _request_ctx_stack from .globals import _request_ctx_stack

5
flask/sessions.py

@ -13,14 +13,15 @@ import uuid
import hashlib import hashlib
from base64 import b64encode, b64decode from base64 import b64encode, b64decode
from datetime import datetime from datetime import datetime
from werkzeug.http import http_date, parse_date from werkzeug.http import http_date, parse_date
from werkzeug.datastructures import CallbackDict from werkzeug.datastructures import CallbackDict
from itsdangerous import URLSafeTimedSerializer, BadSignature
from . import Markup, json from . import Markup, json
from ._compat import iteritems, text_type from ._compat import iteritems, text_type
from .helpers import total_seconds from .helpers import total_seconds
from itsdangerous import URLSafeTimedSerializer, BadSignature
class SessionMixin(object): class SessionMixin(object):
"""Expands a basic dictionary with an accessors that are expected """Expands a basic dictionary with an accessors that are expected

4
flask/testing.py

@ -10,9 +10,11 @@
:license: BSD, see LICENSE for more details. :license: BSD, see LICENSE for more details.
""" """
import werkzeug
from contextlib import contextmanager from contextlib import contextmanager
import werkzeug
from werkzeug.test import Client, EnvironBuilder from werkzeug.test import Client, EnvironBuilder
from flask import _request_ctx_stack from flask import _request_ctx_stack
try: try:

Loading…
Cancel
Save