mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
py3: Remove "from six.moves import range".
This is no longer required, since in Python 3, this is what the range built-in does.
This commit is contained in:
@@ -8,7 +8,7 @@ from math import sqrt
|
|||||||
from random import gauss, random, seed
|
from random import gauss, random, seed
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from six.moves import range, zip
|
from six.moves import zip
|
||||||
|
|
||||||
def generate_time_series_data(days=100, business_hours_base=10, non_business_hours_base=10,
|
def generate_time_series_data(days=100, business_hours_base=10, non_business_hours_base=10,
|
||||||
growth=1, autocorrelation=0, spikiness=1, holiday_rate=0,
|
growth=1, autocorrelation=0, spikiness=1, holiday_rate=0,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ from django.core.management.base import BaseCommand
|
|||||||
from django.utils.timezone import now as timezone_now
|
from django.utils.timezone import now as timezone_now
|
||||||
|
|
||||||
from zerver.models import UserProfile, Realm, Stream, Message, get_realm
|
from zerver.models import UserProfile, Realm, Stream, Message, get_realm
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
help = "Generate statistics on user activity."
|
help = "Generate statistics on user activity."
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ from zerver.models import Realm, UserProfile, Message, Stream, Recipient, \
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import ujson
|
import ujson
|
||||||
|
|
||||||
from six.moves import range
|
|
||||||
from typing import Any, Dict, List, Optional, Text, Tuple, Type, Union
|
from typing import Any, Dict, List, Optional, Text, Tuple, Type, Union
|
||||||
|
|
||||||
class AnalyticsTestCase(TestCase):
|
class AnalyticsTestCase(TestCase):
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ from datetime import datetime, timedelta
|
|||||||
import mock
|
import mock
|
||||||
import ujson
|
import ujson
|
||||||
|
|
||||||
from six.moves import range
|
|
||||||
from typing import List, Dict, Optional
|
from typing import List, Dict, Optional
|
||||||
|
|
||||||
class TestStatsEndpoint(ZulipTestCase):
|
class TestStatsEndpoint(ZulipTestCase):
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ from zerver.lib.send_email import send_email
|
|||||||
from zerver.lib.utils import generate_random_token
|
from zerver.lib.utils import generate_random_token
|
||||||
from zerver.models import PreregistrationUser, EmailChangeStatus, MultiuseInvite
|
from zerver.models import PreregistrationUser, EmailChangeStatus, MultiuseInvite
|
||||||
from random import SystemRandom
|
from random import SystemRandom
|
||||||
from six.moves import range
|
|
||||||
import string
|
import string
|
||||||
from typing import Any, Dict, Optional, Text, Union
|
from typing import Any, Dict, Optional, Text, Union
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
import subprocess
|
import subprocess
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
# Generates the favicon images containing unread message counts.
|
# Generates the favicon images containing unread message counts.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from six.moves import range
|
|
||||||
from typing import Callable, List, Tuple, Union
|
from typing import Callable, List, Tuple, Union
|
||||||
|
|
||||||
####### Helpers
|
####### Helpers
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from six.moves import range
|
|
||||||
from typing import Dict, List, Set
|
from typing import Dict, List, Set
|
||||||
|
|
||||||
from .html_branches import html_branches, HtmlTreeBranch
|
from .html_branches import html_branches, HtmlTreeBranch
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ from .template_parser import (
|
|||||||
Token,
|
Token,
|
||||||
is_django_block_tag,
|
is_django_block_tag,
|
||||||
)
|
)
|
||||||
from six.moves import range
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
def pretty_print_html(html, num_spaces=4):
|
def pretty_print_html(html, num_spaces=4):
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
from typing import Callable, List, Optional
|
from typing import Callable, List, Optional
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
class TemplateParserException(Exception):
|
class TemplateParserException(Exception):
|
||||||
def __init__(self, message):
|
def __init__(self, message):
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from collections import defaultdict
|
|||||||
from itertools import permutations, chain
|
from itertools import permutations, chain
|
||||||
import ujson
|
import ujson
|
||||||
|
|
||||||
from six.moves import range, zip
|
from six.moves import zip
|
||||||
from typing import Any, Dict, List, Text
|
from typing import Any, Dict, List, Text
|
||||||
|
|
||||||
# Emojisets that we currently support.
|
# Emojisets that we currently support.
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import signal
|
|||||||
import subprocess
|
import subprocess
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from six.moves import range
|
|
||||||
# check for the venv
|
# check for the venv
|
||||||
from lib import sanity_check
|
from lib import sanity_check
|
||||||
sanity_check.check_venv(__file__)
|
sanity_check.check_venv(__file__)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import time
|
|||||||
import signal
|
import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from six.moves import range
|
|
||||||
# check for the venv
|
# check for the venv
|
||||||
from lib import sanity_check
|
from lib import sanity_check
|
||||||
sanity_check.check_venv(__file__)
|
sanity_check.check_venv(__file__)
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import argparse
|
|||||||
from datetime import date
|
from datetime import date
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from six.moves import range
|
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ from django.utils.timezone import now as timezone_now
|
|||||||
from confirmation.models import Confirmation, create_confirmation_link
|
from confirmation.models import Confirmation, create_confirmation_link
|
||||||
from six.moves import filter
|
from six.moves import filter
|
||||||
from six.moves import map
|
from six.moves import map
|
||||||
from six.moves import range
|
|
||||||
from six import unichr
|
from six import unichr
|
||||||
|
|
||||||
from zerver.lib.create_user import random_api_key
|
from zerver.lib.create_user import random_api_key
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ import zerver.lib.alert_words as alert_words
|
|||||||
import zerver.lib.mention as mention
|
import zerver.lib.mention as mention
|
||||||
from zerver.lib.str_utils import force_str, force_text
|
from zerver.lib.str_utils import force_str, force_text
|
||||||
from zerver.lib.tex import render_tex
|
from zerver.lib.tex import render_tex
|
||||||
from six.moves import range, html_parser
|
from six.moves import html_parser
|
||||||
|
|
||||||
FullNameInfo = TypedDict('FullNameInfo', {
|
FullNameInfo = TypedDict('FullNameInfo', {
|
||||||
'id': int,
|
'id': int,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import base64
|
|||||||
import ujson
|
import ujson
|
||||||
import os
|
import os
|
||||||
import string
|
import string
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
from typing import Optional, Text
|
from typing import Optional, Text
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ from zerver.models import UserProfile, Realm, Client, Huddle, Stream, \
|
|||||||
get_display_recipient, Attachment, get_system_bot
|
get_display_recipient, Attachment, get_system_bot
|
||||||
from zerver.lib.parallel import run_parallel
|
from zerver.lib.parallel import run_parallel
|
||||||
from zerver.lib.utils import mkdir_p
|
from zerver.lib.utils import mkdir_p
|
||||||
from six.moves import range
|
|
||||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
|
||||||
|
|
||||||
# Custom mypy types follow:
|
# Custom mypy types follow:
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import itertools
|
|||||||
import ujson
|
import ujson
|
||||||
import random
|
import random
|
||||||
from typing import List, Dict, Any, Text, Optional
|
from typing import List, Dict, Any, Text, Optional
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
def load_config():
|
def load_config():
|
||||||
# type: () -> Dict [str, Any]
|
# type: () -> Dict [str, Any]
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import ctypes
|
import ctypes
|
||||||
import threading
|
import threading
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
# Based on http://code.activestate.com/recipes/483752/
|
# Based on http://code.activestate.com/recipes/483752/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from time import sleep
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.http import HttpRequest
|
from django.http import HttpRequest
|
||||||
from six.moves import range, map, zip_longest
|
from six.moves import map, zip_longest
|
||||||
from zerver.lib.str_utils import force_text
|
from zerver.lib.str_utils import force_text
|
||||||
|
|
||||||
T = TypeVar('T')
|
T = TypeVar('T')
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
from django.db.utils import IntegrityError
|
from django.db.utils import IntegrityError
|
||||||
|
|
||||||
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
|
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ from collections import OrderedDict
|
|||||||
import mock
|
import mock
|
||||||
import time
|
import time
|
||||||
import ujson
|
import ujson
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
|
|
||||||
class LogEventsTest(ZulipTestCase):
|
class LogEventsTest(ZulipTestCase):
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import shutil
|
|||||||
import ujson
|
import ujson
|
||||||
|
|
||||||
from mock import patch, MagicMock
|
from mock import patch, MagicMock
|
||||||
from six.moves import range
|
|
||||||
from typing import Any, Dict, List, Set
|
from typing import Any, Dict, List, Set
|
||||||
|
|
||||||
from zerver.lib.actions import (
|
from zerver.lib.actions import (
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import mock
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from six.moves import urllib
|
from six.moves import urllib
|
||||||
from six.moves import range
|
|
||||||
from typing import Text
|
from typing import Text
|
||||||
|
|
||||||
class MITNameTest(ZulipTestCase):
|
class MITNameTest(ZulipTestCase):
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ import DNS
|
|||||||
import mock
|
import mock
|
||||||
import time
|
import time
|
||||||
import ujson
|
import ujson
|
||||||
from six.moves import range
|
|
||||||
from typing import Any, Dict, List, Optional, Text
|
from typing import Any, Dict, List, Optional, Text
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ from zerver.views.messages import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from typing import Dict, List, Mapping, Sequence, Tuple, Generic, Union, Any, Optional, Text
|
from typing import Dict, List, Mapping, Sequence, Tuple, Generic, Union, Any, Optional, Text
|
||||||
from six.moves import range
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import ujson
|
import ujson
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ from django.http import HttpResponse
|
|||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
from email.utils import formataddr
|
from email.utils import formataddr
|
||||||
from mock import patch, MagicMock
|
from mock import patch, MagicMock
|
||||||
from six.moves import range
|
|
||||||
from typing import Any, Dict, List, Text
|
from typing import Any, Dict, List, Text
|
||||||
|
|
||||||
from zerver.lib.notifications import fix_emojis, \
|
from zerver.lib.notifications import fix_emojis, \
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ from zerver.lib.retention import get_expired_messages, move_message_to_archive
|
|||||||
|
|
||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
|
||||||
from six.moves import range
|
|
||||||
|
|
||||||
|
|
||||||
class TestRetentionLib(ZulipTestCase):
|
class TestRetentionLib(ZulipTestCase):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ from django.http import HttpResponse
|
|||||||
import mock
|
import mock
|
||||||
import random
|
import random
|
||||||
import ujson
|
import ujson
|
||||||
from six.moves import range, urllib, zip
|
from six.moves import urllib, zip
|
||||||
|
|
||||||
class TestCreateStreams(ZulipTestCase):
|
class TestCreateStreams(ZulipTestCase):
|
||||||
def test_creating_streams(self):
|
def test_creating_streams(self):
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import random
|
|||||||
import os
|
import os
|
||||||
import ujson
|
import ujson
|
||||||
import itertools
|
import itertools
|
||||||
from six.moves import range
|
|
||||||
from typing import Any, Callable, Dict, List, Iterable, Mapping, Optional, Sequence, Set, Tuple, Text
|
from typing import Any, Callable, Dict, List, Iterable, Mapping, Optional, Sequence, Set, Tuple, Text
|
||||||
|
|
||||||
settings.TORNADO_SERVER = None
|
settings.TORNADO_SERVER = None
|
||||||
|
|||||||
Reference in New Issue
Block a user