Permalink
Browse files

unicode_literals everywhere and modoboa-admin deploy fixes

  • Loading branch information...
arthru committed May 11, 2017
1 parent 799e06b commit 615f73f272363bc1e19ea8561215fa1a4b83bae7
Showing with 364 additions and 14 deletions.
  1. +2 −0 bin/modoboa-admin.py
  2. +1 −0 modoboa/__init__.py
  3. +2 −0 modoboa/admin/__init__.py
  4. +2 −0 modoboa/admin/api.py
  5. +2 −0 modoboa/admin/app_settings.py
  6. +2 −0 modoboa/admin/apps.py
  7. +2 −0 modoboa/admin/constants.py
  8. +3 −0 modoboa/admin/factories.py
  9. +2 −0 modoboa/admin/forms/__init__.py
  10. +2 −0 modoboa/admin/forms/account.py
  11. +2 −0 modoboa/admin/forms/alias.py
  12. +2 −0 modoboa/admin/forms/domain.py
  13. +2 −0 modoboa/admin/forms/export.py
  14. +2 −0 modoboa/admin/forms/forward.py
  15. +2 −0 modoboa/admin/forms/import_.py
  16. +2 −0 modoboa/admin/handlers.py
  17. +2 −0 modoboa/admin/lib.py
  18. +1 −0 modoboa/admin/management/__init__.py
  19. +1 −0 modoboa/admin/management/commands/__init__.py
  20. +1 −1 modoboa/admin/management/commands/handle_mailbox_operations.py
  21. +2 −0 modoboa/admin/management/commands/modo.py
  22. +1 −0 modoboa/admin/management/commands/subcommands/__init__.py
  23. +2 −0 modoboa/admin/management/commands/subcommands/_export.py
  24. +2 −0 modoboa/admin/management/commands/subcommands/_import.py
  25. +1 −1 modoboa/admin/management/commands/subcommands/_mx.py
  26. +1 −1 modoboa/admin/management/commands/subcommands/_repair.py
  27. +1 −0 modoboa/admin/migrations/__init__.py
  28. +2 −0 modoboa/admin/models/__init__.py
  29. +2 −0 modoboa/admin/models/alias.py
  30. +2 −0 modoboa/admin/models/base.py
  31. +2 −0 modoboa/admin/models/domain.py
  32. +2 −0 modoboa/admin/models/domain_alias.py
  33. +2 −0 modoboa/admin/models/mailbox.py
  34. +2 −0 modoboa/admin/postfix_maps.py
  35. +2 −0 modoboa/admin/serializers.py
  36. +2 −0 modoboa/admin/signals.py
  37. +1 −0 modoboa/admin/templatetags/__init__.py
  38. +2 −0 modoboa/admin/templatetags/admin_tags.py
  39. +1 −0 modoboa/admin/tests/__init__.py
  40. +2 −0 modoboa/admin/tests/test_account.py
  41. +2 −0 modoboa/admin/tests/test_alias.py
  42. +2 −0 modoboa/admin/tests/test_api.py
  43. +2 −0 modoboa/admin/tests/test_domain.py
  44. +2 −0 modoboa/admin/tests/test_domain_alias.py
  45. +2 −0 modoboa/admin/tests/test_export.py
  46. +3 −0 modoboa/admin/tests/test_import_.py
  47. +2 −0 modoboa/admin/tests/test_mailbox_operations.py
  48. +2 −0 modoboa/admin/tests/test_mapfiles.py
  49. +2 −0 modoboa/admin/tests/test_mx.py
  50. +2 −0 modoboa/admin/tests/test_password_schemes.py
  51. +3 −0 modoboa/admin/tests/test_repair.py
  52. +2 −0 modoboa/admin/tests/test_user.py
  53. +2 −0 modoboa/admin/urls.py
  54. +2 −0 modoboa/admin/urls_api.py
  55. +2 −0 modoboa/admin/views/__init__.py
  56. +2 −0 modoboa/admin/views/alias.py
  57. +2 −0 modoboa/admin/views/dns.py
  58. +2 −0 modoboa/admin/views/domain.py
  59. +2 −0 modoboa/admin/views/export.py
  60. +2 −0 modoboa/admin/views/identity.py
  61. +2 −0 modoboa/admin/views/import_.py
  62. +2 −0 modoboa/admin/views/user.py
  63. +2 −0 modoboa/core/__init__.py
  64. +3 −0 modoboa/core/app_settings.py
  65. +2 −0 modoboa/core/apps.py
  66. +7 −2 modoboa/core/commands/__init__.py
  67. +7 −2 modoboa/core/commands/deploy.py
  68. +1 −1 modoboa/core/commands/help.py
  69. +2 −0 modoboa/core/constants.py
  70. +2 −0 modoboa/core/context_processors.py
  71. +3 −0 modoboa/core/dev_settings.py
  72. +8 −1 modoboa/core/extensions.py
  73. +2 −0 modoboa/core/factories.py
  74. +2 −0 modoboa/core/forms.py
  75. +2 −0 modoboa/core/handlers.py
  76. +2 −0 modoboa/core/loggers.py
  77. +1 −0 modoboa/core/management/__init__.py
  78. +1 −0 modoboa/core/management/commands/__init__.py
  79. +1 −1 modoboa/core/management/commands/cleanlogs.py
  80. +2 −0 modoboa/core/management/commands/communicate_with_public_api.py
  81. +1 −1 modoboa/core/management/commands/generate_postfix_maps.py
  82. +2 −0 modoboa/core/management/commands/load_initial_data.py
  83. +2 −0 modoboa/core/management/commands/set_default_site.py
  84. +2 −0 modoboa/core/middleware.py
  85. +1 −0 modoboa/core/migrations/__init__.py
  86. +2 −0 modoboa/core/mocks.py
  87. +2 −0 modoboa/core/models.py
  88. +3 −0 modoboa/core/password_hashers/__init__.py
  89. +2 −0 modoboa/core/password_hashers/advanced.py
  90. +2 −0 modoboa/core/password_hashers/base.py
  91. +2 −0 modoboa/core/signals.py
  92. +1 −0 modoboa/core/templatetags/__init__.py
  93. +2 −0 modoboa/core/templatetags/core_tags.py
  94. +1 −0 modoboa/core/tests/__init__.py
  95. +1 −0 modoboa/core/tests/stupid_extension_1/__init__.py
  96. +2 −0 modoboa/core/tests/stupid_extension_1/modo_extension.py
  97. +1 −0 modoboa/core/tests/stupid_extension_2/__init__.py
  98. +3 −0 modoboa/core/tests/stupid_extension_2/modo_extension.py
  99. +2 −0 modoboa/core/tests/stupid_extension_2/urls.py
  100. +2 −0 modoboa/core/tests/stupid_extension_2/views.py
  101. +2 −0 modoboa/core/tests/test_authentication.py
  102. +2 −0 modoboa/core/tests/test_core.py
  103. +2 −1 modoboa/core/tests/test_extensions.py
  104. +2 −0 modoboa/core/tests/test_ldap.py
  105. +2 −0 modoboa/core/tests/test_views.py
  106. +2 −0 modoboa/core/urls.py
  107. +2 −0 modoboa/core/utils.py
  108. +2 −0 modoboa/core/views/__init__.py
  109. +2 −0 modoboa/core/views/admin.py
  110. +2 −0 modoboa/core/views/auth.py
  111. +2 −0 modoboa/core/views/base.py
  112. +2 −0 modoboa/core/views/dashboard.py
  113. +2 −0 modoboa/core/views/user.py
  114. +1 −0 modoboa/lib/__init__.py
  115. +2 −0 modoboa/lib/api_client.py
  116. +2 −0 modoboa/lib/authbackends.py
  117. +2 −0 modoboa/lib/connections.py
  118. +2 −0 modoboa/lib/db_utils.py
  119. +2 −0 modoboa/lib/email_utils.py
  120. +3 −0 modoboa/lib/exceptions.py
  121. +2 −0 modoboa/lib/fields.py
  122. +1 −1 modoboa/lib/imap_utf7.py
  123. +2 −0 modoboa/lib/ldap_utils.py
  124. +2 −0 modoboa/lib/listing.py
  125. +2 −0 modoboa/lib/middleware.py
  126. +1 −0 modoboa/lib/migrations/__init__.py
  127. +2 −0 modoboa/lib/paginator.py
  128. +2 −0 modoboa/lib/signals.py
  129. +1 −1 modoboa/lib/singleton.py
  130. +3 −0 modoboa/lib/sysutils.py
  131. +1 −0 modoboa/lib/templatetags/__init__.py
  132. +2 −0 modoboa/lib/templatetags/form_tags.py
  133. +2 −0 modoboa/lib/templatetags/lib_tags.py
  134. +2 −0 modoboa/lib/test_utils.py
  135. +2 −0 modoboa/lib/tests.py
  136. +2 −0 modoboa/lib/u2u_decode.py
  137. +2 −0 modoboa/lib/validators.py
  138. +2 −0 modoboa/lib/web_utils.py
  139. +2 −0 modoboa/limits/__init__.py
  140. +2 −0 modoboa/limits/app_settings.py
  141. +2 −0 modoboa/limits/apps.py
  142. +2 −0 modoboa/limits/constants.py
  143. +2 −0 modoboa/limits/forms.py
  144. +2 −0 modoboa/limits/handlers.py
  145. +3 −0 modoboa/limits/lib.py
  146. +1 −0 modoboa/limits/migrations/__init__.py
  147. +2 −0 modoboa/limits/models.py
  148. +2 −0 modoboa/limits/serializers.py
  149. +1 −0 modoboa/limits/tests/__init__.py
  150. +2 −0 modoboa/limits/tests/test_api.py
  151. +2 −0 modoboa/limits/tests/test_domain_limits.py
  152. +2 −0 modoboa/limits/tests/test_import.py
  153. +2 −0 modoboa/limits/tests/test_user_limits.py
  154. +2 −0 modoboa/limits/urls_api.py
  155. +2 −0 modoboa/limits/utils.py
  156. +2 −0 modoboa/limits/views.py
  157. +2 −0 modoboa/limits/viewsets.py
  158. +1 −0 modoboa/parameters/__init__.py
  159. +2 −0 modoboa/parameters/forms.py
  160. +2 −0 modoboa/parameters/tests.py
  161. +2 −0 modoboa/parameters/tools.py
  162. +2 −0 modoboa/relaydomains/__init__.py
  163. +2 −0 modoboa/relaydomains/app_settings.py
  164. +2 −0 modoboa/relaydomains/apps.py
  165. +2 −0 modoboa/relaydomains/constants.py
  166. +2 −0 modoboa/relaydomains/forms.py
  167. +2 −0 modoboa/relaydomains/handlers.py
  168. +2 −0 modoboa/relaydomains/lib.py
  169. +1 −0 modoboa/relaydomains/migrations/__init__.py
  170. +2 −0 modoboa/relaydomains/models.py
  171. +2 −0 modoboa/relaydomains/postfix_maps.py
  172. +2 −0 modoboa/relaydomains/tests.py
  173. +2 −0 modoboa/relaydomains/urls.py
  174. +2 −0 modoboa/relaydomains/views.py
  175. +3 −0 modoboa/test_settings.py
  176. +4 −0 modoboa/urls.py
  177. +2 −0 modoboa/urls_api.py
  178. +3 −0 test_project/manage.py
  179. +1 −0 test_project/test_project/__init__.py
  180. +2 −0 test_project/test_project/settings.py
  181. +2 −0 test_project/test_project/urls.py
  182. +2 −0 test_project/test_project/wsgi.py
View
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
from modoboa.core.commands import handle_command_line
if __name__ == "__main__":
View
@@ -0,0 +1 @@
from __future__ import unicode_literals
@@ -1 +1,3 @@
from __future__ import unicode_literals
default_app_config = "modoboa.admin.apps.AdminConfig"
View
@@ -1,5 +1,7 @@
"""Admin API."""
from __future__ import unicode_literals
from django import http
from django.contrib.contenttypes.models import ContentType
@@ -1,5 +1,7 @@
"""Modoboa admin settings."""
from __future__ import unicode_literals
import os
from django import forms
View
@@ -1,5 +1,7 @@
"""AppConfig for admin."""
from __future__ import unicode_literals
from django.apps import AppConfig
from .app_settings import load_admin_settings
@@ -1,5 +1,7 @@
"""Admin constants."""
from __future__ import unicode_literals
DNSBL_PROVIDERS = [
"aspews.ext.sorbs.net",
"b.barracudacentral.org",
@@ -1,6 +1,9 @@
"""
Fixtures factories.
"""
from __future__ import unicode_literals
import factory
from modoboa.core.factories import PermissionFactory, UserFactory
@@ -1,3 +1,5 @@
from __future__ import unicode_literals
from .domain import (
DomainFormGeneral, DomainFormOptions, DomainForm, DomainWizard
)
@@ -1,5 +1,7 @@
"""Forms related to accounts management."""
from __future__ import unicode_literals
from collections import OrderedDict
from functools import reduce
@@ -1,5 +1,7 @@
"""Forms related to aliases management."""
from __future__ import unicode_literals
from collections import OrderedDict
from django import forms
@@ -1,5 +1,7 @@
"""Forms related to domains management."""
from __future__ import unicode_literals
from functools import reduce
from django import forms
@@ -1,3 +1,5 @@
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy
@@ -1,5 +1,7 @@
"""Forms related to forwards management."""
from __future__ import unicode_literals
from django import forms
from django.core import validators
from django.utils.translation import ugettext_lazy
@@ -1,5 +1,7 @@
"""Forms related to import operations."""
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy
@@ -1,5 +1,7 @@
"""Django signal handlers for admin."""
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db.models import signals
from django.dispatch import receiver
View
@@ -2,6 +2,8 @@
"""Internal library for admin."""
from __future__ import unicode_literals
from functools import wraps
from itertools import chain
@@ -0,0 +1 @@
from __future__ import unicode_literals
@@ -0,0 +1 @@
from __future__ import unicode_literals
@@ -1,6 +1,6 @@
"""A management command to apply mailbox operations."""
from __future__ import print_function
from __future__ import unicode_literals, print_function
import logging
import os
@@ -1,5 +1,7 @@
"""Modoboa main management command."""
from __future__ import unicode_literals
from subcommand.base import SubcommandCommand
from .subcommands._mx import CheckMXRecords
@@ -0,0 +1 @@
from __future__ import unicode_literals
@@ -1,5 +1,7 @@
"""Django management command to export admin objects."""
from __future__ import unicode_literals
import csv
import sys
@@ -1,5 +1,7 @@
"""Django management command to import admin objects."""
from __future__ import unicode_literals
import csv
import os
@@ -1,6 +1,6 @@
"""Management command to check defined domains."""
from __future__ import print_function
from __future__ import print_function, unicode_literals
from datetime import timedelta
import ipaddress
@@ -1,6 +1,6 @@
"""Management command to check and fix known problems."""
from __future__ import print_function
from __future__ import print_function, unicode_literals
from django.conf import settings
from django.core.management.base import BaseCommand
@@ -0,0 +1 @@
from __future__ import unicode_literals
@@ -1,5 +1,7 @@
"""Admin models."""
from __future__ import unicode_literals
from .base import AdminObject
from .domain import Domain, MXRecord, DNSBLResult
from .domain_alias import DomainAlias
@@ -1,5 +1,7 @@
"""Models related to aliases management."""
from __future__ import unicode_literals
import hashlib
import random
@@ -1,5 +1,7 @@
"""Base admin models."""
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
@@ -1,5 +1,7 @@
"""Models related to domains management."""
from __future__ import unicode_literals
import datetime
from functools import reduce
@@ -1,5 +1,7 @@
"""Models related to domain aliases management."""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible, smart_text
from django.utils.translation import ugettext as _, ugettext_lazy
@@ -1,5 +1,7 @@
"""Models related to mailboxes management."""
from __future__ import unicode_literals
import os
import pwd
@@ -1,5 +1,7 @@
"""Map file definitions for postfix."""
from __future__ import unicode_literals
class DomainsMap(object):
@@ -1,5 +1,7 @@
"""Admin serializers."""
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext as _, ugettext_lazy
View
@@ -1,5 +1,7 @@
"""Modoboa admin signals."""
from __future__ import unicode_literals
import django.dispatch
check_extra_account_form = django.dispatch.Signal(
@@ -0,0 +1 @@
from __future__ import unicode_literals
@@ -1,5 +1,7 @@
"""Admin extension tags."""
from __future__ import unicode_literals
from functools import reduce
from django import template
@@ -0,0 +1 @@
from __future__ import unicode_literals
@@ -1,5 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
from unittest import skipIf
from django.core.urlresolvers import reverse
@@ -1,5 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
"""Admin test cases."""
from django.core.urlresolvers import reverse
@@ -1,6 +1,8 @@
# coding: utf-8
"""Admin API related tests."""
from __future__ import unicode_literals
import copy
import json
@@ -1,5 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
"""Domain related test cases."""
import json
@@ -1,5 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from modoboa.lib.tests import ModoTestCase
@@ -1,5 +1,7 @@
"""Export related test cases."""
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from modoboa.lib.tests import ModoTestCase
@@ -1,4 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
from django.core.files.base import ContentFile
from django.core.urlresolvers import reverse
@@ -1,5 +1,7 @@
"""Management command tests."""
from __future__ import unicode_literals
import os
import shutil
import tempfile
@@ -1,5 +1,7 @@
"""Test map files generation."""
from __future__ import unicode_literals
import os
from django.conf import settings
@@ -1,5 +1,7 @@
"""DNSBL related tests."""
from __future__ import unicode_literals
from django.core import management
from django.core.urlresolvers import reverse
from django.test import override_settings
@@ -1,3 +1,5 @@
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from modoboa.core.models import User
@@ -1,4 +1,7 @@
"""Repair command tests"""
from __future__ import unicode_literals
from django.core import management
from modoboa.lib.permissions import get_object_owner
@@ -1,5 +1,7 @@
"""User related tests."""
from __future__ import unicode_literals
import json
from django.core.urlresolvers import reverse
View
@@ -1,6 +1,8 @@
# pylint: disable=invalid-name, protected-access
"""Admin urls."""
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
@@ -1,5 +1,7 @@
"""Admin API urls."""
from __future__ import unicode_literals
from rest_framework import routers
from . import api
@@ -1,5 +1,7 @@
"""Shortcuts."""
from __future__ import unicode_literals
from .alias import AliasDetailView
from .identity import AccountDetailView
from .dns import DNSBLDomainDetailView, MXDomainDetailView
Oops, something went wrong.

0 comments on commit 615f73f

Please sign in to comment.