hacking: noqa cleanup in horizon
attribute-level imports are not checked by hacking module now. most noqa is used to disable warnings on attribute-level imports. This commit drops noqa for this purpose. After this, there are 8 noqa under horizon/ :) In addition to this, the following changes are made. horizon/exceptions.py: The following imports are dropped. They are not used anywhere. from django.http import HttpRequest from django.views.debug import CLEANSED_SUBSTITUTE horizon/forms/__init__.py: Some entries were missing in __all__. They are added. Change-Id: I33b504ef6c396f0675e8a340867e2ca59c77c684
This commit is contained in:
parent
676d5a2bad
commit
61091388e9
@ -24,10 +24,10 @@ methods like :func:`~horizon.register` and :func:`~horizon.unregister`.
|
||||
# should that fail.
|
||||
Horizon = None
|
||||
try:
|
||||
from horizon.base import Dashboard # noqa
|
||||
from horizon.base import Horizon # noqa
|
||||
from horizon.base import Panel # noqa
|
||||
from horizon.base import PanelGroup # noqa
|
||||
from horizon.base import Dashboard
|
||||
from horizon.base import Horizon
|
||||
from horizon.base import Panel
|
||||
from horizon.base import PanelGroup
|
||||
except ImportError:
|
||||
import warnings
|
||||
|
||||
|
@ -30,20 +30,20 @@ import django
|
||||
from django.conf import settings
|
||||
from django.conf.urls import include
|
||||
from django.conf.urls import url
|
||||
from django.core.exceptions import ImproperlyConfigured # noqa
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.functional import empty
|
||||
from django.utils.functional import SimpleLazyObject # noqa
|
||||
from django.utils.module_loading import module_has_submodule # noqa
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
from django.utils.module_loading import module_has_submodule
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from importlib import import_module
|
||||
import six
|
||||
|
||||
from horizon import conf
|
||||
from horizon.decorators import _current_component # noqa
|
||||
from horizon.decorators import require_auth # noqa
|
||||
from horizon.decorators import require_perms # noqa
|
||||
from horizon.decorators import _current_component
|
||||
from horizon.decorators import require_auth
|
||||
from horizon.decorators import require_perms
|
||||
from horizon import loaders
|
||||
from horizon.utils import settings as utils_settings
|
||||
|
||||
|
@ -13,5 +13,11 @@
|
||||
# under the License.
|
||||
|
||||
# Importing non-modules that are not used explicitly
|
||||
from horizon.browsers.base import ResourceBrowser # noqa
|
||||
from horizon.browsers.views import ResourceBrowserView # noqa
|
||||
from horizon.browsers.base import ResourceBrowser
|
||||
from horizon.browsers.views import ResourceBrowserView
|
||||
|
||||
|
||||
__all__ = [
|
||||
'ResourceBrowser',
|
||||
'ResourceBrowserView',
|
||||
]
|
||||
|
@ -15,8 +15,8 @@
|
||||
from django import template
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon.browsers.breadcrumb import Breadcrumb # noqa
|
||||
from horizon.tables import DataTable # noqa
|
||||
from horizon.browsers.breadcrumb import Breadcrumb
|
||||
from horizon.tables import DataTable
|
||||
from horizon.utils import html
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views import generic
|
||||
|
||||
from horizon.tables import MultiTableView # noqa
|
||||
from horizon.tables import MultiTableView
|
||||
from horizon.utils import memoized
|
||||
|
||||
|
||||
|
@ -12,15 +12,15 @@
|
||||
|
||||
import copy
|
||||
|
||||
from django.utils.functional import empty # noqa
|
||||
from django.utils.functional import LazyObject # noqa
|
||||
from django.utils.functional import SimpleLazyObject # noqa
|
||||
from django.utils.functional import empty
|
||||
from django.utils.functional import LazyObject
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
|
||||
class LazySettings(LazyObject):
|
||||
def _setup(self, name=None):
|
||||
from django.conf import settings
|
||||
from horizon.conf.default import HORIZON_CONFIG as DEFAULT_CONFIG # noqa
|
||||
from horizon.conf.default import HORIZON_CONFIG as DEFAULT_CONFIG
|
||||
HORIZON_CONFIG = copy.copy(DEFAULT_CONFIG)
|
||||
HORIZON_CONFIG.update(settings.HORIZON_CONFIG)
|
||||
|
||||
|
@ -21,7 +21,7 @@ General-purpose decorators for use with Horizon.
|
||||
"""
|
||||
import functools
|
||||
|
||||
from django.utils.decorators import available_attrs # noqa
|
||||
from django.utils.decorators import available_attrs
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ def require_auth(view_func):
|
||||
:exc:`~horizon.exceptions.NotAuthenticated` exception if the user is not
|
||||
signed-in.
|
||||
"""
|
||||
from horizon.exceptions import NotAuthenticated # noqa
|
||||
from horizon.exceptions import NotAuthenticated
|
||||
|
||||
@functools.wraps(view_func, assigned=available_attrs(view_func))
|
||||
def dec(request, *args, **kwargs):
|
||||
@ -72,7 +72,7 @@ def require_perms(view_func, required):
|
||||
Raises a :exc:`~horizon.exceptions.NotAuthorized` exception if the
|
||||
requirements are not met.
|
||||
"""
|
||||
from horizon.exceptions import NotAuthorized # noqa
|
||||
from horizon.exceptions import NotAuthorized
|
||||
# We only need to check each permission once for a view, so we'll use a set
|
||||
current_perms = getattr(view_func, '_required_perms', set([]))
|
||||
view_func._required_perms = current_perms | set(required)
|
||||
|
@ -22,14 +22,12 @@ import sys
|
||||
|
||||
import six
|
||||
|
||||
from django.core.management import color_style # noqa
|
||||
from django.http import HttpRequest # noqa
|
||||
from django.core.management import color_style
|
||||
from django.utils import encoding
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.debug import CLEANSED_SUBSTITUTE # noqa
|
||||
from django.views.debug import SafeExceptionReporterFilter # noqa
|
||||
from django.views.debug import SafeExceptionReporterFilter
|
||||
|
||||
from horizon.conf import HORIZON_CONFIG # noqa
|
||||
from horizon.conf import HORIZON_CONFIG
|
||||
from horizon import messages
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -226,7 +224,7 @@ def handle_unauthorized(request, message, redirect, ignore, escalate, handled,
|
||||
# access settings.CACHES in django.core.caches) while
|
||||
# openstack_dashboard.settings requires django.contrib.auth to be
|
||||
# loaded while importing openstack_auth.utils
|
||||
from django.contrib.auth import logout # noqa
|
||||
from django.contrib.auth import logout
|
||||
logout(request)
|
||||
raise NotAuthorized
|
||||
# Otherwise continue and present our "unauthorized" error message.
|
||||
|
@ -15,7 +15,7 @@
|
||||
# Importing non-modules that are not used explicitly
|
||||
|
||||
# FIXME(gabriel): Legacy imports for API compatibility.
|
||||
from django.core.exceptions import ValidationError # noqa
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.forms.fields import * # noqa
|
||||
from django.forms.forms import * # noqa
|
||||
from django.forms import widgets
|
||||
@ -23,26 +23,26 @@ from django.forms.widgets import * # noqa
|
||||
|
||||
|
||||
# Convenience imports for public API components.
|
||||
from horizon.forms.base import DateForm # noqa
|
||||
from horizon.forms.base import SelfHandlingForm # noqa
|
||||
from horizon.forms.base import SelfHandlingMixin # noqa
|
||||
from horizon.forms.fields import DynamicChoiceField # noqa
|
||||
from horizon.forms.fields import DynamicTypedChoiceField # noqa
|
||||
from horizon.forms.fields import ExternalFileField # noqa
|
||||
from horizon.forms.fields import ExternalUploadMeta # noqa
|
||||
from horizon.forms.fields import IPField # noqa
|
||||
from horizon.forms.fields import IPv4 # noqa
|
||||
from horizon.forms.fields import IPv6 # noqa
|
||||
from horizon.forms.fields import MultiIPField # noqa
|
||||
from horizon.forms.fields import SelectWidget # noqa
|
||||
from horizon.forms.fields import ThemableCheckboxInput # noqa
|
||||
from horizon.forms.fields import ThemableCheckboxSelectMultiple # noqa
|
||||
from horizon.forms.fields import ThemableChoiceField # noqa
|
||||
from horizon.forms.fields import ThemableDynamicChoiceField # noqa
|
||||
from horizon.forms.fields import ThemableDynamicTypedChoiceField # noqa
|
||||
from horizon.forms.fields import ThemableSelectWidget # noqa
|
||||
from horizon.forms.views import ModalFormMixin # noqa
|
||||
from horizon.forms.views import ModalFormView # noqa
|
||||
from horizon.forms.base import DateForm
|
||||
from horizon.forms.base import SelfHandlingForm
|
||||
from horizon.forms.base import SelfHandlingMixin
|
||||
from horizon.forms.fields import DynamicChoiceField
|
||||
from horizon.forms.fields import DynamicTypedChoiceField
|
||||
from horizon.forms.fields import ExternalFileField
|
||||
from horizon.forms.fields import ExternalUploadMeta
|
||||
from horizon.forms.fields import IPField
|
||||
from horizon.forms.fields import IPv4
|
||||
from horizon.forms.fields import IPv6
|
||||
from horizon.forms.fields import MultiIPField
|
||||
from horizon.forms.fields import SelectWidget
|
||||
from horizon.forms.fields import ThemableCheckboxInput
|
||||
from horizon.forms.fields import ThemableCheckboxSelectMultiple
|
||||
from horizon.forms.fields import ThemableChoiceField
|
||||
from horizon.forms.fields import ThemableDynamicChoiceField
|
||||
from horizon.forms.fields import ThemableDynamicTypedChoiceField
|
||||
from horizon.forms.fields import ThemableSelectWidget
|
||||
from horizon.forms.views import ModalFormMixin
|
||||
from horizon.forms.views import ModalFormView
|
||||
|
||||
|
||||
__all__ = [
|
||||
@ -53,10 +53,13 @@ __all__ = [
|
||||
"ModalFormMixin",
|
||||
"DynamicTypedChoiceField",
|
||||
"DynamicChoiceField",
|
||||
"ExternalFileField",
|
||||
"ExternalUploadMeta",
|
||||
"ThemableCheckboxInput",
|
||||
"ThemableCheckboxSelectMultiple",
|
||||
"ThemableChoiceField",
|
||||
"ThemableDynamicChoiceField",
|
||||
"ThemableDynamicTypedChoiceField",
|
||||
"ThemableSelectWidget",
|
||||
"IPField",
|
||||
"IPv4",
|
||||
|
@ -17,7 +17,7 @@
|
||||
# under the License.
|
||||
|
||||
from django import forms
|
||||
from django.forms.forms import NON_FIELD_ERRORS # noqa
|
||||
from django.forms.forms import NON_FIELD_ERRORS
|
||||
|
||||
|
||||
class SelfHandlingMixin(object):
|
||||
|
@ -20,16 +20,16 @@ import six
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from django.core.exceptions import ValidationError # noqa
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core import urlresolvers
|
||||
from django.forms import fields
|
||||
from django.forms import forms
|
||||
from django.forms.utils import flatatt # noqa
|
||||
from django.forms.utils import flatatt
|
||||
from django.forms import widgets
|
||||
from django.template import Context # noqa
|
||||
from django.template.loader import get_template # noqa
|
||||
from django.template import Context
|
||||
from django.template.loader import get_template
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.functional import Promise # noqa
|
||||
from django.utils.functional import Promise
|
||||
from django.utils import html
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
@ -21,12 +21,12 @@ import django
|
||||
from django.conf import settings
|
||||
from django.template.engine import Engine
|
||||
from django.template.loaders.base import Loader as tLoaderCls
|
||||
from django.utils._os import safe_join # noqa
|
||||
from django.utils._os import safe_join
|
||||
|
||||
if django.VERSION >= (1, 9):
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
else:
|
||||
from django.template.base import TemplateDoesNotExist # noqa
|
||||
from django.template.base import TemplateDoesNotExist
|
||||
|
||||
# Set up a cache of the panel directories to search.
|
||||
panel_template_dirs = {}
|
||||
|
@ -13,8 +13,8 @@
|
||||
import glob
|
||||
import os
|
||||
|
||||
from django.core.management.base import CommandError # noqa
|
||||
from django.core.management.templates import TemplateCommand # noqa
|
||||
from django.core.management.base import CommandError
|
||||
from django.core.management.templates import TemplateCommand
|
||||
from importlib import import_module
|
||||
|
||||
import horizon
|
||||
|
@ -13,8 +13,8 @@
|
||||
import glob
|
||||
import os
|
||||
|
||||
from django.core.management.base import CommandError # noqa
|
||||
from django.core.management.templates import TemplateCommand # noqa
|
||||
from django.core.management.base import CommandError
|
||||
from django.core.management.templates import TemplateCommand
|
||||
from importlib import import_module
|
||||
|
||||
import horizon
|
||||
|
@ -20,7 +20,7 @@ messaging needs (e.g. AJAX communication, etc.).
|
||||
from django.contrib import messages as _messages
|
||||
from django.contrib.messages import constants
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.safestring import SafeData # noqa
|
||||
from django.utils.safestring import SafeData
|
||||
|
||||
|
||||
def horizon_message_already_queued(request, message):
|
||||
|
@ -23,12 +23,12 @@ import json
|
||||
import logging
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME # noqa
|
||||
from django.contrib.auth.views import redirect_to_login # noqa
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME
|
||||
from django.contrib.auth.views import redirect_to_login
|
||||
from django.contrib import messages as django_messages
|
||||
from django import http
|
||||
from django import shortcuts
|
||||
from django.utils.encoding import iri_to_uri # noqa
|
||||
from django.utils.encoding import iri_to_uri
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
from django.conf import settings
|
||||
from django.conf.urls import include
|
||||
from django.conf.urls import url
|
||||
from django.views.generic import TemplateView # noqa
|
||||
from django.views.generic import TemplateView
|
||||
from django.views import i18n
|
||||
|
||||
from horizon.test.jasmine import jasmine
|
||||
|
@ -15,20 +15,41 @@
|
||||
# Convenience imports for public API components.
|
||||
# Importing non-modules that are not used explicitly
|
||||
|
||||
from horizon.tables.actions import Action # noqa
|
||||
from horizon.tables.actions import BatchAction # noqa
|
||||
from horizon.tables.actions import DeleteAction # noqa
|
||||
from horizon.tables.actions import FilterAction # noqa
|
||||
from horizon.tables.actions import FixedFilterAction # noqa
|
||||
from horizon.tables.actions import LinkAction # noqa
|
||||
from horizon.tables.actions import NameFilterAction # noqa
|
||||
from horizon.tables.actions import UpdateAction # noqa
|
||||
from horizon.tables.base import Column # noqa
|
||||
from horizon.tables.base import DataTable # noqa
|
||||
from horizon.tables.base import Row # noqa
|
||||
from horizon.tables.base import WrappingColumn # noqa
|
||||
from horizon.tables.views import DataTableView # noqa
|
||||
from horizon.tables.views import MixedDataTableView # noqa
|
||||
from horizon.tables.views import MultiTableMixin # noqa
|
||||
from horizon.tables.views import MultiTableView # noqa
|
||||
from horizon.tables.views import PagedTableMixin # noqa
|
||||
from horizon.tables.actions import Action
|
||||
from horizon.tables.actions import BatchAction
|
||||
from horizon.tables.actions import DeleteAction
|
||||
from horizon.tables.actions import FilterAction
|
||||
from horizon.tables.actions import FixedFilterAction
|
||||
from horizon.tables.actions import LinkAction
|
||||
from horizon.tables.actions import NameFilterAction
|
||||
from horizon.tables.actions import UpdateAction
|
||||
from horizon.tables.base import Column
|
||||
from horizon.tables.base import DataTable
|
||||
from horizon.tables.base import Row
|
||||
from horizon.tables.base import WrappingColumn
|
||||
from horizon.tables.views import DataTableView
|
||||
from horizon.tables.views import MixedDataTableView
|
||||
from horizon.tables.views import MultiTableMixin
|
||||
from horizon.tables.views import MultiTableView
|
||||
from horizon.tables.views import PagedTableMixin
|
||||
|
||||
|
||||
__all__ = [
|
||||
'Action',
|
||||
'BatchAction',
|
||||
'DeleteAction',
|
||||
'FilterAction',
|
||||
'FixedFilterAction',
|
||||
'LinkAction',
|
||||
'NameFilterAction',
|
||||
'UpdateAction',
|
||||
'Column',
|
||||
'DataTable',
|
||||
'Row',
|
||||
'WrappingColumn',
|
||||
'DataTableView',
|
||||
'MixedDataTableView',
|
||||
'MultiTableMixin',
|
||||
'MultiTableView',
|
||||
'PagedTableMixin',
|
||||
]
|
||||
|
@ -22,9 +22,9 @@ import warnings
|
||||
from django.conf import settings
|
||||
from django.core import urlresolvers
|
||||
from django import shortcuts
|
||||
from django.template.loader import render_to_string # noqa
|
||||
from django.utils.functional import Promise # noqa
|
||||
from django.utils.http import urlencode # noqa
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.functional import Promise
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.translation import pgettext_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
@ -23,10 +23,10 @@ from django.conf import settings
|
||||
from django.core import exceptions as core_exceptions
|
||||
from django.core import urlresolvers
|
||||
from django import forms
|
||||
from django.http import HttpResponse # noqa
|
||||
from django.http import HttpResponse
|
||||
from django import template
|
||||
from django.template.defaultfilters import slugify # noqa
|
||||
from django.template.defaultfilters import truncatechars # noqa
|
||||
from django.template.defaultfilters import slugify
|
||||
from django.template.defaultfilters import truncatechars
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.html import escape
|
||||
from django.utils import http
|
||||
@ -40,8 +40,8 @@ from horizon import conf
|
||||
from horizon import exceptions
|
||||
from horizon.forms import ThemableCheckboxInput
|
||||
from horizon import messages
|
||||
from horizon.tables.actions import FilterAction # noqa
|
||||
from horizon.tables.actions import LinkAction # noqa
|
||||
from horizon.tables.actions import FilterAction
|
||||
from horizon.tables.actions import LinkAction
|
||||
from horizon.utils import html
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ from django import shortcuts
|
||||
|
||||
from horizon import views
|
||||
|
||||
from horizon.templatetags.horizon import has_permissions # noqa
|
||||
from horizon.templatetags.horizon import has_permissions
|
||||
|
||||
|
||||
class MultiTableMixin(object):
|
||||
|
@ -14,9 +14,19 @@
|
||||
|
||||
# Importing non-modules that are not used explicitly
|
||||
|
||||
from horizon.tabs.base import DetailTabsGroup # noqa
|
||||
from horizon.tabs.base import Tab # noqa
|
||||
from horizon.tabs.base import TabGroup # noqa
|
||||
from horizon.tabs.base import TableTab # noqa
|
||||
from horizon.tabs.views import TabbedTableView # noqa
|
||||
from horizon.tabs.views import TabView # noqa
|
||||
from horizon.tabs.base import DetailTabsGroup
|
||||
from horizon.tabs.base import Tab
|
||||
from horizon.tabs.base import TabGroup
|
||||
from horizon.tabs.base import TableTab
|
||||
from horizon.tabs.views import TabbedTableView
|
||||
from horizon.tabs.views import TabView
|
||||
|
||||
|
||||
__all__ = [
|
||||
'DetailTabsGroup',
|
||||
'Tab',
|
||||
'TabGroup',
|
||||
'TableTab',
|
||||
'TabbedTableView',
|
||||
'TabView',
|
||||
]
|
||||
|
@ -18,7 +18,7 @@ import sys
|
||||
import six
|
||||
|
||||
from django.template.loader import render_to_string
|
||||
from django.template import TemplateSyntaxError # noqa
|
||||
from django.template import TemplateSyntaxError
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon.utils import html
|
||||
|
@ -14,7 +14,7 @@ from django import http
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import tables
|
||||
from horizon.tabs.base import TableTab # noqa
|
||||
from horizon.tabs.base import TableTab
|
||||
from horizon import views
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ from django.utils.encoding import force_text
|
||||
from django.utils import translation
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon.base import Horizon # noqa
|
||||
from horizon.base import Horizon
|
||||
from horizon import conf
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
Template tags for parsing date strings.
|
||||
"""
|
||||
|
||||
from datetime import datetime # noqa
|
||||
from datetime import datetime
|
||||
|
||||
from django import template
|
||||
from django.utils import timezone
|
||||
|
@ -22,16 +22,16 @@ import socket
|
||||
import time
|
||||
import unittest
|
||||
|
||||
from django.contrib.auth.middleware import AuthenticationMiddleware # noqa
|
||||
from django.contrib.auth.models import Permission # noqa
|
||||
from django.contrib.auth.models import User # noqa
|
||||
from django.contrib.contenttypes.models import ContentType # noqa
|
||||
from django.contrib.messages.storage import default_storage # noqa
|
||||
from django.contrib.sessions.backends.base import SessionBase # noqa
|
||||
from django.contrib.auth.middleware import AuthenticationMiddleware
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.messages.storage import default_storage
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from django.core.handlers import wsgi
|
||||
from django import http
|
||||
from django import test as django_test
|
||||
from django.test.client import RequestFactory # noqa
|
||||
from django.test.client import RequestFactory
|
||||
from django.utils.encoding import force_text
|
||||
import six
|
||||
|
||||
@ -50,7 +50,7 @@ try:
|
||||
from selenium.webdriver.support import ui as selenium_ui
|
||||
import xvfbwrapper # Only needed when running the Selenium tests headless
|
||||
|
||||
from horizon.test.webdriver import WebDriver # noqa
|
||||
from horizon.test.webdriver import WebDriver
|
||||
except ImportError as e:
|
||||
LOG.warning("{0}, force WITH_SELENIUM=False".format(str(e)))
|
||||
os.environ['WITH_SELENIUM'] = ''
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from horizon.test.test_dashboards.cats.kittens.views import IndexView # noqa
|
||||
from horizon.test.test_dashboards.cats.kittens.views import IndexView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', IndexView.as_view(), name='index'),
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from horizon.test.test_dashboards.cats.tigers.views import IndexView # noqa
|
||||
from horizon.test.test_dashboards.cats.tigers.views import IndexView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', IndexView.as_view(), name='index'),
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from horizon.test.test_dashboards.dogs.puppies.views import IndexView # noqa
|
||||
from horizon.test.test_dashboards.dogs.puppies.views import TwoTabsView # noqa
|
||||
from horizon.test.test_dashboards.dogs.puppies.views import IndexView
|
||||
from horizon.test.test_dashboards.dogs.puppies.views import TwoTabsView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', IndexView.as_view(), name='index'),
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
import django
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User # noqa
|
||||
from django.core.exceptions import ImproperlyConfigured # noqa
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core import urlresolvers
|
||||
from importlib import import_module
|
||||
from six import moves
|
||||
@ -31,11 +31,11 @@ import horizon
|
||||
from horizon import base
|
||||
from horizon import conf
|
||||
from horizon.test import helpers as test
|
||||
from horizon.test.test_dashboards.cats.dashboard import Cats # noqa
|
||||
from horizon.test.test_dashboards.cats.kittens.panel import Kittens # noqa
|
||||
from horizon.test.test_dashboards.cats.tigers.panel import Tigers # noqa
|
||||
from horizon.test.test_dashboards.dogs.dashboard import Dogs # noqa
|
||||
from horizon.test.test_dashboards.dogs.puppies.panel import Puppies # noqa
|
||||
from horizon.test.test_dashboards.cats.dashboard import Cats
|
||||
from horizon.test.test_dashboards.cats.kittens.panel import Kittens
|
||||
from horizon.test.test_dashboards.cats.tigers.panel import Tigers
|
||||
from horizon.test.test_dashboards.dogs.dashboard import Dogs
|
||||
from horizon.test.test_dashboards.dogs.puppies.panel import Puppies
|
||||
|
||||
|
||||
class MyDash(horizon.Dashboard):
|
||||
|
@ -17,7 +17,7 @@ from mock import patch
|
||||
import django
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import MiddlewareNotUsed
|
||||
from django.http import HttpResponseRedirect # noqa
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.test.utils import override_settings
|
||||
from django.utils import timezone
|
||||
|
||||
|
@ -23,7 +23,7 @@ from django.template import defaultfilters
|
||||
from django.test.utils import override_settings
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
from mox3.mox import IsA # noqa
|
||||
from mox3.mox import IsA
|
||||
import six
|
||||
|
||||
from horizon import tables
|
||||
|
@ -26,8 +26,8 @@ from horizon import middleware
|
||||
from horizon import tabs as horizon_tabs
|
||||
from horizon.test import helpers as test
|
||||
|
||||
from horizon.test.tests.tables import MyTable # noqa
|
||||
from horizon.test.tests.tables import TEST_DATA # noqa
|
||||
from horizon.test.tests.tables import MyTable
|
||||
from horizon.test.tests.tables import TEST_DATA
|
||||
|
||||
|
||||
class BaseTestTab(horizon_tabs.Tab):
|
||||
|
@ -19,11 +19,12 @@
|
||||
import re
|
||||
|
||||
from django.conf import settings
|
||||
from django.template import Context # noqa
|
||||
from django.template import Template # noqa
|
||||
from django.utils.text import normalize_newlines # noqa
|
||||
from django.template import Context
|
||||
from django.template import Template
|
||||
from django.utils.text import normalize_newlines
|
||||
|
||||
from horizon.test import helpers as test
|
||||
# The following imports are required to register the dashboards.
|
||||
from horizon.test.test_dashboards.cats.dashboard import Cats # noqa
|
||||
from horizon.test.test_dashboards.cats.kittens.panel import Kittens # noqa
|
||||
from horizon.test.test_dashboards.dogs.dashboard import Dogs # noqa
|
||||
|
@ -15,7 +15,7 @@
|
||||
import datetime
|
||||
import os
|
||||
|
||||
from django.core.exceptions import ValidationError # noqa
|
||||
from django.core.exceptions import ValidationError
|
||||
import django.template
|
||||
from django.template import defaultfilters
|
||||
|
||||
|
@ -23,8 +23,8 @@ URL patterns for testing Horizon views.
|
||||
from django.conf.urls import include
|
||||
from django.conf.urls import url
|
||||
from django.contrib.auth import views
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns # noqa
|
||||
from django.views.generic import TemplateView # noqa
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
import horizon
|
||||
from horizon.test.jasmine import jasmine
|
||||
|
@ -26,12 +26,12 @@ from django.conf import settings
|
||||
from django.core.exceptions import SuspiciousFileOperation
|
||||
from django.template.engine import Engine
|
||||
from django.template.loaders.base import Loader as tLoaderCls
|
||||
from django.utils._os import safe_join # noqa
|
||||
from django.utils._os import safe_join
|
||||
|
||||
if django.VERSION >= (1, 9):
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
else:
|
||||
from django.template.base import TemplateDoesNotExist # noqa
|
||||
from django.template.base import TemplateDoesNotExist
|
||||
|
||||
|
||||
# Local thread storage to retrieve the currently set theme
|
||||
|
@ -12,12 +12,12 @@
|
||||
|
||||
from __future__ import division
|
||||
|
||||
from csv import DictWriter # noqa
|
||||
from csv import writer # noqa
|
||||
from csv import DictWriter
|
||||
from csv import writer
|
||||
|
||||
|
||||
from django.http import HttpResponse # noqa
|
||||
from django.http import StreamingHttpResponse # noqa
|
||||
from django.http import HttpResponse
|
||||
from django.http import StreamingHttpResponse
|
||||
from django import template as django_template
|
||||
import six
|
||||
|
||||
|
@ -16,8 +16,8 @@ import datetime
|
||||
|
||||
import iso8601
|
||||
|
||||
from django.template.defaultfilters import register # noqa
|
||||
from django.template.defaultfilters import timesince # noqa
|
||||
from django.template.defaultfilters import register
|
||||
from django.template.defaultfilters import timesince
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
@ -19,10 +19,10 @@ from oslo_utils import units
|
||||
import six
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import logout # noqa
|
||||
from django.contrib.auth import logout
|
||||
from django import http
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.functional import lazy # noqa
|
||||
from django.utils.functional import lazy
|
||||
from django.utils import translation
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
import copy
|
||||
|
||||
from django.forms.utils import flatatt # noqa
|
||||
from django.forms.utils import flatatt
|
||||
|
||||
|
||||
class HTMLElement(object):
|
||||
|
@ -16,8 +16,8 @@ import re
|
||||
|
||||
from oslo_utils import netutils
|
||||
|
||||
from django.core.exceptions import ValidationError # noqa
|
||||
from django.core import validators # noqa
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core import validators
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import conf
|
||||
|
@ -12,9 +12,19 @@
|
||||
|
||||
# Importing non-modules that are not used explicitly
|
||||
|
||||
from horizon.workflows.base import Action # noqa
|
||||
from horizon.workflows.base import MembershipAction # noqa
|
||||
from horizon.workflows.base import Step # noqa
|
||||
from horizon.workflows.base import UpdateMembersStep # noqa
|
||||
from horizon.workflows.base import Workflow # noqa
|
||||
from horizon.workflows.views import WorkflowView # noqa
|
||||
from horizon.workflows.base import Action
|
||||
from horizon.workflows.base import MembershipAction
|
||||
from horizon.workflows.base import Step
|
||||
from horizon.workflows.base import UpdateMembersStep
|
||||
from horizon.workflows.base import Workflow
|
||||
from horizon.workflows.views import WorkflowView
|
||||
|
||||
|
||||
__all__ = [
|
||||
'Action',
|
||||
'MembershipAction',
|
||||
'Step',
|
||||
'UpdateMembersStep',
|
||||
'Workflow',
|
||||
'WorkflowView',
|
||||
]
|
||||
|
@ -13,17 +13,17 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
from importlib import import_module # noqa
|
||||
from importlib import import_module
|
||||
import inspect
|
||||
import logging
|
||||
|
||||
from django.core import urlresolvers
|
||||
from django import forms
|
||||
from django.forms.forms import NON_FIELD_ERRORS # noqa
|
||||
from django.forms.forms import NON_FIELD_ERRORS
|
||||
from django import template
|
||||
from django.template.defaultfilters import linebreaks # noqa
|
||||
from django.template.defaultfilters import safe # noqa
|
||||
from django.template.defaultfilters import slugify # noqa
|
||||
from django.template.defaultfilters import linebreaks
|
||||
from django.template.defaultfilters import safe
|
||||
from django.template.defaultfilters import slugify
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from openstack_auth import policy
|
||||
@ -31,7 +31,7 @@ import six
|
||||
|
||||
from horizon import base
|
||||
from horizon import exceptions
|
||||
from horizon.templatetags.horizon import has_permissions # noqa
|
||||
from horizon.templatetags.horizon import has_permissions
|
||||
from horizon.utils import html
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ import six
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon.forms import views as hz_views
|
||||
from horizon.forms.views import ADD_TO_FIELD_HEADER # noqa
|
||||
from horizon.forms.views import ADD_TO_FIELD_HEADER
|
||||
from horizon import messages
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from django.core.management import execute_from_command_line # noqa
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
|
||||
|
@ -20,7 +20,7 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
import install_venv_common as install_venv # noqa
|
||||
import install_venv_common as install_venv
|
||||
|
||||
|
||||
def print_help(venv, root):
|
||||
|
Loading…
Reference in New Issue
Block a user