Skip to content

Commit

Permalink
Sorting imports by isort
Browse files Browse the repository at this point in the history
  • Loading branch information
djk2 committed Feb 20, 2017
1 parent 9ee4f57 commit 63931bb
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 54 deletions.
9 changes: 3 additions & 6 deletions demo/demo/forms.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from django import forms
from crispy_forms.helper import FormHelper
from django import forms

from django_popup_view_field import PopupViewField

from .popups import (
SexPopupView,
ColorPopupView,
CountryPopupView,
)
from .popups import ColorPopupView, CountryPopupView, SexPopupView


class DemoForm(forms.Form):
Expand Down
12 changes: 6 additions & 6 deletions demo/demo/popups.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.views.generic import (
TemplateView,
FormView,
)
from string import ascii_uppercase

from django import forms
from django.http import HttpResponse
from django.views.generic import FormView, TemplateView

from django_popup_view_field.registry import registry_popup_view
from django import forms
from string import ascii_uppercase

from .models import Country


Expand Down
3 changes: 2 additions & 1 deletion demo/demo/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.conf.urls import url, include
from django.conf.urls import include, url
from django.contrib import admin

from .views import Index

urlpatterns = [
Expand Down
3 changes: 2 additions & 1 deletion demo/demo/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.views.generic import TemplateView
from django.http import HttpResponse
from django.views.generic import TemplateView

from .forms import DemoForm


Expand Down
5 changes: 3 additions & 2 deletions django_popup_view_field/fields.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.forms.fields import CharField
from django.views.generic import View
from django.utils.translation import ugettext_lazy as _
from .widgets import PopupViewWidget
from django.views.generic import View

from .exceptions import PopupViewIsNotSubclassView
from .widgets import PopupViewWidget


class PopupViewField(CharField):
Expand Down
3 changes: 2 additions & 1 deletion django_popup_view_field/registry.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.views.generic import View

from .exceptions import (
PopupViewAlreadyRegistered,
PopupViewNotRegistered,
PopupViewIsNotSubclassView,
PopupViewNotRegistered,
)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
from django.template import Context, Library, loader
from django.utils.safestring import mark_safe
from django.template import (
loader,
Library,
Context
)


register = Library()

Expand Down
4 changes: 3 additions & 1 deletion django_popup_view_field/tests/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# encoding: utf-8
from django_popup_view_field.fields import PopupViewField
from django import forms

from django_popup_view_field.fields import PopupViewField

from .popups import PopupView1


Expand Down
1 change: 1 addition & 0 deletions django_popup_view_field/tests/popups.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# encoding: utf-8
from django.views.generic import TemplateView

from django_popup_view_field.registry import registry_popup_view


Expand Down
10 changes: 4 additions & 6 deletions django_popup_view_field/tests/test_field.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# encoding: utf-8
from django.test import TestCase
from django_popup_view_field.fields import PopupViewField
from django import VERSION, forms
from django.forms.fields import CharField
from django.test import TestCase
from django.views.generic import View
from django import (
forms,
VERSION,
)

from django_popup_view_field.fields import PopupViewField


class FieldTest(TestCase):
Expand Down
6 changes: 3 additions & 3 deletions django_popup_view_field/tests/test_registry.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# encoding: utf-8
from django_popup_view_field.registry import registry_popup_view
from django.views.generic import View
from django.test import TestCase
from django.views.generic import View

from django_popup_view_field.exceptions import (
PopupViewIsNotSubclassView,
PopupViewAlreadyRegistered,
PopupViewIsNotSubclassView,
PopupViewNotRegistered,
)
from django_popup_view_field.registry import registry_popup_view


class RegistryTest(TestCase):
Expand Down
5 changes: 1 addition & 4 deletions django_popup_view_field/tests/test_templatetags.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# encoding: utf-8
from django.template import Context, engines
from django.test import TestCase
from django.template import (
engines,
Context
)


class TemplatetagsTest(TestCase):
Expand Down
6 changes: 1 addition & 5 deletions django_popup_view_field/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# encoding: utf-8
import django

from django.test import (
TestCase,
Client,
)
from django.test import Client, TestCase

if django.VERSION < (1, 10):
from django.core.urlresolvers import reverse
Expand Down
6 changes: 2 additions & 4 deletions django_popup_view_field/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# encoding: utf-8
from django.conf.urls import url, include
from .views import (
View1,
)
from django.conf.urls import include, url

from .views import View1

urlpatterns = [

Expand Down
3 changes: 2 additions & 1 deletion django_popup_view_field/tests/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# encoding: utf-8
from django.views.generic import FormView
from django.http import HttpResponse
from django.views.generic import FormView

from .forms import Form1


Expand Down
3 changes: 2 additions & 1 deletion django_popup_view_field/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from django import VERSION
from django.conf.urls import url

from .views import GetPopupView

"""
Expand All @@ -7,7 +9,6 @@
and for django >= 1.10 I use view class
"""

from django import VERSION
if VERSION < (1, 10):
from django.views.i18n import javascript_catalog
else:
Expand Down
3 changes: 2 additions & 1 deletion django_popup_view_field/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.views.generic import View
from django.http import Http404
from django.views.generic import View

from .registry import registry_popup_view


Expand Down
4 changes: 2 additions & 2 deletions django_popup_view_field/widgets.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django import forms
from django.core.urlresolvers import reverse
from django.forms.utils import flatatt
from django.utils.html import format_html
from django.utils.encoding import force_text
from django.core.urlresolvers import reverse
from django.utils.html import format_html


class PopupViewWidget(forms.TextInput):
Expand Down
1 change: 0 additions & 1 deletion run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from django.conf import settings
from django.test.utils import get_runner


if __name__ == "__main__":
'''
Test for project, go to test app directory and set settings
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ envlist=
{py27,py34}-dj_1.8-bootstrap_7.0.0-crispy_{1.5.0,1.5.1}-tests,
{py27,py34}-dj_1.9-bootstrap_{7.1.0,7.0.0}-crispy_{1.6.0,1.6.1}-tests,
{py27,py34}-dj_1.10-bootstrap_{7.1.0,7.0.0}-crispy_{1.6.1,1.6.1}-tests,
{py27,py34}-flake
{py27,py34}-flake,
py34-isort

[testenv]
basepython =
Expand All @@ -28,4 +29,4 @@ deps =
commands =
tests: ./run_test.py
flake: flake8
isort: isort -rc -w80 -m3 -tc -c -df django_popup_view_field runtests.py
isort: isort -rc -w80 -m3 -tc -c -df django_popup_view_field run_test.py

0 comments on commit 63931bb

Please sign in to comment.