Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use multiline imports

  • Loading branch information...
commit 0c1c39b02f1e0348d8e317972601e2db514db103 1 parent ee117e7
@mcdonc mcdonc authored
View
6 pyramid/asset.py
@@ -3,8 +3,10 @@
from pyramid.compat import string_types
-from pyramid.path import package_path
-from pyramid.path import package_name
+from pyramid.path import (
+ package_path,
+ package_name,
+ )
def resolve_asset_spec(spec, pname='__main__'):
if pname and not isinstance(pname, string_types):
View
32 pyramid/authentication.py
@@ -8,19 +8,25 @@
from zope.interface import implementer
-from pyramid.compat import long
-from pyramid.compat import text_type
-from pyramid.compat import binary_type
-from pyramid.compat import url_unquote
-from pyramid.compat import url_quote
-from pyramid.compat import bytes_
-from pyramid.compat import ascii_native_
-
-from pyramid.interfaces import IAuthenticationPolicy
-from pyramid.interfaces import IDebugLogger
-
-from pyramid.security import Authenticated
-from pyramid.security import Everyone
+from pyramid.compat import (
+ long,
+ text_type,
+ binary_type,
+ url_unquote,
+ url_quote,
+ bytes_,
+ ascii_native_,
+ )
+
+from pyramid.interfaces import (
+ IAuthenticationPolicy,
+ IDebugLogger,
+ )
+
+from pyramid.security import (
+ Authenticated,
+ Everyone,
+ )
from pyramid.util import strings_differ
View
13 pyramid/authorization.py
@@ -3,11 +3,14 @@
from pyramid.interfaces import IAuthorizationPolicy
from pyramid.location import lineage
-from pyramid.security import ACLAllowed
-from pyramid.security import ACLDenied
-from pyramid.security import Allow
-from pyramid.security import Deny
-from pyramid.security import Everyone
+
+from pyramid.security import (
+ ACLAllowed,
+ ACLDenied,
+ Allow,
+ Deny,
+ Everyone,
+ )
@implementer(IAuthorizationPolicy)
class ACLAuthorizationPolicy(object):
View
12 pyramid/encode.py
@@ -1,8 +1,10 @@
-from pyramid.compat import text_type
-from pyramid.compat import binary_type
-from pyramid.compat import is_nonstr_iter
-from pyramid.compat import url_quote as _url_quote
-from pyramid.compat import url_quote_plus as quote_plus # bw compat api (dnr)
+from pyramid.compat import (
+ text_type,
+ binary_type,
+ is_nonstr_iter,
+ url_quote as _url_quote,
+ url_quote_plus as quote_plus, # bw compat api (dnr)
+ )
def url_quote(s, safe=''): # bw compat api
return _url_quote(s, safe=safe)
View
12 pyramid/events.py
@@ -2,11 +2,13 @@
from zope.interface import implementer
-from pyramid.interfaces import IContextFound
-from pyramid.interfaces import INewRequest
-from pyramid.interfaces import INewResponse
-from pyramid.interfaces import IApplicationCreated
-from pyramid.interfaces import IBeforeRender
+from pyramid.interfaces import (
+ IContextFound,
+ INewRequest,
+ INewResponse,
+ IApplicationCreated,
+ IBeforeRender,
+ )
class subscriber(object):
""" Decorator activated via a :term:`scan` which treats the
View
6 pyramid/exceptions.py
@@ -1,5 +1,7 @@
-from pyramid.httpexceptions import HTTPNotFound
-from pyramid.httpexceptions import HTTPForbidden
+from pyramid.httpexceptions import (
+ HTTPNotFound,
+ HTTPForbidden,
+ )
NotFound = HTTPNotFound # bw compat
Forbidden = HTTPForbidden # bw compat
View
11 pyramid/httpexceptions.py
@@ -128,12 +128,15 @@
from webob import html_escape as _html_escape
+from pyramid.compat import (
+ class_types,
+ text_type,
+ binary_type,
+ text_,
+ )
+
from pyramid.interfaces import IExceptionResponse
from pyramid.response import Response
-from pyramid.compat import class_types
-from pyramid.compat import text_type
-from pyramid.compat import binary_type
-from pyramid.compat import text_
def _no_escape(value):
if value is None:
View
19 pyramid/i18n.py
@@ -1,18 +1,23 @@
import gettext
import os
-from translationstring import Translator
-from translationstring import Pluralizer
-from translationstring import TranslationString # API
-from translationstring import TranslationStringFactory # API
+from translationstring import (
+ Translator,
+ Pluralizer,
+ TranslationString, # API
+ TranslationStringFactory, # API
+ )
TranslationString = TranslationString # PyFlakes
TranslationStringFactory = TranslationStringFactory # PyFlakes
from pyramid.compat import PY3
-from pyramid.interfaces import ILocalizer
-from pyramid.interfaces import ITranslationDirectories
-from pyramid.interfaces import ILocaleNegotiator
+
+from pyramid.interfaces import (
+ ILocalizer,
+ ITranslationDirectories,
+ ILocaleNegotiator,
+ )
from pyramid.threadlocal import get_current_registry
View
6 pyramid/interfaces.py
@@ -1,5 +1,7 @@
-from zope.interface import Attribute
-from zope.interface import Interface
+from zope.interface import (
+ Attribute,
+ Interface,
+ )
from pyramid.compat import PY3
View
20 pyramid/mako_templating.py
@@ -2,13 +2,21 @@
import sys
import threading
-from zope.interface import implementer
-from zope.interface import Interface
+from zope.interface import (
+ implementer,
+ Interface,
+ )
+
+from pyramid.asset import (
+ resolve_asset_spec,
+ abspath_from_asset_spec,
+ )
+
+from pyramid.compat import (
+ is_nonstr_iter,
+ reraise,
+ )
-from pyramid.asset import resolve_asset_spec
-from pyramid.asset import abspath_from_asset_spec
-from pyramid.compat import is_nonstr_iter
-from pyramid.compat import reraise
from pyramid.interfaces import ITemplateRenderer
from pyramid.settings import asbool
from pyramid.util import DottedNameResolver
View
33 pyramid/renderers.py
@@ -6,21 +6,32 @@
from zope.interface import implementer
from zope.deprecation import deprecated
-from pyramid.interfaces import IChameleonLookup
-from pyramid.interfaces import IChameleonTranslate
-from pyramid.interfaces import IRendererGlobalsFactory
-from pyramid.interfaces import IRendererFactory
-from pyramid.interfaces import IResponseFactory
-from pyramid.interfaces import ITemplateRenderer
-from pyramid.interfaces import IRendererInfo
+from pyramid.interfaces import (
+ IChameleonLookup,
+ IChameleonTranslate,
+ IRendererGlobalsFactory,
+ IRendererFactory,
+ IResponseFactory,
+ ITemplateRenderer,
+ IRendererInfo,
+ )
from pyramid.asset import asset_spec_from_abspath
-from pyramid.compat import string_types
-from pyramid.compat import text_type
+
+from pyramid.compat import (
+ string_types,
+ text_type,
+ )
+
from pyramid.decorator import reify
+
from pyramid.events import BeforeRender
-from pyramid.path import caller_package
-from pyramid.path import package_path
+
+from pyramid.path import (
+ caller_package,
+ package_path,
+ )
+
from pyramid.response import Response
from pyramid.threadlocal import get_current_registry
View
25 pyramid/request.py
@@ -7,15 +7,22 @@
from webob import BaseRequest
-from pyramid.interfaces import IRequest
-from pyramid.interfaces import IResponse
-from pyramid.interfaces import ISessionFactory
-from pyramid.interfaces import IResponseFactory
-
-from pyramid.compat import iterkeys_, itervalues_, iteritems_
-from pyramid.compat import text_
-from pyramid.compat import bytes_
-from pyramid.compat import native_
+from pyramid.interfaces import (
+ IRequest,
+ IResponse,
+ ISessionFactory,
+ IResponseFactory,
+ )
+
+from pyramid.compat import (
+ iterkeys_,
+ itervalues_,
+ iteritems_,
+ text_,
+ bytes_,
+ native_,
+ )
+
from pyramid.decorator import reify
from pyramid.response import Response
from pyramid.url import URLMethodsMixin
View
51 pyramid/router.py
@@ -1,26 +1,37 @@
-from zope.interface import implementer
-from zope.interface import providedBy
-
-from pyramid.interfaces import IDebugLogger
-from pyramid.interfaces import IRequest
-from pyramid.interfaces import IRootFactory
-from pyramid.interfaces import IRouteRequest
-from pyramid.interfaces import IRouter
-from pyramid.interfaces import IRequestFactory
-from pyramid.interfaces import IRoutesMapper
-from pyramid.interfaces import ITraverser
-from pyramid.interfaces import IView
-from pyramid.interfaces import IViewClassifier
-from pyramid.interfaces import ITweens
-
-from pyramid.events import ContextFound
-from pyramid.events import NewRequest
-from pyramid.events import NewResponse
+from zope.interface import (
+ implementer,
+ providedBy,
+ )
+
+from pyramid.interfaces import (
+ IDebugLogger,
+ IRequest,
+ IRootFactory,
+ IRouteRequest,
+ IRouter,
+ IRequestFactory,
+ IRoutesMapper,
+ ITraverser,
+ IView,
+ IViewClassifier,
+ ITweens,
+ )
+
+from pyramid.events import (
+ ContextFound,
+ NewRequest,
+ NewResponse,
+ )
+
from pyramid.httpexceptions import HTTPNotFound
from pyramid.request import Request
from pyramid.threadlocal import manager
-from pyramid.traversal import DefaultRootFactory
-from pyramid.traversal import ResourceTreeTraverser
+
+from pyramid.traversal import (
+ DefaultRootFactory,
+ ResourceTreeTraverser,
+ )
+
from pyramid.tweens import excview_tween_factory
@implementer(IRouter)
View
8 pyramid/scripting.py
@@ -1,8 +1,12 @@
from pyramid.config import global_registries
from pyramid.exceptions import ConfigurationError
from pyramid.request import Request
-from pyramid.interfaces import IRequestFactory
-from pyramid.interfaces import IRootFactory
+
+from pyramid.interfaces import (
+ IRequestFactory,
+ IRootFactory,
+ )
+
from pyramid.threadlocal import manager as threadlocal_manager
from pyramid.traversal import DefaultRootFactory
View
10 pyramid/security.py
@@ -1,9 +1,11 @@
from zope.interface import providedBy
-from pyramid.interfaces import IAuthenticationPolicy
-from pyramid.interfaces import IAuthorizationPolicy
-from pyramid.interfaces import ISecuredView
-from pyramid.interfaces import IViewClassifier
+from pyramid.interfaces import (
+ IAuthenticationPolicy,
+ IAuthorizationPolicy,
+ ISecuredView,
+ IViewClassifier,
+ )
from pyramid.compat import map_
from pyramid.threadlocal import get_current_registry
View
13 pyramid/session.py
@@ -7,11 +7,14 @@
from zope.interface import implementer
-from pyramid.compat import pickle
-from pyramid.compat import PY3
-from pyramid.compat import text_
-from pyramid.compat import bytes_
-from pyramid.compat import native_
+from pyramid.compat import (
+ pickle,
+ PY3,
+ text_,
+ bytes_,
+ native_,
+ )
+
from pyramid.interfaces import ISession
from pyramid.util import strings_differ
View
35 pyramid/static.py
@@ -1,23 +1,34 @@
# -*- coding: utf-8 -*-
import mimetypes
import os
-from os.path import normcase
-from os.path import normpath
-from os.path import join
-from os.path import getmtime
-from os.path import getsize
-from os.path import isdir
-from os.path import exists
-from pkg_resources import resource_exists
-from pkg_resources import resource_filename
-from pkg_resources import resource_isdir
+
+from os.path import (
+ normcase,
+ normpath,
+ join,
+ getmtime,
+ getsize,
+ isdir,
+ exists,
+ )
+
+from pkg_resources import (
+ resource_exists,
+ resource_filename,
+ resource_isdir,
+ )
from repoze.lru import lru_cache
from pyramid.asset import resolve_asset_spec
+
from pyramid.compat import text_
-from pyramid.httpexceptions import HTTPNotFound
-from pyramid.httpexceptions import HTTPMovedPermanently
+
+from pyramid.httpexceptions import (
+ HTTPNotFound,
+ HTTPMovedPermanently,
+ )
+
from pyramid.path import caller_package
from pyramid.response import Response
from pyramid.traversal import traversal_path_info
View
59 pyramid/testing.py
@@ -3,32 +3,49 @@
from zope.deprecation import deprecated
-from zope.interface import implementer
-from zope.interface import Interface
-from zope.interface import alsoProvides
-
-from pyramid.interfaces import IRequest
-from pyramid.interfaces import IResponseFactory
-from pyramid.interfaces import ISecuredView
-from pyramid.interfaces import IView
-from pyramid.interfaces import IViewClassifier
-from pyramid.interfaces import ISession
-
-from pyramid.compat import PY3
-from pyramid.compat import PYPY
-from pyramid.compat import class_types
+from zope.interface import (
+ implementer,
+ Interface,
+ alsoProvides,
+ )
+
+from pyramid.interfaces import (
+ IRequest,
+ IResponseFactory,
+ ISecuredView,
+ IView,
+ IViewClassifier,
+ ISession,
+ )
+
+from pyramid.compat import (
+ PY3,
+ PYPY,
+ class_types,
+ )
+
from pyramid.config import Configurator
from pyramid.decorator import reify
from pyramid.httpexceptions import HTTPForbidden
from pyramid.response import Response
from pyramid.registry import Registry
-from pyramid.security import Authenticated
-from pyramid.security import Everyone
-from pyramid.security import has_permission
-from pyramid.threadlocal import get_current_registry
-from pyramid.threadlocal import manager
-from pyramid.request import DeprecatedRequestMethodsMixin
-from pyramid.request import CallbackMethodsMixin
+
+from pyramid.security import (
+ Authenticated,
+ Everyone,
+ has_permission,
+ )
+
+from pyramid.threadlocal import (
+ get_current_registry,
+ manager,
+ )
+
+from pyramid.request import (
+ DeprecatedRequestMethodsMixin,
+ CallbackMethodsMixin,
+ )
+
from pyramid.url import URLMethodsMixin
_marker = object()
View
33 pyramid/traversal.py
@@ -5,20 +5,25 @@
from repoze.lru import lru_cache
-from pyramid.interfaces import IContextURL
-from pyramid.interfaces import IRequestFactory
-from pyramid.interfaces import ITraverser
-from pyramid.interfaces import VH_ROOT_KEY
-
-from pyramid.compat import PY3
-from pyramid.compat import native_
-from pyramid.compat import text_
-from pyramid.compat import bytes_
-from pyramid.compat import ascii_native_
-from pyramid.compat import text_type
-from pyramid.compat import binary_type
-from pyramid.compat import url_unquote_native
-from pyramid.compat import is_nonstr_iter
+from pyramid.interfaces import (
+ IContextURL,
+ IRequestFactory,
+ ITraverser,
+ VH_ROOT_KEY,
+ )
+
+from pyramid.compat import (
+ PY3,
+ native_,
+ text_,
+ bytes_,
+ ascii_native_,
+ text_type,
+ binary_type,
+ url_unquote_native,
+ is_nonstr_iter,
+ )
+
from pyramid.encode import url_quote
from pyramid.exceptions import URLDecodeError
from pyramid.location import lineage
View
7 pyramid/tweens.py
@@ -1,6 +1,9 @@
import sys
-from pyramid.interfaces import IExceptionViewClassifier
-from pyramid.interfaces import IView
+
+from pyramid.interfaces import (
+ IExceptionViewClassifier,
+ IView,
+ )
from zope.interface import providedBy
View
23 pyramid/url.py
@@ -4,17 +4,24 @@
from repoze.lru import lru_cache
-from pyramid.interfaces import IContextURL
-from pyramid.interfaces import IRoutesMapper
-from pyramid.interfaces import IStaticURLInfo
-
-from pyramid.compat import native_
-from pyramid.compat import text_type
+from pyramid.interfaces import (
+ IContextURL,
+ IRoutesMapper,
+ IStaticURLInfo,
+ )
+
+from pyramid.compat import (
+ native_,
+ text_type,
+ )
from pyramid.encode import urlencode
from pyramid.path import caller_package
from pyramid.threadlocal import get_current_registry
-from pyramid.traversal import TraversalContextURL
-from pyramid.traversal import quote_path_segment
+
+from pyramid.traversal import (
+ TraversalContextURL,
+ quote_path_segment,
+ )
class URLMethodsMixin(object):
""" Request methods mixin for BaseRequest having to do with URL
View
30 pyramid/urldispatch.py
@@ -1,18 +1,26 @@
import re
from zope.interface import implementer
-from pyramid.interfaces import IRoutesMapper
-from pyramid.interfaces import IRoute
-
-from pyramid.compat import native_
-from pyramid.compat import bytes_
-from pyramid.compat import text_type
-from pyramid.compat import string_types
-from pyramid.compat import is_nonstr_iter
-from pyramid.compat import url_quote
+from pyramid.interfaces import (
+ IRoutesMapper,
+ IRoute,
+ )
+
+from pyramid.compat import (
+ native_,
+ bytes_,
+ text_type,
+ string_types,
+ is_nonstr_iter,
+ url_quote,
+ )
+
from pyramid.exceptions import URLDecodeError
-from pyramid.traversal import traversal_path_info
-from pyramid.traversal import quote_path_segment
+
+from pyramid.traversal import (
+ traversal_path_info,
+ quote_path_segment,
+ )
_marker = object()
View
14 pyramid/view.py
@@ -3,13 +3,17 @@
from zope.interface import providedBy
from zope.deprecation import deprecated
-from pyramid.interfaces import IRoutesMapper
-from pyramid.interfaces import IView
-from pyramid.interfaces import IViewClassifier
+from pyramid.interfaces import (
+ IRoutesMapper,
+ IView,
+ IViewClassifier,
+ )
from pyramid.compat import map_
-from pyramid.httpexceptions import HTTPFound
-from pyramid.httpexceptions import default_exceptionresponse_view
+from pyramid.httpexceptions import (
+ HTTPFound,
+ default_exceptionresponse_view,
+ )
from pyramid.path import caller_package
from pyramid.static import static_view
from pyramid.threadlocal import get_current_registry
Please sign in to comment.
Something went wrong with that request. Please try again.