Sorted imports with isort.
This commit is contained in:
1
Makefile
1
Makefile
@@ -21,6 +21,7 @@ docs:
|
||||
|
||||
test:
|
||||
@flake8
|
||||
@isort --recursive --check-only --diff formtools tests
|
||||
@ coverage run `which django-admin.py` test tests
|
||||
@coverage report
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ from __future__ import unicode_literals
|
||||
# Do not try cPickle here (see #18340)
|
||||
import pickle
|
||||
|
||||
from django.utils.crypto import salted_hmac
|
||||
from django.utils import six
|
||||
from django.utils.crypto import salted_hmac
|
||||
|
||||
|
||||
def form_hmac(form):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.core.files.uploadedfile import UploadedFile
|
||||
from django.utils import six
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.functional import lazy_property
|
||||
from django.utils import six
|
||||
|
||||
from .exceptions import NoFileStorageConfigured
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
from collections import OrderedDict
|
||||
import re
|
||||
from collections import OrderedDict
|
||||
|
||||
from django import forms
|
||||
from django.shortcuts import redirect
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.forms import formsets, ValidationError
|
||||
from django.views.generic import TemplateView
|
||||
from django.forms import ValidationError, formsets
|
||||
from django.shortcuts import redirect
|
||||
from django.utils import six
|
||||
from django.utils.decorators import classonlymethod
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils import six
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from .forms import ManagementForm
|
||||
from .storage import get_storage
|
||||
from .storage.exceptions import NoFileStorageConfigured
|
||||
from .forms import ManagementForm
|
||||
|
||||
|
||||
def normalize_name(name):
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
[flake8]
|
||||
max-line-length = 119
|
||||
|
||||
[isort]
|
||||
combine_as_imports = true
|
||||
default_section = THIRDPARTY
|
||||
include_trailing_comma = true
|
||||
known_first_party = formtools
|
||||
line_length = 79
|
||||
multi_line_output = 5
|
||||
not_skip = __init__.py
|
||||
|
||||
[metadata]
|
||||
license-file = LICENSE
|
||||
|
||||
|
||||
7
setup.py
7
setup.py
@@ -1,10 +1,11 @@
|
||||
import codecs
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import codecs
|
||||
from fnmatch import fnmatchcase
|
||||
from distutils.util import convert_path
|
||||
from setuptools import setup, find_packages
|
||||
from fnmatch import fnmatchcase
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
|
||||
def read(*parts):
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
coverage==3.7.1
|
||||
flake8==2.2.3
|
||||
isort
|
||||
|
||||
@@ -4,9 +4,8 @@ This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only.
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from .tests import TestFormPreview
|
||||
from .forms import TestForm
|
||||
|
||||
from .tests import TestFormPreview
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^preview/', TestFormPreview(TestForm)),
|
||||
|
||||
@@ -2,12 +2,11 @@ import os
|
||||
import tempfile
|
||||
|
||||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.forms.formsets import formset_factory
|
||||
from django.http import HttpResponse
|
||||
from django.template import Template, Context
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.template import Context, Template
|
||||
|
||||
from formtools.wizard.views import NamedUrlWizardView
|
||||
|
||||
|
||||
@@ -2,19 +2,18 @@ from __future__ import unicode_literals
|
||||
|
||||
import copy
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.http import QueryDict
|
||||
from django.test import TestCase, override_settings
|
||||
from django.utils._os import upath
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from formtools.wizard.views import (NamedUrlSessionWizardView,
|
||||
NamedUrlCookieWizardView)
|
||||
from formtools.wizard.views import (
|
||||
NamedUrlCookieWizardView, NamedUrlSessionWizardView,
|
||||
)
|
||||
|
||||
from ..test_forms import Step1, Step2, get_request
|
||||
from .forms import temp_storage
|
||||
from ..test_forms import get_request, Step1, Step2
|
||||
|
||||
|
||||
# On Python 2, __file__ may end with .pyc
|
||||
THIS_FILE = upath(__file__).rstrip("c")
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from django.conf.urls import url
|
||||
from .forms import (SessionContactWizard, CookieContactWizard,
|
||||
Page1, Page2, Page3, Page4)
|
||||
|
||||
from .forms import (
|
||||
CookieContactWizard, Page1, Page2, Page3, Page4, SessionContactWizard,
|
||||
)
|
||||
|
||||
|
||||
def get_named_session_wizard():
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
from datetime import datetime
|
||||
from importlib import import_module
|
||||
import os
|
||||
import tempfile
|
||||
from datetime import datetime
|
||||
from importlib import import_module
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
temp_storage_location = tempfile.mkdtemp(dir=os.environ.get('DJANGO_TEST_TEMP_DIR'))
|
||||
temp_storage = FileSystemStorage(location=temp_storage_location)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from django.test import TestCase
|
||||
from django.core import signing
|
||||
from django.http import HttpResponse
|
||||
from django.test import TestCase
|
||||
|
||||
from formtools.wizard.storage.cookie import CookieStorage
|
||||
|
||||
from .storage import get_request, TestStorage
|
||||
from .storage import TestStorage, get_request
|
||||
|
||||
|
||||
class TestCookieStorage(TestStorage, TestCase):
|
||||
|
||||
@@ -4,15 +4,14 @@ from importlib import import_module
|
||||
|
||||
from django import forms, http
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.test import TestCase
|
||||
from django.template.response import TemplateResponse
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
from django.template.response import TemplateResponse
|
||||
from django.test import TestCase
|
||||
|
||||
from formtools.wizard.views import (WizardView,
|
||||
SessionWizardView,
|
||||
CookieWizardView)
|
||||
from formtools.wizard.views import (
|
||||
CookieWizardView, SessionWizardView, WizardView,
|
||||
)
|
||||
|
||||
|
||||
class DummyRequest(http.HttpRequest):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from formtools.wizard.storage import get_storage, MissingStorage
|
||||
from formtools.wizard.storage import MissingStorage, get_storage
|
||||
from formtools.wizard.storage.base import BaseStorage
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,10 @@ from django.core.files.storage import FileSystemStorage
|
||||
from django.forms.formsets import formset_factory
|
||||
from django.forms.models import modelformset_factory
|
||||
from django.http import HttpResponse
|
||||
from django.template import Template, Context
|
||||
from django.template import Context, Template
|
||||
|
||||
from formtools.wizard.views import WizardView
|
||||
|
||||
|
||||
temp_storage_location = tempfile.mkdtemp(dir=os.environ.get('DJANGO_TEST_TEMP_DIR'))
|
||||
temp_storage = FileSystemStorage(location=temp_storage_location)
|
||||
|
||||
|
||||
@@ -3,16 +3,15 @@ from __future__ import unicode_literals
|
||||
import copy
|
||||
|
||||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
from django.test import TestCase, override_settings
|
||||
from django.test.client import RequestFactory
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils._os import upath
|
||||
|
||||
from formtools.wizard.views import CookieWizardView
|
||||
|
||||
from .models import Poet, Poem
|
||||
from .forms import temp_storage
|
||||
|
||||
from .models import Poem, Poet
|
||||
|
||||
# On Python 2, __file__ may end with .pyc
|
||||
THIS_FILE = upath(__file__.rstrip("c"))
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from django.conf.urls import url
|
||||
from .forms import (SessionContactWizard, CookieContactWizard,
|
||||
Page1, Page2, Page3, Page4)
|
||||
|
||||
from .forms import (
|
||||
CookieContactWizard, Page1, Page2, Page3, Page4, SessionContactWizard,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^wiz_session/$', SessionContactWizard.as_view(
|
||||
|
||||
Reference in New Issue
Block a user