Commits

Florent Xicluna committed 4b12b0e

Remove fake circular dependencies.

Comments (0)

Files changed (7)

tests/test_templates.py

 """
 from nose.tools import assert_raises
 
-from werkzeug.utils import MultiDict
+from werkzeug import MultiDict
 from werkzeug.templates import Template
 
 

werkzeug/formparser.py

 from itertools import chain, repeat
 
 from werkzeug._internal import _decode_unicode, _empty_stream
+from werkzeug.urls import url_decode
+from werkzeug.wsgi import LimitedStream, make_line_iter
+from werkzeug.exceptions import RequestEntityTooLarge
+from werkzeug.datastructures import Headers, FileStorage, MultiDict
+from werkzeug.http import parse_options_header
 
 
 #: an iterator that yields empty strings
     # we link the list to the headers, no need to create a copy, the
     # list was not shared anyways.
     return Headers.linked(result)
-
-
-# circular dependencies
-from werkzeug.urls import url_decode
-from werkzeug.wsgi import LimitedStream, make_line_iter
-from werkzeug.exceptions import RequestEntityTooLarge
-from werkzeug.datastructures import Headers, FileStorage, MultiDict
-from werkzeug.http import parse_options_header

werkzeug/routing.py

 from werkzeug.utils import redirect, format_string
 from werkzeug.exceptions import HTTPException, NotFound, MethodNotAllowed
 from werkzeug._internal import _get_environ
+from werkzeug.datastructures import ImmutableDict, MultiDict
 
 
 _rule_re = re.compile(r'''
         NumberConverter.__init__(self, map, 0, min, max)
 
 
+#: the default converter mapping for the map.
+DEFAULT_CONVERTERS = {
+    'default':          UnicodeConverter,
+    'string':           UnicodeConverter,
+    'any':              AnyConverter,
+    'path':             PathConverter,
+    'int':              IntegerConverter,
+    'float':            FloatConverter
+}
+
+
 class Map(object):
     """The map class stores all the URL rules and some configuration
     parameters.  Some of the configuration values are only stored on the
 
     #: .. versionadded:: 0.6
     #:    a dict of default converters to be used.
-    default_converters = None
+    default_converters = ImmutableDict(DEFAULT_CONVERTERS)
 
     def __init__(self, rules=None, default_subdomain='', charset='utf-8',
                  strict_slashes=True, redirect_defaults=True,
             self.script_name[:-1],
             path.lstrip('/')
         ))
-
-
-#: the default converter mapping for the map.
-DEFAULT_CONVERTERS = {
-    'default':          UnicodeConverter,
-    'string':           UnicodeConverter,
-    'any':              AnyConverter,
-    'path':             PathConverter,
-    'int':              IntegerConverter,
-    'float':            FloatConverter
-}
-
-from werkzeug.datastructures import ImmutableDict, MultiDict
-Map.default_converters = ImmutableDict(DEFAULT_CONVERTERS)

werkzeug/templates.py

 from tokenize import PseudoToken
 from werkzeug import utils, urls
 from werkzeug._internal import _decode_unicode
+from werkzeug.datastructures import MultiDict
 
 
 # Copyright notice: The `parse_data` method uses the string interpolation
         :return: the rendered template as string
         """
         ns = self.default_context.copy()
-        if len(args) == 1 and isinstance(args[0], utils.MultiDict):
+        if len(args) == 1 and isinstance(args[0], MultiDict):
             ns.update(args[0].to_dict(flat=True))
         else:
             ns.update(dict(*args))
 from werkzeug._internal import _empty_stream, _get_environ
 from werkzeug.wrappers import BaseRequest
 from werkzeug.urls import url_encode, url_fix, iri_to_uri, _unquote
-from werkzeug.wsgi import get_host, get_current_url
+from werkzeug.wsgi import get_host, get_current_url, ClosingIterator
 from werkzeug.datastructures import FileMultiDict, MultiDict, \
      CombinedMultiDict, Headers, FileStorage
 
                 app_iter = ClosingIterator(app_iter, close_func)
 
     return app_iter, response[0], response[1]
-
-
-from werkzeug.wsgi import ClosingIterator
 import urlparse
 
 from werkzeug._internal import _decode_unicode
+from werkzeug.datastructures import MultiDict, iter_multi_items
 
 
 #: list of characters that are always safe in URLs.
             rv += '?' + url_encode(query, self.charset, sort=self.sort,
                                    key=self.key)
         return str(rv)
-
-
-# circular dependencies
-from werkzeug.datastructures import MultiDict, iter_multi_items
 from datetime import datetime
 
 from werkzeug._internal import _patch_wrapper
+from werkzeug.utils import http_date
+from werkzeug.http import is_resource_modified
 
 
 def responder(f):
         if line is None:
             raise StopIteration()
         return line
-
-
-# circular dependencies
-from werkzeug.utils import http_date
-from werkzeug.http import is_resource_modified