kopia lustrzana https://github.com/wagtail/wagtail
Eliminate references to django.utils.six.moves
rodzic
6dc89c1f7f
commit
a2dc9926fd
|
@ -1,7 +1,8 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.six.moves.urllib.parse import urlparse
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailcore.utils import resolve_model_string
|
||||
|
|
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, division, unicode_literals
|
|||
import operator
|
||||
import re
|
||||
from functools import partial, reduce
|
||||
from itertools import zip_longest
|
||||
|
||||
from django.apps import apps
|
||||
from django.db import connections
|
||||
from django.utils.six.moves import zip_longest
|
||||
|
||||
from wagtail.wagtailsearch.index import Indexed, RelatedFields, SearchField
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ from __future__ import absolute_import, unicode_literals
|
|||
import logging
|
||||
import uuid
|
||||
from collections import defaultdict
|
||||
from urllib.error import HTTPError, URLError
|
||||
from urllib.parse import urlparse, urlunparse
|
||||
from urllib.request import Request, urlopen
|
||||
|
||||
import requests
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils.six.moves.urllib.error import HTTPError, URLError
|
||||
from django.utils.six.moves.urllib.parse import urlparse, urlunparse
|
||||
from django.utils.six.moves.urllib.request import Request, urlopen
|
||||
|
||||
from wagtail import __version__
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from urllib.parse import parse_qs
|
||||
|
||||
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.six.moves.urllib.parse import parse_qs
|
||||
|
||||
DEFAULT_PAGE_KEY = 'p'
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import hashlib
|
||||
from urllib.parse import urlencode
|
||||
|
||||
from django import template
|
||||
from django.utils.six.moves.urllib.parse import urlencode
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import operator
|
|||
from django.core.management.base import BaseCommand
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
from django.utils import six
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
||||
|
@ -71,7 +70,7 @@ class Command(BaseCommand):
|
|||
self.stdout.write('')
|
||||
|
||||
if options.get('interactive', True):
|
||||
yes_or_no = six.moves.input("Delete these pages? [y/N] ")
|
||||
yes_or_no = input("Delete these pages? [y/N] ")
|
||||
delete_orphans = yes_or_no.lower().startswith('y')
|
||||
self.stdout.write('')
|
||||
else:
|
||||
|
|
|
@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals
|
|||
import json
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import Group, Permission
|
||||
|
@ -22,7 +23,6 @@ from django.urls import reverse
|
|||
from django.utils import six, timezone
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.six.moves.urllib.parse import urlparse
|
||||
from django.utils.text import capfirst, slugify
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from modelcluster.models import ClusterableModel, get_all_child_relations
|
||||
|
|
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, unicode_literals
|
|||
import json
|
||||
import re
|
||||
|
||||
from django.utils.six.moves.urllib import request as urllib_request
|
||||
from django.utils.six.moves.urllib.error import URLError
|
||||
from django.utils.six.moves.urllib.parse import urlencode
|
||||
from django.utils.six.moves.urllib.request import Request
|
||||
from urllib import request as urllib_request
|
||||
from urllib.error import URLError
|
||||
from urllib.parse import urlencode
|
||||
from urllib.request import Request
|
||||
|
||||
from wagtail.wagtailembeds.exceptions import EmbedNotFoundException
|
||||
from wagtail.wagtailembeds.oembed_providers import all_providers
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
import unittest
|
||||
import urllib.request
|
||||
from urllib.error import URLError
|
||||
|
||||
import django.utils.six.moves.urllib.request
|
||||
from bs4 import BeautifulSoup
|
||||
from django import template
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.test import TestCase, override_settings
|
||||
from django.urls import reverse
|
||||
from django.utils.six.moves.urllib.error import URLError
|
||||
from mock import patch
|
||||
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
|
@ -312,11 +312,11 @@ class TestOembed(TestCase):
|
|||
|
||||
def test_oembed_invalid_request(self):
|
||||
config = {'side_effect': URLError('foo')}
|
||||
with patch.object(django.utils.six.moves.urllib.request, 'urlopen', **config):
|
||||
with patch.object(urllib.request, 'urlopen', **config):
|
||||
self.assertRaises(EmbedNotFoundException, OEmbedFinder().find_embed,
|
||||
"http://www.youtube.com/watch/")
|
||||
|
||||
@patch('django.utils.six.moves.urllib.request.urlopen')
|
||||
@patch('urllib.request.urlopen')
|
||||
@patch('json.loads')
|
||||
def test_oembed_photo_request(self, loads, urlopen):
|
||||
urlopen.return_value = self.dummy_response
|
||||
|
@ -327,7 +327,7 @@ class TestOembed(TestCase):
|
|||
self.assertEqual(result['html'], '<img src="http://www.example.com" />')
|
||||
loads.assert_called_with("foo")
|
||||
|
||||
@patch('django.utils.six.moves.urllib.request.urlopen')
|
||||
@patch('urllib.request.urlopen')
|
||||
@patch('json.loads')
|
||||
def test_oembed_return_values(self, loads, urlopen):
|
||||
urlopen.return_value = self.dummy_response
|
||||
|
@ -362,7 +362,7 @@ class TestOembed(TestCase):
|
|||
finder = OEmbedFinder(providers=[oembed_providers.twitter])
|
||||
self.assertFalse(finder.accept("http://www.youtube.com/watch/"))
|
||||
|
||||
@patch('django.utils.six.moves.urllib.request.urlopen')
|
||||
@patch('urllib.request.urlopen')
|
||||
@patch('json.loads')
|
||||
def test_endpoint_with_format_param(self, loads, urlopen):
|
||||
urlopen.return_value = self.dummy_response
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from django import http
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
from django.utils.encoding import uri_to_iri
|
||||
from django.utils.six.moves.urllib.parse import urlparse
|
||||
|
||||
from wagtail.wagtailredirects import models
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from django.db import models
|
||||
from django.utils.six.moves.urllib.parse import urlparse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ from __future__ import absolute_import, unicode_literals
|
|||
|
||||
import copy
|
||||
import json
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from django.db import DEFAULT_DB_ALIAS, models
|
||||
from django.db.models.sql import Query
|
||||
from django.db.models.sql.constants import SINGLE
|
||||
from django.utils.crypto import get_random_string
|
||||
from django.utils.six.moves.urllib.parse import urlparse
|
||||
from elasticsearch import Elasticsearch, NotFoundError
|
||||
from elasticsearch.helpers import bulk
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue