From 889222cb9908e38db304e99d2436487a2033571d Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Sat, 17 Feb 2018 10:45:24 +0100 Subject: [PATCH] Don't import from __future__. --- src/wiki/__init__.py | 1 - src/wiki/admin.py | 2 -- src/wiki/apps.py | 2 -- src/wiki/conf/settings.py | 2 -- src/wiki/core/compat.py | 11 +---------- src/wiki/core/diff.py | 2 -- src/wiki/core/http.py | 2 -- src/wiki/core/markdown/__init__.py | 2 -- src/wiki/core/markdown/mdx/codehilite.py | 2 -- src/wiki/core/markdown/mdx/previewlinks.py | 2 -- src/wiki/core/markdown/mdx/responsivetable.py | 2 -- src/wiki/core/permissions.py | 2 -- src/wiki/core/plugins/base.py | 2 -- src/wiki/core/plugins/loader.py | 2 -- src/wiki/core/plugins/registry.py | 2 -- src/wiki/core/utils.py | 2 -- src/wiki/core/version.py | 2 -- src/wiki/decorators.py | 2 -- src/wiki/editors/__init__.py | 1 - src/wiki/editors/base.py | 2 -- src/wiki/editors/markitup.py | 2 -- src/wiki/forms.py | 2 -- src/wiki/managers.py | 2 -- src/wiki/migrations/0001_initial.py | 2 -- src/wiki/migrations/0002_urlpath_moved_to.py | 2 -- src/wiki/models/__init__.py | 3 --- src/wiki/models/article.py | 2 -- src/wiki/models/pluginbase.py | 2 -- src/wiki/models/urlpath.py | 2 -- src/wiki/plugins/attachments/__init__.py | 2 -- src/wiki/plugins/attachments/admin.py | 2 -- src/wiki/plugins/attachments/apps.py | 2 -- src/wiki/plugins/attachments/forms.py | 2 -- .../plugins/attachments/markdown_extensions.py | 2 -- .../attachments/migrations/0001_initial.py | 2 -- .../migrations/0002_auto_20151118_1816.py | 2 -- src/wiki/plugins/attachments/models.py | 2 -- src/wiki/plugins/attachments/settings.py | 2 -- src/wiki/plugins/attachments/urls.py | 2 -- src/wiki/plugins/attachments/views.py | 2 -- src/wiki/plugins/attachments/wiki_plugin.py | 2 -- src/wiki/plugins/globalhistory/__init__.py | 2 -- src/wiki/plugins/globalhistory/apps.py | 2 -- src/wiki/plugins/globalhistory/settings.py | 2 -- src/wiki/plugins/globalhistory/views.py | 2 -- src/wiki/plugins/globalhistory/wiki_plugin.py | 2 -- src/wiki/plugins/haystack/__init__.py | 17 +++-------------- src/wiki/plugins/haystack/search_indexes.py | 2 -- src/wiki/plugins/haystack/views.py | 2 -- src/wiki/plugins/help/__init__.py | 2 -- src/wiki/plugins/help/apps.py | 2 -- src/wiki/plugins/help/models.py | 1 - src/wiki/plugins/help/wiki_plugin.py | 2 -- src/wiki/plugins/images/__init__.py | 2 -- src/wiki/plugins/images/admin.py | 2 -- src/wiki/plugins/images/apps.py | 2 -- src/wiki/plugins/images/forms.py | 2 -- src/wiki/plugins/images/markdown_extensions.py | 2 -- .../plugins/images/migrations/0001_initial.py | 2 -- .../migrations/0002_auto_20151118_1811.py | 2 -- src/wiki/plugins/images/models.py | 2 -- src/wiki/plugins/images/settings.py | 2 -- .../images/templatetags/wiki_images_tags.py | 2 -- .../images/templatetags/wiki_thumbnails.py | 1 - src/wiki/plugins/images/views.py | 2 -- src/wiki/plugins/images/wiki_plugin.py | 2 -- src/wiki/plugins/links/__init__.py | 2 -- src/wiki/plugins/links/apps.py | 2 -- src/wiki/plugins/links/mdx/djangowikilinks.py | 6 ++---- src/wiki/plugins/links/mdx/urlize.py | 2 -- src/wiki/plugins/links/settings.py | 2 -- src/wiki/plugins/links/views.py | 2 -- src/wiki/plugins/links/wiki_plugin.py | 2 -- src/wiki/plugins/macros/__init__.py | 2 -- src/wiki/plugins/macros/apps.py | 2 -- src/wiki/plugins/macros/mdx/macro.py | 2 -- src/wiki/plugins/macros/mdx/toc.py | 2 -- src/wiki/plugins/macros/mdx/wikilinks.py | 2 -- src/wiki/plugins/macros/settings.py | 2 -- .../macros/templatetags/wiki_macro_tags.py | 2 -- src/wiki/plugins/macros/wiki_plugin.py | 2 -- src/wiki/plugins/notifications/__init__.py | 2 -- src/wiki/plugins/notifications/apps.py | 2 -- src/wiki/plugins/notifications/forms.py | 2 -- .../wiki_notifications_create_defaults.py | 2 -- .../notifications/migrations/0001_initial.py | 2 -- .../migrations/0002_auto_20151118_1811.py | 2 -- src/wiki/plugins/notifications/models.py | 2 -- src/wiki/plugins/notifications/settings.py | 2 -- src/wiki/plugins/notifications/util.py | 2 -- src/wiki/plugins/notifications/views.py | 2 -- src/wiki/plugins/notifications/wiki_plugin.py | 2 -- src/wiki/templatetags/wiki_tags.py | 2 -- src/wiki/urls.py | 2 -- src/wiki/views/accounts.py | 2 -- src/wiki/views/article.py | 2 -- src/wiki/views/mixins.py | 2 -- 97 files changed, 6 insertions(+), 213 deletions(-) diff --git a/src/wiki/__init__.py b/src/wiki/__init__.py index d5bfa961..a71dfbf1 100644 --- a/src/wiki/__init__.py +++ b/src/wiki/__init__.py @@ -1,4 +1,3 @@ -from __future__ import unicode_literals # -*- coding: utf-8 -*- # This package and all its sub-packages are part of django-wiki, # except where otherwise stated. diff --git a/src/wiki/admin.py b/src/wiki/admin.py index e9d44008..cee01512 100644 --- a/src/wiki/admin.py +++ b/src/wiki/admin.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django import forms from django.contrib import admin from django.contrib.contenttypes.admin import GenericTabularInline diff --git a/src/wiki/apps.py b/src/wiki/apps.py index 953125d0..7f449548 100644 --- a/src/wiki/apps.py +++ b/src/wiki/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/conf/settings.py b/src/wiki/conf/settings.py index 43835eea..60bc1326 100644 --- a/src/wiki/conf/settings.py +++ b/src/wiki/conf/settings.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import bleach from django.apps import apps diff --git a/src/wiki/core/compat.py b/src/wiki/core/compat.py index 58bc76fe..0d653cee 100644 --- a/src/wiki/core/compat.py +++ b/src/wiki/core/compat.py @@ -1,8 +1,7 @@ """Abstraction layer to deal with Django related changes in order to keep compatibility with several Django versions simultaneously.""" -from __future__ import unicode_literals - from django.conf import settings as django_settings +from urllib.parse import urljoin # noqa USER_MODEL = getattr(django_settings, 'AUTH_USER_MODEL', 'auth.User') @@ -21,11 +20,3 @@ class BuildAttrsCompat(object): if kwargs is not None: attrs.update(kwargs) return attrs - - -try: - # Python 3 - from urllib.parse import urljoin # noqa -except ImportError: - # Python 2 - from urlparse import urljoin # noqa @UnusedImport diff --git a/src/wiki/core/diff.py b/src/wiki/core/diff.py index 45412768..4279972b 100644 --- a/src/wiki/core/diff.py +++ b/src/wiki/core/diff.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import difflib diff --git a/src/wiki/core/http.py b/src/wiki/core/http.py index fb77552c..2357a3e2 100644 --- a/src/wiki/core/http.py +++ b/src/wiki/core/http.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import mimetypes import os from datetime import datetime diff --git a/src/wiki/core/markdown/__init__.py b/src/wiki/core/markdown/__init__.py index d9899b1a..df163633 100644 --- a/src/wiki/core/markdown/__init__.py +++ b/src/wiki/core/markdown/__init__.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import bleach import markdown diff --git a/src/wiki/core/markdown/mdx/codehilite.py b/src/wiki/core/markdown/mdx/codehilite.py index a4b35dee..674b08ed 100644 --- a/src/wiki/core/markdown/mdx/codehilite.py +++ b/src/wiki/core/markdown/mdx/codehilite.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import logging import re diff --git a/src/wiki/core/markdown/mdx/previewlinks.py b/src/wiki/core/markdown/mdx/previewlinks.py index 46cfb079..242bf8d5 100644 --- a/src/wiki/core/markdown/mdx/previewlinks.py +++ b/src/wiki/core/markdown/mdx/previewlinks.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import markdown from markdown.treeprocessors import Treeprocessor diff --git a/src/wiki/core/markdown/mdx/responsivetable.py b/src/wiki/core/markdown/mdx/responsivetable.py index 315ef1bd..25d68be0 100644 --- a/src/wiki/core/markdown/mdx/responsivetable.py +++ b/src/wiki/core/markdown/mdx/responsivetable.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import markdown from markdown.treeprocessors import Treeprocessor from markdown.util import etree diff --git a/src/wiki/core/permissions.py b/src/wiki/core/permissions.py index 70240cd5..26020810 100644 --- a/src/wiki/core/permissions.py +++ b/src/wiki/core/permissions.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from wiki.conf import settings diff --git a/src/wiki/core/plugins/base.py b/src/wiki/core/plugins/base.py index 3c28e774..72c553b7 100644 --- a/src/wiki/core/plugins/base.py +++ b/src/wiki/core/plugins/base.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django import forms from django.utils.translation import ugettext as _ diff --git a/src/wiki/core/plugins/loader.py b/src/wiki/core/plugins/loader.py index b7139ef4..2cd1e5bf 100644 --- a/src/wiki/core/plugins/loader.py +++ b/src/wiki/core/plugins/loader.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals - from django.utils.module_loading import autodiscover_modules diff --git a/src/wiki/core/plugins/registry.py b/src/wiki/core/plugins/registry.py index cc26d374..f018fd37 100644 --- a/src/wiki/core/plugins/registry.py +++ b/src/wiki/core/plugins/registry.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from importlib import import_module from django.utils.six import string_types diff --git a/src/wiki/core/utils.py b/src/wiki/core/utils.py index 26b617d4..6af8ca84 100644 --- a/src/wiki/core/utils.py +++ b/src/wiki/core/utils.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from importlib import import_module from django.http.response import JsonResponse diff --git a/src/wiki/core/version.py b/src/wiki/core/version.py index 19e10afe..f6a0d50b 100644 --- a/src/wiki/core/version.py +++ b/src/wiki/core/version.py @@ -30,8 +30,6 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -from __future__ import unicode_literals - import datetime import os import subprocess diff --git a/src/wiki/decorators.py b/src/wiki/decorators.py index 8398e90f..e932536a 100644 --- a/src/wiki/decorators.py +++ b/src/wiki/decorators.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from functools import wraps from django.core.urlresolvers import reverse diff --git a/src/wiki/editors/__init__.py b/src/wiki/editors/__init__.py index 926c100f..42480ef2 100644 --- a/src/wiki/editors/__init__.py +++ b/src/wiki/editors/__init__.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import from wiki.conf import settings from django.core.urlresolvers import get_callable diff --git a/src/wiki/editors/base.py b/src/wiki/editors/base.py index 1523433d..5676b975 100644 --- a/src/wiki/editors/base.py +++ b/src/wiki/editors/base.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django import forms diff --git a/src/wiki/editors/markitup.py b/src/wiki/editors/markitup.py index 15b23486..1b7d3c2f 100644 --- a/src/wiki/editors/markitup.py +++ b/src/wiki/editors/markitup.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -from __future__ import unicode_literals - from django import forms from django.forms.utils import flatatt from django.utils.encoding import force_text diff --git a/src/wiki/forms.py b/src/wiki/forms.py index e9b02f7b..b73adfb5 100644 --- a/src/wiki/forms.py +++ b/src/wiki/forms.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import random import string from datetime import timedelta diff --git a/src/wiki/managers.py b/src/wiki/managers.py index 74d40915..006274b7 100644 --- a/src/wiki/managers.py +++ b/src/wiki/managers.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.db import models from django.db.models import Q, Count from django.db.models.query import EmptyQuerySet, QuerySet diff --git a/src/wiki/migrations/0001_initial.py b/src/wiki/migrations/0001_initial.py index a2490791..12d6d44f 100644 --- a/src/wiki/migrations/0001_initial.py +++ b/src/wiki/migrations/0001_initial.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import django.db.models.deletion import mptt.fields from django.conf import settings diff --git a/src/wiki/migrations/0002_urlpath_moved_to.py b/src/wiki/migrations/0002_urlpath_moved_to.py index f8a13c3d..d7c32b50 100644 --- a/src/wiki/migrations/0002_urlpath_moved_to.py +++ b/src/wiki/migrations/0002_urlpath_moved_to.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-06-06 23:18 -from __future__ import unicode_literals - import django.db.models.deletion import mptt.fields from django.db import migrations diff --git a/src/wiki/models/__init__.py b/src/wiki/models/__init__.py index 6cd41c43..8e2e362f 100644 --- a/src/wiki/models/__init__.py +++ b/src/wiki/models/__init__.py @@ -1,7 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals - from django.apps import apps from django.conf import settings as django_settings from django.core.exceptions import ImproperlyConfigured diff --git a/src/wiki/models/article.py b/src/wiki/models/article.py index 751bcb29..56b9b597 100644 --- a/src/wiki/models/article.py +++ b/src/wiki/models/article.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.core.cache import cache diff --git a/src/wiki/models/pluginbase.py b/src/wiki/models/pluginbase.py index 1f9b43d3..4c23b8f8 100644 --- a/src/wiki/models/pluginbase.py +++ b/src/wiki/models/pluginbase.py @@ -19,8 +19,6 @@ There are three kinds of plugin base models: """ -from __future__ import unicode_literals - from django.db import models from django.db.models import signals from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/models/urlpath.py b/src/wiki/models/urlpath.py index b467505b..eb01ab51 100644 --- a/src/wiki/models/urlpath.py +++ b/src/wiki/models/urlpath.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals - import logging import warnings diff --git a/src/wiki/plugins/attachments/__init__.py b/src/wiki/plugins/attachments/__init__.py index 6731264d..c747810e 100644 --- a/src/wiki/plugins/attachments/__init__.py +++ b/src/wiki/plugins/attachments/__init__.py @@ -1,3 +1 @@ -from __future__ import unicode_literals - default_app_config = 'wiki.plugins.attachments.apps.AttachmentsConfig' diff --git a/src/wiki/plugins/attachments/admin.py b/src/wiki/plugins/attachments/admin.py index 5d3c8043..45c697c4 100644 --- a/src/wiki/plugins/attachments/admin.py +++ b/src/wiki/plugins/attachments/admin.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.contrib import admin from . import models diff --git a/src/wiki/plugins/attachments/apps.py b/src/wiki/plugins/attachments/apps.py index 70265a6c..128bf3db 100644 --- a/src/wiki/plugins/attachments/apps.py +++ b/src/wiki/plugins/attachments/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/plugins/attachments/forms.py b/src/wiki/plugins/attachments/forms.py index 24ed2245..dbe6ac59 100644 --- a/src/wiki/plugins/attachments/forms.py +++ b/src/wiki/plugins/attachments/forms.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import tempfile import zipfile diff --git a/src/wiki/plugins/attachments/markdown_extensions.py b/src/wiki/plugins/attachments/markdown_extensions.py index 73b2d632..55839b77 100644 --- a/src/wiki/plugins/attachments/markdown_extensions.py +++ b/src/wiki/plugins/attachments/markdown_extensions.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import re import markdown diff --git a/src/wiki/plugins/attachments/migrations/0001_initial.py b/src/wiki/plugins/attachments/migrations/0001_initial.py index 482fbb0f..38f588f2 100644 --- a/src/wiki/plugins/attachments/migrations/0001_initial.py +++ b/src/wiki/plugins/attachments/migrations/0001_initial.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import django.db.models.deletion from django.conf import settings from django.db import migrations, models diff --git a/src/wiki/plugins/attachments/migrations/0002_auto_20151118_1816.py b/src/wiki/plugins/attachments/migrations/0002_auto_20151118_1816.py index 64492484..5cc37fd1 100644 --- a/src/wiki/plugins/attachments/migrations/0002_auto_20151118_1816.py +++ b/src/wiki/plugins/attachments/migrations/0002_auto_20151118_1816.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.db import migrations, models diff --git a/src/wiki/plugins/attachments/models.py b/src/wiki/plugins/attachments/models.py index 1e9ba46a..59cc55fc 100644 --- a/src/wiki/plugins/attachments/models.py +++ b/src/wiki/plugins/attachments/models.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals - import os from django.conf import settings as django_settings diff --git a/src/wiki/plugins/attachments/settings.py b/src/wiki/plugins/attachments/settings.py index 61bc3eaf..167e716d 100644 --- a/src/wiki/plugins/attachments/settings.py +++ b/src/wiki/plugins/attachments/settings.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf import settings as django_settings from django.core.exceptions import ImproperlyConfigured from wiki.conf import settings as wiki_settings diff --git a/src/wiki/plugins/attachments/urls.py b/src/wiki/plugins/attachments/urls.py index d603979a..53a90fad 100644 --- a/src/wiki/plugins/attachments/urls.py +++ b/src/wiki/plugins/attachments/urls.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf.urls import url from wiki.plugins.attachments import views diff --git a/src/wiki/plugins/attachments/views.py b/src/wiki/plugins/attachments/views.py index bb8b412b..e22cb830 100644 --- a/src/wiki/plugins/attachments/views.py +++ b/src/wiki/plugins/attachments/views.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.contrib import messages from django.core.exceptions import ObjectDoesNotExist from django.db.models import Q diff --git a/src/wiki/plugins/attachments/wiki_plugin.py b/src/wiki/plugins/attachments/wiki_plugin.py index 35c062b9..fde4b58f 100644 --- a/src/wiki/plugins/attachments/wiki_plugin.py +++ b/src/wiki/plugins/attachments/wiki_plugin.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.conf.urls import include, url from django.utils.translation import ugettext as _ from wiki.core.plugins import registry diff --git a/src/wiki/plugins/globalhistory/__init__.py b/src/wiki/plugins/globalhistory/__init__.py index c6ae4504..6b44e7fd 100644 --- a/src/wiki/plugins/globalhistory/__init__.py +++ b/src/wiki/plugins/globalhistory/__init__.py @@ -1,3 +1 @@ -from __future__ import unicode_literals - default_app_config = 'wiki.plugins.globalhistory.apps.GlobalHistoryConfig' diff --git a/src/wiki/plugins/globalhistory/apps.py b/src/wiki/plugins/globalhistory/apps.py index a3aa5336..61cc2d8a 100644 --- a/src/wiki/plugins/globalhistory/apps.py +++ b/src/wiki/plugins/globalhistory/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/plugins/globalhistory/settings.py b/src/wiki/plugins/globalhistory/settings.py index 692de10e..6cbabf35 100644 --- a/src/wiki/plugins/globalhistory/settings.py +++ b/src/wiki/plugins/globalhistory/settings.py @@ -1,3 +1 @@ -from __future__ import unicode_literals - SLUG = 'globalhistory' diff --git a/src/wiki/plugins/globalhistory/views.py b/src/wiki/plugins/globalhistory/views.py index 516af3ac..c853f107 100644 --- a/src/wiki/plugins/globalhistory/views.py +++ b/src/wiki/plugins/globalhistory/views.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.contrib.auth.decorators import login_required from django.db.models import F from django.utils.decorators import method_decorator diff --git a/src/wiki/plugins/globalhistory/wiki_plugin.py b/src/wiki/plugins/globalhistory/wiki_plugin.py index 935e0d1e..9e1ff2f2 100644 --- a/src/wiki/plugins/globalhistory/wiki_plugin.py +++ b/src/wiki/plugins/globalhistory/wiki_plugin.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf.urls import url from wiki.core.plugins import registry from wiki.core.plugins.base import BasePlugin diff --git a/src/wiki/plugins/haystack/__init__.py b/src/wiki/plugins/haystack/__init__.py index 8ef347dc..9fc6a98a 100644 --- a/src/wiki/plugins/haystack/__init__.py +++ b/src/wiki/plugins/haystack/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals from wiki.conf import settings from wiki.core import permissions from wiki import models @@ -19,22 +17,13 @@ class SearchViewHaystack(haystack_views.SearchView): @classonlymethod def as_view(cls, *args, **kwargs): - return haystack_views.search_view_factory( - view_class=cls, - * - args, - **kwargs) + return haystack_views.search_view_factory(view_class=cls, *args, **kwargs) def dispatch(self, request, *args, **kwargs): # Do not allow anonymous users to search if they cannot read content if request.user.is_anonymous() and not settings.ANONYMOUS: return redirect(settings.LOGIN_URL) - return super( - SearchViewHaystack, - self).dispatch( - request, - *args, - **kwargs) + return super().dispatch(request, *args, **kwargs) def __filter_can_read(self, user): """Filter objects so only the ones with a user's reading access @@ -68,6 +57,6 @@ class SearchViewHaystack(haystack_views.SearchView): return self.create_response() def extra_context(self): - extra = super(SearchViewHaystack, self).extra_context() + extra = super().extra_context() extra['search_query'] = self.query return extra diff --git a/src/wiki/plugins/haystack/search_indexes.py b/src/wiki/plugins/haystack/search_indexes.py index fc65d20e..085cedc9 100644 --- a/src/wiki/plugins/haystack/search_indexes.py +++ b/src/wiki/plugins/haystack/search_indexes.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from haystack import indexes from wiki import models diff --git a/src/wiki/plugins/haystack/views.py b/src/wiki/plugins/haystack/views.py index c7a08572..f23a4cc7 100644 --- a/src/wiki/plugins/haystack/views.py +++ b/src/wiki/plugins/haystack/views.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from haystack.backends import SQ from haystack.inputs import AutoQuery from haystack.query import SearchQuerySet diff --git a/src/wiki/plugins/help/__init__.py b/src/wiki/plugins/help/__init__.py index c73f5918..be534e3a 100644 --- a/src/wiki/plugins/help/__init__.py +++ b/src/wiki/plugins/help/__init__.py @@ -1,3 +1 @@ -from __future__ import unicode_literals - default_app_config = 'wiki.plugins.help.apps.HelpConfig' diff --git a/src/wiki/plugins/help/apps.py b/src/wiki/plugins/help/apps.py index f0584bb4..8877821a 100644 --- a/src/wiki/plugins/help/apps.py +++ b/src/wiki/plugins/help/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/plugins/help/models.py b/src/wiki/plugins/help/models.py index c3961685..e69de29b 100644 --- a/src/wiki/plugins/help/models.py +++ b/src/wiki/plugins/help/models.py @@ -1 +0,0 @@ -from __future__ import absolute_import diff --git a/src/wiki/plugins/help/wiki_plugin.py b/src/wiki/plugins/help/wiki_plugin.py index 7d31704e..c619bb38 100644 --- a/src/wiki/plugins/help/wiki_plugin.py +++ b/src/wiki/plugins/help/wiki_plugin.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.utils.translation import ugettext as _ from wiki.core.plugins import registry from wiki.core.plugins.base import BasePlugin diff --git a/src/wiki/plugins/images/__init__.py b/src/wiki/plugins/images/__init__.py index 7b0eebc9..767b8968 100644 --- a/src/wiki/plugins/images/__init__.py +++ b/src/wiki/plugins/images/__init__.py @@ -1,3 +1 @@ -from __future__ import unicode_literals - default_app_config = 'wiki.plugins.images.apps.ImagesConfig' diff --git a/src/wiki/plugins/images/admin.py b/src/wiki/plugins/images/admin.py index bf5e99ec..4ee3d9cf 100644 --- a/src/wiki/plugins/images/admin.py +++ b/src/wiki/plugins/images/admin.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django import forms from django.contrib import admin diff --git a/src/wiki/plugins/images/apps.py b/src/wiki/plugins/images/apps.py index afc67db8..5dedc28d 100644 --- a/src/wiki/plugins/images/apps.py +++ b/src/wiki/plugins/images/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/plugins/images/forms.py b/src/wiki/plugins/images/forms.py index be9ae47d..59a67552 100644 --- a/src/wiki/plugins/images/forms.py +++ b/src/wiki/plugins/images/forms.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django import forms from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext diff --git a/src/wiki/plugins/images/markdown_extensions.py b/src/wiki/plugins/images/markdown_extensions.py index 9f69ca77..19dd5866 100644 --- a/src/wiki/plugins/images/markdown_extensions.py +++ b/src/wiki/plugins/images/markdown_extensions.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import re import markdown diff --git a/src/wiki/plugins/images/migrations/0001_initial.py b/src/wiki/plugins/images/migrations/0001_initial.py index 746a9850..092756ec 100644 --- a/src/wiki/plugins/images/migrations/0001_initial.py +++ b/src/wiki/plugins/images/migrations/0001_initial.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import wiki.plugins.images.models from django.db import migrations, models diff --git a/src/wiki/plugins/images/migrations/0002_auto_20151118_1811.py b/src/wiki/plugins/images/migrations/0002_auto_20151118_1811.py index 27ddcc91..56dfdb76 100644 --- a/src/wiki/plugins/images/migrations/0002_auto_20151118_1811.py +++ b/src/wiki/plugins/images/migrations/0002_auto_20151118_1811.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.db import migrations, models diff --git a/src/wiki/plugins/images/models.py b/src/wiki/plugins/images/models.py index 7446c577..63218ecb 100644 --- a/src/wiki/plugins/images/models.py +++ b/src/wiki/plugins/images/models.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import os.path from django.apps import apps diff --git a/src/wiki/plugins/images/settings.py b/src/wiki/plugins/images/settings.py index 954b98ef..17177e92 100644 --- a/src/wiki/plugins/images/settings.py +++ b/src/wiki/plugins/images/settings.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf import settings as django_settings from wiki.conf import settings as wiki_settings diff --git a/src/wiki/plugins/images/templatetags/wiki_images_tags.py b/src/wiki/plugins/images/templatetags/wiki_images_tags.py index 71e20c3a..810da730 100644 --- a/src/wiki/plugins/images/templatetags/wiki_images_tags.py +++ b/src/wiki/plugins/images/templatetags/wiki_images_tags.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django import template from wiki.plugins.images import models, settings diff --git a/src/wiki/plugins/images/templatetags/wiki_thumbnails.py b/src/wiki/plugins/images/templatetags/wiki_thumbnails.py index db8d6958..536d5856 100644 --- a/src/wiki/plugins/images/templatetags/wiki_thumbnails.py +++ b/src/wiki/plugins/images/templatetags/wiki_thumbnails.py @@ -1,2 +1 @@ -from __future__ import absolute_import from sorl.thumbnail.templatetags.thumbnail import register # NOQA diff --git a/src/wiki/plugins/images/views.py b/src/wiki/plugins/images/views.py index 58396b38..1ff06723 100644 --- a/src/wiki/plugins/images/views.py +++ b/src/wiki/plugins/images/views.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import logging from django.contrib import messages diff --git a/src/wiki/plugins/images/wiki_plugin.py b/src/wiki/plugins/images/wiki_plugin.py index dec4d08a..cc03946e 100644 --- a/src/wiki/plugins/images/wiki_plugin.py +++ b/src/wiki/plugins/images/wiki_plugin.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.conf.urls import url from django.utils.translation import ugettext as _ from wiki.core.plugins import registry diff --git a/src/wiki/plugins/links/__init__.py b/src/wiki/plugins/links/__init__.py index fd030dbf..4bb78d59 100644 --- a/src/wiki/plugins/links/__init__.py +++ b/src/wiki/plugins/links/__init__.py @@ -1,3 +1 @@ -from __future__ import unicode_literals - default_app_config = 'wiki.plugins.links.apps.LinksConfig' diff --git a/src/wiki/plugins/links/apps.py b/src/wiki/plugins/links/apps.py index 2fd6cc38..3a9fa7b2 100644 --- a/src/wiki/plugins/links/apps.py +++ b/src/wiki/plugins/links/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/plugins/links/mdx/djangowikilinks.py b/src/wiki/plugins/links/mdx/djangowikilinks.py index 2cab02c5..819a8bbf 100755 --- a/src/wiki/plugins/links/mdx/djangowikilinks.py +++ b/src/wiki/plugins/links/mdx/djangowikilinks.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -''' +""" Wikipath Extension for Python-Markdown ====================================== @@ -18,9 +18,7 @@ Basic usage: Dependencies: * [Python 2.3+](http://python.org) * [Markdown 2.0+](http://www.freewisdom.org/projects/python-markdown/) -''' -from __future__ import unicode_literals - +""" from os import path as os_path import markdown diff --git a/src/wiki/plugins/links/mdx/urlize.py b/src/wiki/plugins/links/mdx/urlize.py index e4ad3358..564b3ed7 100644 --- a/src/wiki/plugins/links/mdx/urlize.py +++ b/src/wiki/plugins/links/mdx/urlize.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import re import markdown diff --git a/src/wiki/plugins/links/settings.py b/src/wiki/plugins/links/settings.py index b9458dbf..28d22dd3 100644 --- a/src/wiki/plugins/links/settings.py +++ b/src/wiki/plugins/links/settings.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf import settings as django_settings #: If a relative slug is used in a wiki markdown link and no article is diff --git a/src/wiki/plugins/links/views.py b/src/wiki/plugins/links/views.py index f28e5de7..a155b8db 100644 --- a/src/wiki/plugins/links/views.py +++ b/src/wiki/plugins/links/views.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.utils.decorators import method_decorator from django.views.generic.base import View from wiki import models diff --git a/src/wiki/plugins/links/wiki_plugin.py b/src/wiki/plugins/links/wiki_plugin.py index 1c394585..adef3370 100644 --- a/src/wiki/plugins/links/wiki_plugin.py +++ b/src/wiki/plugins/links/wiki_plugin.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - # -*- coding: utf-8 -*- from django.conf.urls import url from django.core.urlresolvers import reverse_lazy diff --git a/src/wiki/plugins/macros/__init__.py b/src/wiki/plugins/macros/__init__.py index 1558b59e..ae663873 100644 --- a/src/wiki/plugins/macros/__init__.py +++ b/src/wiki/plugins/macros/__init__.py @@ -1,3 +1 @@ -from __future__ import unicode_literals - default_app_config = 'wiki.plugins.macros.apps.MacrosConfig' diff --git a/src/wiki/plugins/macros/apps.py b/src/wiki/plugins/macros/apps.py index 9119e73f..5669654d 100644 --- a/src/wiki/plugins/macros/apps.py +++ b/src/wiki/plugins/macros/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/plugins/macros/mdx/macro.py b/src/wiki/plugins/macros/mdx/macro.py index 3aa628b8..817b7972 100644 --- a/src/wiki/plugins/macros/mdx/macro.py +++ b/src/wiki/plugins/macros/mdx/macro.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import re import markdown diff --git a/src/wiki/plugins/macros/mdx/toc.py b/src/wiki/plugins/macros/mdx/toc.py index 1f554656..1eacbe2b 100644 --- a/src/wiki/plugins/macros/mdx/toc.py +++ b/src/wiki/plugins/macros/mdx/toc.py @@ -21,8 +21,6 @@ SO WE AN JUST DEPEND ON THAT! """ -from __future__ import unicode_literals - import re import unicodedata diff --git a/src/wiki/plugins/macros/mdx/wikilinks.py b/src/wiki/plugins/macros/mdx/wikilinks.py index de5b9afc..4b8c85b3 100644 --- a/src/wiki/plugins/macros/mdx/wikilinks.py +++ b/src/wiki/plugins/macros/mdx/wikilinks.py @@ -2,8 +2,6 @@ """ Extend the shipped Markdown extension 'wikilinks' """ -from __future__ import unicode_literals - import re import markdown diff --git a/src/wiki/plugins/macros/settings.py b/src/wiki/plugins/macros/settings.py index 45843e10..5b316b11 100644 --- a/src/wiki/plugins/macros/settings.py +++ b/src/wiki/plugins/macros/settings.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf import settings as django_settings SLUG = 'macros' diff --git a/src/wiki/plugins/macros/templatetags/wiki_macro_tags.py b/src/wiki/plugins/macros/templatetags/wiki_macro_tags.py index 358c892e..b5e8c847 100644 --- a/src/wiki/plugins/macros/templatetags/wiki_macro_tags.py +++ b/src/wiki/plugins/macros/templatetags/wiki_macro_tags.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django import template from wiki.plugins.macros import settings from wiki.plugins.macros.mdx.macro import MacroPreprocessor diff --git a/src/wiki/plugins/macros/wiki_plugin.py b/src/wiki/plugins/macros/wiki_plugin.py index 5b1ba4ef..cca4e71c 100644 --- a/src/wiki/plugins/macros/wiki_plugin.py +++ b/src/wiki/plugins/macros/wiki_plugin.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.utils.translation import ugettext as _ from wiki.core.plugins import registry from wiki.core.plugins.base import BasePlugin diff --git a/src/wiki/plugins/notifications/__init__.py b/src/wiki/plugins/notifications/__init__.py index f9c0d8fa..67d70d98 100644 --- a/src/wiki/plugins/notifications/__init__.py +++ b/src/wiki/plugins/notifications/__init__.py @@ -1,3 +1 @@ -from __future__ import unicode_literals - default_app_config = 'wiki.plugins.notifications.apps.NotificationsConfig' diff --git a/src/wiki/plugins/notifications/apps.py b/src/wiki/plugins/notifications/apps.py index 5159c454..b582bd3d 100644 --- a/src/wiki/plugins/notifications/apps.py +++ b/src/wiki/plugins/notifications/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ diff --git a/src/wiki/plugins/notifications/forms.py b/src/wiki/plugins/notifications/forms.py index 22b665b7..dbd4fab6 100644 --- a/src/wiki/plugins/notifications/forms.py +++ b/src/wiki/plugins/notifications/forms.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django import forms from django.contrib.contenttypes.models import ContentType from django.forms.models import BaseModelFormSet, modelformset_factory diff --git a/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py b/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py index a7905103..bf8e5dd5 100644 --- a/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py +++ b/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand diff --git a/src/wiki/plugins/notifications/migrations/0001_initial.py b/src/wiki/plugins/notifications/migrations/0001_initial.py index ccfa53b6..272378a5 100644 --- a/src/wiki/plugins/notifications/migrations/0001_initial.py +++ b/src/wiki/plugins/notifications/migrations/0001_initial.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.db import migrations, models diff --git a/src/wiki/plugins/notifications/migrations/0002_auto_20151118_1811.py b/src/wiki/plugins/notifications/migrations/0002_auto_20151118_1811.py index d7db815f..d315d8b7 100644 --- a/src/wiki/plugins/notifications/migrations/0002_auto_20151118_1811.py +++ b/src/wiki/plugins/notifications/migrations/0002_auto_20151118_1811.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.db import migrations, models diff --git a/src/wiki/plugins/notifications/models.py b/src/wiki/plugins/notifications/models.py index 7c15f95b..b092d3de 100644 --- a/src/wiki/plugins/notifications/models.py +++ b/src/wiki/plugins/notifications/models.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.core.urlresolvers import reverse from django.db import models from django.db.models import signals diff --git a/src/wiki/plugins/notifications/settings.py b/src/wiki/plugins/notifications/settings.py index c557f444..8a64b5e9 100644 --- a/src/wiki/plugins/notifications/settings.py +++ b/src/wiki/plugins/notifications/settings.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - # Deprecated APP_LABEL = None diff --git a/src/wiki/plugins/notifications/util.py b/src/wiki/plugins/notifications/util.py index 5ef5fccb..7051bc15 100644 --- a/src/wiki/plugins/notifications/util.py +++ b/src/wiki/plugins/notifications/util.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.utils.translation import ugettext as _ diff --git a/src/wiki/plugins/notifications/views.py b/src/wiki/plugins/notifications/views.py index 83ff7334..c6603033 100644 --- a/src/wiki/plugins/notifications/views.py +++ b/src/wiki/plugins/notifications/views.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.contrib import messages from django.contrib.auth.decorators import login_required from django.shortcuts import redirect diff --git a/src/wiki/plugins/notifications/wiki_plugin.py b/src/wiki/plugins/notifications/wiki_plugin.py index b27577d0..df969bd5 100644 --- a/src/wiki/plugins/notifications/wiki_plugin.py +++ b/src/wiki/plugins/notifications/wiki_plugin.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf.urls import url from wiki.core.plugins import registry from wiki.core.plugins.base import BasePlugin diff --git a/src/wiki/templatetags/wiki_tags.py b/src/wiki/templatetags/wiki_tags.py index 9c63c353..917276d9 100644 --- a/src/wiki/templatetags/wiki_tags.py +++ b/src/wiki/templatetags/wiki_tags.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import re from django.apps import apps diff --git a/src/wiki/urls.py b/src/wiki/urls.py index ab226411..45851267 100644 --- a/src/wiki/urls.py +++ b/src/wiki/urls.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.conf.urls import include, url from wiki.conf import settings from wiki.core.plugins import registry diff --git a/src/wiki/views/accounts.py b/src/wiki/views/accounts.py index 2f9e8574..51bae3ff 100644 --- a/src/wiki/views/accounts.py +++ b/src/wiki/views/accounts.py @@ -10,8 +10,6 @@ SETTINGS.LOGIN_URL SETTINGS.LOGOUT_URL """ -from __future__ import unicode_literals - from django.conf import settings as django_settings from django.contrib import messages from django.contrib.auth import get_user_model, login as auth_login diff --git a/src/wiki/views/article.py b/src/wiki/views/article.py index d50170b4..8ad6ee29 100644 --- a/src/wiki/views/article.py +++ b/src/wiki/views/article.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import difflib import logging diff --git a/src/wiki/views/mixins.py b/src/wiki/views/mixins.py index afa6cb00..0f2bc8d6 100644 --- a/src/wiki/views/mixins.py +++ b/src/wiki/views/mixins.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import logging from django.views.generic.base import TemplateResponseMixin -- 2.45.2