Skip to content

Commit

Permalink
Removed __future__ imports
Browse files Browse the repository at this point in the history
Also delete add_imports directive from isort configuration
  • Loading branch information
atombrella authored and gasman committed Nov 27, 2017
1 parent cde0faf commit 8b420b9
Show file tree
Hide file tree
Showing 549 changed files with 3 additions and 1,100 deletions.
2 changes: 0 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import os
import shutil
import warnings
Expand Down
2 changes: 0 additions & 2 deletions docs/getting_started/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ Edit ``home/models.py`` as follows, to add a ``body`` field to the model:

.. code-block:: python
from __future__ import unicode_literals
from django.db import models
from wagtail.core.models import Page
Expand Down
4 changes: 0 additions & 4 deletions docs/topics/streamfield.rst
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,6 @@ If you change an existing RichTextField to a StreamField, and create and run mig
.. code-block:: python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from wagtail.core.rich_text import RichText
Expand Down Expand Up @@ -931,8 +929,6 @@ Note that the above migration will work on published Page objects only. If you a
.. code-block:: python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.core.serializers.json import DjangoJSONEncoder
Expand Down
2 changes: 0 additions & 2 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from __future__ import absolute_import, unicode_literals

import argparse
import os
import shutil
Expand Down
1 change: 0 additions & 1 deletion scripts/get-translator-credits.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import subprocess
import re
from collections import defaultdict
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ max-line-length = 120
line_length=100
multi_line_output=4
skip=migrations,project_template
add_imports=from __future__ import absolute_import,from __future__ import unicode_literals
known_first_party=wagtail
known_third_party=willow,modelcluster,taggit,django,unidecode,bs4,pytz,PIL

Expand Down
2 changes: 0 additions & 2 deletions wagtail/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from wagtail.utils.version import get_semver_version, get_version

# major.minor.patch.release.number
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/api/endpoints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from collections import OrderedDict

from wagtail.api.v2.endpoints import PagesAPIEndpoint
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/api/filters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from rest_framework.filters import BaseFilterBackend

from wagtail.api.v2.utils import BadRequestError, parse_boolean
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/api/serializers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from collections import OrderedDict

from rest_framework.fields import Field, ReadOnlyField
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.conf.urls import url

from wagtail.api.v2.router import WagtailAPIRouter
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.apps import AppConfig

from . import checks # NOQA
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/blocks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import warnings

from wagtail.core.blocks import * # noqa
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/checks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import os

from django.core.checks import Error, Warning, register
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/compare.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import difflib

from bs4 import BeautifulSoup
Expand Down
5 changes: 2 additions & 3 deletions wagtail/admin/datetimepicker.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from __future__ import absolute_import, unicode_literals


# Adapted from https://djangosnippets.org/snippets/10563/
# original author bernd-wechner


def to_datetimepicker_format(python_format_string):
"""
Given a python datetime format string, attempts to convert it to
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/decorators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib.auth.views import redirect_to_login as auth_redirect_to_login
from django.core.exceptions import PermissionDenied
from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/edit_handlers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import math
import re

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import copy
from itertools import groupby

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/jinja2tags.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import jinja2
from jinja2.ext import Extension

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/menu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib.staticfiles.templatetags.staticfiles import static
from django.forms import Media, MediaDefiningClass
from django.forms.utils import flatatt
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/messages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib import messages
from django.core.exceptions import NON_FIELD_ERRORS
from django.template.loader import render_to_string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations


Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/modal_workflow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import json

from django.http import HttpResponse
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

# The edit_handlers module extends Page with some additional attributes required by
# wagtailadmin (namely, base_form_class and get_edit_handler). Importing this within
# wagtailadmin.models ensures that this happens in advance of running wagtailadmin's
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/navigation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from wagtail.core.models import Page


Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/rich_text.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import json
from collections import OrderedDict

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/search.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.forms import Media, MediaDefiningClass
from django.forms.utils import flatatt
from django.template.loader import render_to_string
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/signals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.dispatch import Signal

init_new_page = Signal(providing_args=['page', 'parent'])
2 changes: 0 additions & 2 deletions wagtail/admin/site_summary.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.template.loader import render_to_string

from wagtail.admin.utils import user_has_any_page_permission
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/templatetags/gravatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# <img src="{% gravatar_url sometemplatevariable %}">
# just make sure to update the "default" image path below

from __future__ import absolute_import, unicode_literals

import hashlib
from urllib.parse import urlencode

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/templatetags/wagtailadmin_tags.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import itertools

from django import template
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/templatetags/wagtailuserbar.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django import template
from django.template.loader import render_to_string

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/api/test_documents.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import json

from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/api/test_images.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import json

from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/api/test_pages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import collections
import datetime
import json
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/api/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.test import TestCase

from wagtail.tests.utils import WagtailTestUtils
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_account_management.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.contrib.auth.tokens import PasswordResetTokenGenerator
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_admin_search.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Tests for the search box in the admin side menu, and the custom search hooks.
"""
from __future__ import absolute_import, unicode_literals

from django.contrib.auth.models import Permission
from django.template import Context, Template
from django.test import RequestFactory, TestCase
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_buttons_hooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.test import TestCase
from django.urls import reverse

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_collections_views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.test import TestCase
from django.urls import reverse

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_compare.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import unittest

from django.test import TestCase
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_edit_handlers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from datetime import date

import mock
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_jinja2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.template import engines
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_messages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib import messages
from django.test import TestCase, override_settings
from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_navigation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals

from django.contrib.auth import get_user_model
from django.test import TestCase

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_page_chooser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_pages_views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import datetime
import logging
import os
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_password_reset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.core import mail
from django.test import TestCase, override_settings
from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_privacy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib.auth.models import Group
from django.test import TestCase
from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_rich_text.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_userbar.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.template import Context, Template
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/test_widgets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.test import TestCase
from django.test.utils import override_settings

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals

import json

from django.contrib.auth import get_user_model
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/urls/collections.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.conf.urls import url

from wagtail.admin.views import collection_privacy, collections
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/urls/pages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.conf.urls import url

from wagtail.admin.views import page_privacy, pages
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/urls/password_reset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.conf.urls import url

from wagtail.admin.forms import PasswordResetForm
Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/userbar.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from django.template.loader import render_to_string


Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import logging
from functools import wraps

Expand Down
2 changes: 0 additions & 2 deletions wagtail/admin/views/account.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

from functools import wraps

from django.conf import settings
Expand Down
Loading

0 comments on commit 8b420b9

Please sign in to comment.