management: Remove unused imports in management commands.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg
2019-02-02 14:53:29 -08:00
committed by Tim Abbott
parent ee8ff4df66
commit 2a2e744b27
21 changed files with 8 additions and 47 deletions

View File

@@ -1,8 +1,5 @@
import sys
from typing import Any from typing import Any
from django.conf import settings
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from zerver.lib.management import check_config from zerver.lib.management import check_config

View File

@@ -1,9 +1,7 @@
import argparse import argparse
import os import os
import subprocess
import tempfile import tempfile
import shutil
from typing import Any from typing import Any
from django.core.management.base import BaseCommand, CommandParser, CommandError from django.core.management.base import BaseCommand, CommandParser, CommandError

View File

@@ -1,8 +1,5 @@
import argparse import argparse
import os import os
import subprocess
import tempfile
import shutil
from typing import Any from typing import Any
''' '''
@@ -24,7 +21,7 @@ spec:
exporting-from-hipchat-server-or-data-center-for-data-portability-950821555.html exporting-from-hipchat-server-or-data-center-for-data-portability-950821555.html
''' '''
from django.core.management.base import BaseCommand, CommandParser, CommandError from django.core.management.base import BaseCommand, CommandParser
from zerver.data_import.hipchat import do_convert_data from zerver.data_import.hipchat import do_convert_data

View File

@@ -1,9 +1,7 @@
import argparse import argparse
import os import os
import subprocess
import tempfile import tempfile
import shutil
from typing import Any from typing import Any
from django.core.management.base import BaseCommand, CommandParser, CommandError from django.core.management.base import BaseCommand, CommandParser, CommandError

View File

@@ -1,5 +1,4 @@
from typing import Any
from typing import Any, Callable, Dict, List, Set
from django.db import connection from django.db import connection

View File

@@ -1,12 +1,8 @@
from typing import Any
from typing import Any, Iterable, Tuple
from django.conf import settings
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.db.models import Count
from zerver.lib.onboarding import create_if_missing_realm_internal_bots from zerver.lib.onboarding import create_if_missing_realm_internal_bots
from zerver.models import Realm, UserProfile
class Command(BaseCommand): class Command(BaseCommand):
help = """\ help = """\

View File

@@ -1,5 +1,3 @@
import sys
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any from typing import Any

View File

@@ -9,7 +9,6 @@ condition. (Alternatively, you can set `EMAIL_DELIVERER_DISABLED=True`
on all but one machine to make the command have no effect.) on all but one machine to make the command have no effect.)
""" """
import os
import logging import logging
import time import time
from typing import Any from typing import Any

View File

@@ -1,5 +1,4 @@
import logging import logging
import os
import time import time
from typing import Any, Dict from typing import Any, Dict
from datetime import timedelta from datetime import timedelta
@@ -13,7 +12,6 @@ from zerver.lib.logging_util import log_to_file
from zerver.lib.management import sleep_forever from zerver.lib.management import sleep_forever
from zerver.models import ScheduledMessage, Message, get_user_by_delivery_email from zerver.models import ScheduledMessage, Message, get_user_by_delivery_email
from zerver.lib.actions import do_send_messages from zerver.lib.actions import do_send_messages
from zerver.lib.addressee import Addressee
## Setup ## ## Setup ##
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@@ -26,7 +26,7 @@ import email
import logging import logging
from email.message import Message from email.message import Message
from imaplib import IMAP4_SSL from imaplib import IMAP4_SSL
from typing import Any, Generator, List from typing import Any, Generator
from django.conf import settings from django.conf import settings
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand

View File

@@ -1,6 +1,6 @@
import datetime import datetime
import logging import logging
from typing import Any, List from typing import Any
from django.conf import settings from django.conf import settings
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand

View File

@@ -2,7 +2,6 @@
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any, List from typing import Any, List
from confirmation.models import Confirmation, create_confirmation_link
from zerver.lib.actions import ensure_stream, do_create_multiuse_invite_link from zerver.lib.actions import ensure_stream, do_create_multiuse_invite_link
from zerver.lib.management import ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.models import Stream from zerver.models import Stream

View File

@@ -2,7 +2,6 @@
import argparse import argparse
import os import os
import subprocess import subprocess
import tarfile
from typing import Any from typing import Any
from django.conf import settings from django.conf import settings

View File

@@ -1,9 +1,7 @@
from argparse import ArgumentParser from argparse import ArgumentParser
import json import json
import os
import requests import requests
import subprocess import subprocess
import sys
from typing import Any from typing import Any
from django.conf import settings from django.conf import settings

View File

@@ -1,5 +1,3 @@
import sys
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any from typing import Any

View File

@@ -1,7 +1,5 @@
import logging
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any, Dict, List, Optional from typing import Any, List
from django.contrib.auth.tokens import default_token_generator from django.contrib.auth.tokens import default_token_generator

View File

@@ -2,7 +2,6 @@
from argparse import ArgumentParser from argparse import ArgumentParser
from zerver.lib.management import ZulipBaseCommand, CommandError from zerver.lib.management import ZulipBaseCommand, CommandError
from zerver.lib.send_email import send_email, FromAddress
from zerver.lib.actions import do_send_realm_reactivation_email from zerver.lib.actions import do_send_realm_reactivation_email
from typing import Any from typing import Any

View File

@@ -8,17 +8,13 @@ from email.mime.text import MIMEText
from django.conf import settings from django.conf import settings
from django.core.management.base import CommandParser from django.core.management.base import CommandParser
from django.core.mail import send_mail
from zerver.lib.actions import encode_email_address from zerver.lib.actions import encode_email_address
from zerver.lib.email_mirror import logger, process_message from zerver.lib.email_mirror import process_message
from zerver.lib.send_email import FromAddress
from zerver.lib.management import ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.models import Realm, get_stream, get_realm from zerver.models import Realm, get_stream, get_realm
from typing import Any, Dict
# This command loads an email from a specified file and sends it # This command loads an email from a specified file and sends it
# to the email mirror. Simple emails can be passed in a JSON file, # to the email mirror. Simple emails can be passed in a JSON file,
# Look at zerver/tests/fixtures/email/1.json for an example of how # Look at zerver/tests/fixtures/email/1.json for an example of how

View File

@@ -1,12 +1,7 @@
import sys
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any from typing import Any
from django.core.management.base import CommandError
from zerver.lib.management import ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.models import get_realm
class Command(ZulipBaseCommand): class Command(ZulipBaseCommand):
help = """Show the admins in a realm.""" help = """Show the admins in a realm."""

View File

@@ -1,7 +1,7 @@
import sys import sys
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any, Dict, List from typing import Any, Dict
from django.conf import settings from django.conf import settings

View File

@@ -6,7 +6,6 @@ from typing import Any, List
from django.conf import settings from django.conf import settings
from django.db.utils import IntegrityError
from zerver.lib.logging_util import log_to_file from zerver.lib.logging_util import log_to_file
from zerver.lib.management import ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand