Permalink
Browse files

sort imports using isort

pip install isort
isort -y
  • Loading branch information...
fyfe committed Feb 2, 2018
1 parent 8a1d573 commit 24a7ca6a9eba8ac1314208e8941bc4e2c70cffc9
Showing with 272 additions and 453 deletions.
  1. +0 −1 bin/modoboa-admin.py
  2. +2 −1 doc/conf.py
  3. +1 −2 modoboa/__init__.py
  4. +2 −5 modoboa/admin/api.py
  5. +2 −3 modoboa/admin/app_settings.py
  6. +0 −1 modoboa/admin/constants.py
  7. +6 −6 modoboa/admin/forms/__init__.py
  8. +3 −8 modoboa/admin/forms/account.py
  9. +3 −7 modoboa/admin/forms/alias.py
  10. +5 −11 modoboa/admin/forms/domain.py
  11. +5 −13 modoboa/admin/handlers.py
  12. +5 −7 modoboa/admin/lib.py
  13. +3 −4 modoboa/admin/management/commands/handle_mailbox_operations.py
  14. +1 −1 modoboa/admin/management/commands/modo.py
  15. +3 −2 modoboa/admin/management/commands/subcommands/_export.py
  16. +1 −2 modoboa/admin/management/commands/subcommands/_import.py
  17. +0 −1 modoboa/admin/management/commands/subcommands/_manage_dkim_keys.py
  18. +1 −2 modoboa/admin/management/commands/subcommands/_mx.py
  19. +2 −4 modoboa/admin/management/commands/subcommands/_repair.py
  20. +2 −2 modoboa/admin/models/__init__.py
  21. +6 −7 modoboa/admin/models/alias.py
  22. +1 −2 modoboa/admin/models/base.py
  23. +4 −5 modoboa/admin/models/domain.py
  24. +4 −7 modoboa/admin/models/domain_alias.py
  25. +2 −3 modoboa/admin/models/mailbox.py
  26. +10 −11 modoboa/admin/serializers.py
  27. +1 −2 modoboa/admin/templatetags/admin_tags.py
  28. +4 −7 modoboa/admin/tests/test_account.py
  29. +5 −3 modoboa/admin/tests/test_alias.py
  30. +2 −5 modoboa/admin/tests/test_api.py
  31. +1 −2 modoboa/admin/tests/test_domain.py
  32. +1 −2 modoboa/admin/tests/test_domain_alias.py
  33. +1 −3 modoboa/admin/tests/test_export.py
  34. +1 −2 modoboa/admin/tests/test_import_.py
  35. +2 −4 modoboa/admin/tests/test_mailbox_operations.py
  36. +2 −5 modoboa/admin/tests/test_mx.py
  37. +0 −1 modoboa/admin/tests/test_password_schemes.py
  38. +2 −5 modoboa/admin/tests/test_repair.py
  39. +0 −1 modoboa/admin/tests/test_user.py
  40. +1 −1 modoboa/admin/tests/utils.py
  41. +4 −6 modoboa/admin/urls.py
  42. +0 −1 modoboa/admin/urls_api.py
  43. +1 −2 modoboa/admin/views/__init__.py
  44. +6 −10 modoboa/admin/views/alias.py
  45. +2 −4 modoboa/admin/views/dns.py
  46. +10 −12 modoboa/admin/views/domain.py
  47. +3 −4 modoboa/admin/views/export.py
  48. +10 −16 modoboa/admin/views/identity.py
  49. +6 −8 modoboa/admin/views/import_.py
  50. +3 −5 modoboa/admin/views/user.py
  51. +3 −6 modoboa/core/app_settings.py
  52. +0 −1 modoboa/core/checks/settings_checks.py
  53. +1 −1 modoboa/core/commands/__init__.py
  54. +10 −8 modoboa/core/commands/deploy.py
  55. +1 −1 modoboa/core/commands/help.py
  56. +3 −5 modoboa/core/forms.py
  57. +6 −11 modoboa/core/handlers.py
  58. +0 −1 modoboa/core/management/commands/clean_inactive_accounts.py
  59. +0 −1 modoboa/core/management/commands/communicate_with_public_api.py
  60. +3 −4 modoboa/core/management/commands/generate_postfix_maps.py
  61. +1 −5 modoboa/core/management/commands/load_initial_data.py
  62. +1 −2 modoboa/core/management/commands/set_default_site.py
  63. +0 −1 modoboa/core/mocks.py
  64. +10 −14 modoboa/core/models.py
  65. +3 −3 modoboa/core/password_hashers/__init__.py
  66. +0 −1 modoboa/core/password_hashers/advanced.py
  67. +2 −2 modoboa/core/password_hashers/base.py
  68. +5 −5 modoboa/core/templatetags/core_tags.py
  69. +4 −7 modoboa/core/tests/test_authentication.py
  70. +2 −6 modoboa/core/tests/test_core.py
  71. +3 −6 modoboa/core/tests/test_ldap.py
  72. +2 −6 modoboa/core/tests/test_views.py
  73. +0 −1 modoboa/core/utils.py
  74. +2 −1 modoboa/core/views/__init__.py
  75. +2 −5 modoboa/core/views/admin.py
  76. +5 −6 modoboa/core/views/auth.py
  77. +1 −2 modoboa/core/views/base.py
  78. +2 −3 modoboa/core/views/dashboard.py
  79. +3 −5 modoboa/core/views/user.py
  80. +1 −1 modoboa/lib/api_client.py
  81. +1 −1 modoboa/lib/authbackends.py
  82. +2 −2 modoboa/lib/cryptutils.py
  83. +3 −4 modoboa/lib/email_utils.py
  84. +1 −2 modoboa/lib/form_utils.py
  85. +2 −2 modoboa/lib/ldap_utils.py
  86. +1 −1 modoboa/lib/listing.py
  87. +2 −2 modoboa/lib/middleware.py
  88. +1 −2 modoboa/lib/permissions.py
  89. +1 −0 modoboa/lib/singleton.py
  90. +1 −1 modoboa/lib/sysutils.py
  91. +2 −3 modoboa/lib/templatetags/form_tags.py
  92. +1 −1 modoboa/lib/templatetags/lib_tags.py
  93. +0 −1 modoboa/lib/tests/__init__.py
  94. +2 −1 modoboa/lib/tests/test_email_utils.py
  95. +1 −1 modoboa/lib/u2u_decode.py
  96. +0 −1 modoboa/limits/constants.py
  97. +1 −2 modoboa/limits/forms.py
  98. +5 −13 modoboa/limits/handlers.py
  99. +1 −3 modoboa/limits/models.py
  100. +1 −3 modoboa/limits/tests/test_api.py
  101. +0 −1 modoboa/limits/tests/test_domain_limits.py
  102. +2 −5 modoboa/limits/tests/test_import.py
  103. +0 −1 modoboa/limits/tests/test_user_limits.py
  104. +0 −1 modoboa/limits/urls_api.py
  105. +1 −2 modoboa/limits/viewsets.py
  106. +1 −2 modoboa/parameters/forms.py
  107. +1 −3 modoboa/parameters/tools.py
  108. +1 −2 modoboa/relaydomains/forms.py
  109. +2 −7 modoboa/relaydomains/handlers.py
  110. +1 −2 modoboa/relaydomains/lib.py
  111. +1 −2 modoboa/relaydomains/serializers.py
  112. +4 −7 modoboa/relaydomains/tests.py
  113. +0 −1 modoboa/relaydomains/urls_api.py
  114. +1 −2 modoboa/relaydomains/viewsets.py
  115. +0 −1 modoboa/transport/apps.py
  116. +1 −3 modoboa/transport/forms.py
  117. +1 −4 modoboa/transport/handlers.py
  118. +1 −2 modoboa/transport/models.py
  119. +4 −5 modoboa/urls.py
  120. +0 −1 modoboa/urls_api.py
  121. +2 −1 setup.py
  122. +1 −2 test_project/test_project/settings.py
View
@@ -7,4 +7,3 @@
if __name__ == "__main__":
handle_command_line()
View
@@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
View
@@ -4,8 +4,7 @@
from __future__ import unicode_literals
from pkg_resources import get_distribution, DistributionNotFound
from pkg_resources import DistributionNotFound, get_distribution
try:
__version__ = get_distribution(__name__).version
View
@@ -3,19 +3,16 @@
from __future__ import unicode_literals
from django import http
from django.contrib.contenttypes.models import ContentType
from rest_framework import filters, status, viewsets
from rest_framework.decorators import detail_route, list_route
from rest_framework.exceptions import ParseError
from rest_framework.permissions import IsAuthenticated, DjangoModelPermissions
from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated
from rest_framework.response import Response
from modoboa.core import models as core_models
from . import models
from . import serializers
from . import models, serializers
class DomainViewSet(viewsets.ModelViewSet):
@@ -6,13 +6,12 @@
from django import forms
from django.conf import settings
from django.utils.translation import ugettext as _, ugettext_lazy
from django.utils.encoding import force_text
from django.utils.translation import ugettext as _, ugettext_lazy
from modoboa.lib.form_utils import YesNoField, SeparatorField
from modoboa.lib.form_utils import SeparatorField, YesNoField
from modoboa.lib.sysutils import exec_cmd
from modoboa.parameters import forms as param_forms
from . import constants
@@ -4,7 +4,6 @@
from django.utils.translation import ugettext_lazy as _
DNSBL_PROVIDERS = [
"aspews.ext.sorbs.net",
"b.barracudacentral.org",
@@ -1,16 +1,16 @@
from __future__ import unicode_literals
from .domain import (
DomainFormGeneral, DomainFormOptions, DomainForm, DomainWizard
)
from .account import (
AccountFormGeneral, AccountFormMail, AccountPermissionsForm,
AccountForm, AccountWizard
AccountForm, AccountFormGeneral, AccountFormMail, AccountPermissionsForm,
AccountWizard
)
from .alias import AliasForm
from .domain import (
DomainForm, DomainFormGeneral, DomainFormOptions, DomainWizard
)
from .export import ExportDataForm, ExportDomainsForm, ExportIdentitiesForm
from .forward import ForwardForm
from .import_ import ImportDataForm, ImportIdentitiesForm
from .export import ExportDataForm, ExportDomainsForm, ExportIdentitiesForm
__all__ = [
"DomainFormGeneral", "DomainFormOptions", "DomainForm",
@@ -7,28 +7,23 @@
from django import forms
from django.conf import settings
from django.contrib.auth import password_validation
from django.http import QueryDict
from django.urls import reverse
from django.utils.translation import ugettext as _, ugettext_lazy
from django.contrib.auth import password_validation
from modoboa.core import signals as core_signals
from modoboa.core.models import User
from modoboa.lib import exceptions as lib_exceptions, fields as lib_fields
from modoboa.lib.email_utils import split_mailbox
from modoboa.lib import exceptions as lib_exceptions
from modoboa.lib import fields as lib_fields
from modoboa.lib.form_utils import (
DynamicForm, TabForms, WizardForm, WizardStep
)
from modoboa.lib.permissions import get_account_roles
from modoboa.lib.validators import validate_utf8_email
from modoboa.lib.web_utils import render_to_json_response
from modoboa.parameters import tools as param_tools
from .. import lib
from .. import models
from .. import signals
from .. import lib, models, signals
class AccountFormGeneral(forms.ModelForm):
@@ -9,14 +9,10 @@
from django.utils.translation import ugettext as _, ugettext_lazy
from modoboa.core import signals as core_signals
from modoboa.lib import exceptions as lib_exceptions
from modoboa.lib import exceptions as lib_exceptions, fields as lib_fields
from modoboa.lib.email_utils import split_mailbox
from modoboa.lib import fields as lib_fields
from modoboa.lib.form_utils import (
DynamicForm
)
from ..models import Domain, Alias
from modoboa.lib.form_utils import DynamicForm
from ..models import Alias, Domain
class AliasForm(forms.ModelForm, DynamicForm):
@@ -5,28 +5,22 @@
from functools import reduce
from django import forms
from django.urls import reverse
from django.http import QueryDict
from django.utils.translation import ugettext as _, ugettext_lazy
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.translation import ugettext as _, ugettext_lazy
from modoboa.core import signals as core_signals
from modoboa.core.models import User
from modoboa.lib.exceptions import Conflict
from modoboa.lib.fields import DomainNameField
from modoboa.lib.form_utils import (
YesNoField, WizardForm, WizardStep, DynamicForm, TabForms
DynamicForm, TabForms, WizardForm, WizardStep, YesNoField
)
from modoboa.lib.web_utils import render_to_json_response
from modoboa.parameters import tools as param_tools
from .. import constants
from .. import lib
from .. import signals
from ..models import (
Domain, DomainAlias, Mailbox, Alias
)
from .. import constants, lib, signals
from ..models import Alias, Domain, DomainAlias, Mailbox
class DomainFormGeneral(forms.ModelForm, DynamicForm):
View
@@ -2,26 +2,18 @@
from __future__ import unicode_literals
from django.urls import reverse
from django.contrib.contenttypes.models import ContentType
from django.db.models import signals
from django.dispatch import receiver
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.contrib.contenttypes.models import ContentType
from modoboa.core import models as core_models
from modoboa.core import signals as core_signals
from modoboa.core import models as core_models, signals as core_signals
from modoboa.lib import exceptions, permissions, signals as lib_signals
from modoboa.lib.cryptutils import encrypt
from modoboa.lib.email_utils import split_mailbox
from modoboa.lib import exceptions
from modoboa.lib import permissions
from modoboa.lib import signals as lib_signals
from modoboa.parameters import tools as param_tools
from . import signals as admin_signals
from . import lib
from . import models
from . import postfix_maps
from . import lib, models, postfix_maps, signals as admin_signals
@receiver(signals.post_save, sender=models.Domain)
View
@@ -4,30 +4,28 @@
from __future__ import unicode_literals
from functools import wraps
import ipaddress
from itertools import chain
import logging
import random
import socket
import string
from functools import wraps
from itertools import chain
from dns.name import IDNA_2008_UTS_46
import dns.resolver
from dns.name import IDNA_2008_UTS_46
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.utils.encoding import smart_text
from django.utils.translation import ugettext as _
from modoboa.core.models import User
from modoboa.core import signals as core_signals
from modoboa.core.models import User
from modoboa.lib.exceptions import PermDeniedException
from modoboa.parameters import tools as param_tools
from .models import Domain, DomainAlias, Alias
from . import signals
from .models import Alias, Domain, DomainAlias
def needs_mailbox():
@@ -1,17 +1,16 @@
"""A management command to apply mailbox operations."""
from __future__ import unicode_literals, print_function
from __future__ import print_function, unicode_literals
import logging
import os
import shutil
from django.core.management.base import BaseCommand
from modoboa.parameters import tools as param_tools
from modoboa.lib.sysutils import exec_cmd
from modoboa.lib.exceptions import InternalError
from modoboa.lib.sysutils import exec_cmd
from modoboa.parameters import tools as param_tools
from ...app_settings import load_admin_settings
from ...models import MailboxOperation
@@ -4,10 +4,10 @@
from subcommand.base import SubcommandCommand
from .subcommands._mx import CheckMXRecords
from .subcommands._export import ExportCommand
from .subcommands._import import ImportCommand
from .subcommands._manage_dkim_keys import ManageDKIMKeys
from .subcommands._mx import CheckMXRecords
from .subcommands._repair import Repair
@@ -2,13 +2,14 @@
from __future__ import unicode_literals
from backports import csv
import sys
from backports import csv
from django.core.management.base import BaseCommand
from modoboa.core.models import User
from modoboa.core.extensions import exts_pool
from modoboa.core.models import User
from .... import models
@@ -2,18 +2,17 @@
from __future__ import unicode_literals
from backports import csv
import io
import os
import progressbar
from backports import csv
from django.core.management.base import BaseCommand, CommandError
from modoboa.core import models as core_models
from modoboa.core.extensions import exts_pool
from modoboa.lib.exceptions import Conflict
from .... import signals
@@ -9,7 +9,6 @@
from modoboa.lib import sysutils
from modoboa.parameters import tools as param_tools
from .... import models
@@ -18,8 +18,7 @@
from django.utils.functional import cached_property
from django.utils.translation import ugettext as _
from modoboa.admin import constants
from modoboa.admin import models
from modoboa.admin import constants, models
from modoboa.parameters import tools as param_tools
@@ -6,11 +6,9 @@
from django.core.management.base import BaseCommand
from django.utils.encoding import smart_str
from modoboa.lib.permissions import grant_access_to_object
from modoboa.lib.permissions import get_object_owner
from modoboa.core.models import User
from modoboa.admin import models
from modoboa.core.models import User
from modoboa.lib.permissions import get_object_owner, grant_access_to_object
known_problems = []
@@ -2,12 +2,12 @@
from __future__ import unicode_literals
from .alias import Alias, AliasRecipient
from .base import AdminObject
from .domain import Domain
from .domain_alias import DomainAlias
from .mailbox import Mailbox, Quota, MailboxOperation, SenderAddress
from .mailbox import Mailbox, MailboxOperation, Quota, SenderAddress
from .mxrecord import DNSBLResult, MXRecord
from .alias import Alias, AliasRecipient
__all__ = [
"AdminObject",
@@ -5,25 +5,24 @@
import hashlib
import random
from django.urls import reverse
from reversion import revisions as reversion
from django.db import models
from django.urls import reverse
from django.utils.encoding import (
python_2_unicode_compatible, smart_text, force_str, force_bytes
force_bytes, force_str, python_2_unicode_compatible, smart_text
)
from django.utils.translation import ugettext as _, ugettext_lazy
from reversion import revisions as reversion
from modoboa.core import signals as core_signals
from modoboa.lib.email_utils import split_mailbox
from modoboa.lib.exceptions import (
PermDeniedException, BadRequest, Conflict, NotFound
BadRequest, Conflict, NotFound, PermDeniedException
)
from .. import signals
from .base import AdminObject
from .domain import Domain
from .mailbox import Mailbox
from .. import signals
@python_2_unicode_compatible
Oops, something went wrong.

0 comments on commit 24a7ca6

Please sign in to comment.