cleanup: Remove unused imports.

Generated by autoflake.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2020-04-18 16:00:35 -07:00 committed by Tim Abbott
parent 64d2f5ac32
commit 2f6623bbc4
61 changed files with 25 additions and 91 deletions

View file

@ -1,4 +1,4 @@
from typing import Any, Dict, List, Tuple
from typing import List
from zulint.custom_rules import RuleList
MYPY = False

View file

@ -9,7 +9,6 @@ import zipfile
import textwrap
import requests
import urllib.parse
import json
from requests import Response
red = '\033[91m' # type: str

View file

@ -2,7 +2,6 @@
# Original path: zulip/tools/linter_lib/pep8.py
import subprocess
import sys
from zulint.printer import print_err, colors

View file

@ -1,4 +1,3 @@
from importlib import import_module
import os
import sys

View file

@ -1,14 +1,12 @@
#!/usr/bin/env python3
from os.path import dirname, basename
from importlib import import_module
import os
import sys
import argparse
import glob
import unittest
from unittest import TestCase, TestSuite
import pytest
def parse_args():

View file

@ -8,7 +8,6 @@ import argparse
import zulip
import sys
import traceback
from typing import Any, Dict
usage = """./irc-mirror.py --irc-server=IRC_SERVER --channel=<CHANNEL> --nick-prefix=<NICK> --stream=<STREAM> [optional args]

View file

@ -1,6 +1,6 @@
import irc.bot
import irc.strings
from irc.client import ip_numstr_to_quad, ip_quad_to_numstr, Event, ServerConnection
from irc.client import Event, ServerConnection, ip_numstr_to_quad
from irc.client_aio import AioReactor
import multiprocessing as mp
from typing import Any, Dict

View file

@ -1,6 +1,4 @@
#!/usr/bin/env python3
import datetime
import httplib2
import os
from oauth2client import client

View file

@ -10,13 +10,11 @@ import logging
import argparse
import os
import pytz
import urllib
import sys
import time
import traceback
from typing import List, Set, Tuple, Iterable, Optional
from typing import List, Optional, Set, Tuple
from oauth2client import client, tools
from oauth2client import client
from oauth2client.file import Storage
try:
from googleapiclient import discovery

View file

@ -7,7 +7,7 @@
import zulip
import sys
from typing import Any, Optional, Text
from typing import Text
from mercurial import ui, repository as repo
VERSION = "0.9"

View file

@ -6,7 +6,6 @@ import os
import traceback
import signal
from types import FrameType
from typing import Any
from zulip import RandomExponentialBackoff
def die(signal: int, frame: FrameType) -> None:

View file

@ -40,19 +40,14 @@
from typing import Dict, List, Set, Optional
import logging
import threading
import optparse
from sleekxmpp import ClientXMPP, InvalidJID, JID
from sleekxmpp.stanza import Message as JabberMessage
from sleekxmpp.exceptions import IqError, IqTimeout
from configparser import SafeConfigParser
import getpass
import os
import sys
import zulip
from zulip import Client
import re
from typing import Any, Callable
__version__ = "1.1"

View file

@ -6,7 +6,6 @@ import os
import platform
import re
import sys
import shutil
import subprocess
import tempfile
import traceback

View file

@ -2,7 +2,7 @@
import argparse
import zulip
from typing import List, Text, Dict, Any
from typing import Any, Dict, Text
VERSION = "0.9"
# Nagios passes the notification details as command line options.

View file

@ -23,7 +23,7 @@ import git_p4
__version__ = "0.1"
sys.path.insert(0, os.path.dirname(__file__))
from typing import Any, Dict, Optional, Text
from typing import Any, Dict, Optional
import zulip_perforce_config as config
if config.ZULIP_API_PATH is not None:

View file

@ -13,7 +13,7 @@ import os
import sys
import os.path
import pysvn
from typing import Any, Dict, List, Optional, Text, Tuple, Union
from typing import Any, Dict, Optional, Text, Tuple
sys.path.insert(0, os.path.dirname(__file__))
import zulip_svn_config as config

View file

@ -2,7 +2,6 @@
import sys
import time
import optparse
import os
import random
import logging
import subprocess

View file

@ -12,7 +12,6 @@ from zephyr_mirror_backend import parse_args
(options, args) = parse_args()
from types import FrameType
from typing import Any
def die(signal: int, frame: FrameType) -> None:
@ -44,7 +43,6 @@ if options.forward_class_messages and not options.noshard:
return 0
for (status, job) in run_parallel(run_job, jobs, threads=16):
print("A mirroring shard died!")
pass
sys.exit(0)
backoff = RandomExponentialBackoff(timeout_success_equivalent=300)

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3
from typing import IO, Any, Dict, List, Text, Union, Set, Tuple, Optional, cast
from typing import Any, Dict, IO, List, Optional, Set, Text, Tuple, cast
from types import FrameType
import sys
@ -10,7 +10,6 @@ import time
import subprocess
import optparse
import os
import datetime
import textwrap
import signal
import logging

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python3
import sys
import argparse
usage = """subscribe [options] --streams=<streams>

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python3
import sys
import argparse
usage = """unsubscribe [options] --streams=<streams>

View file

@ -5,7 +5,7 @@ import sys
import argparse
import logging
from typing import Any, Dict, List, Optional
from typing import Any, Dict
import zulip

View file

@ -2,8 +2,6 @@
import os
import sys
import glob
import subprocess
from typing import Any, Dict, Optional
ZULIP_BOTS_VERSION = "0.6.4"

View file

@ -1,8 +1,7 @@
import requests
import logging
import json
from typing import Dict, Any, List
from requests.exceptions import HTTPError, ConnectionError
from typing import Any, Dict
from requests.exceptions import ConnectionError
help_message = '''
You can add datapoints towards your beeminder goals \

View file

@ -1,4 +1,4 @@
from unittest.mock import patch, Mock
from unittest.mock import patch
from zulip_bots.test_lib import StubBotHandler, BotTestCase, DefaultTests, get_bot_message_handler
from requests.exceptions import ConnectionError

View file

@ -1,5 +1,4 @@
from copy import deepcopy
from random import randint
from functools import reduce
from zulip_bots.game_handler import BadMoveException

View file

@ -1,10 +1,8 @@
# See readme.md for instructions on running this code.
import copy
import importlib
from math import log10, floor
import re
from zulip_bots.bots.converter import utils
from typing import Any, Dict, List

View file

@ -1,6 +1,5 @@
# See readme.md for instructions on running this code.
import logging
import json
import requests
import html2text
import string

View file

@ -1,11 +1,10 @@
# See readme.md for instructions on running this code.
import logging
from urllib import parse
import json
import apiai
from typing import Dict, Any, List
from typing import Any, Dict
help_message = '''DialogFlow bot
This bot will interact with dialogflow bots.

View file

@ -1,4 +1,4 @@
from unittest.mock import patch, MagicMock, Mock
from unittest.mock import Mock, patch
from zulip_bots.test_lib import (
get_bot_message_handler,

View file

@ -1,6 +1,6 @@
import requests
import re
from typing import Any, Dict, Optional
from typing import Any, Dict
class FrontHandler:
FRONT_API = "https://api2.frontapp.com/conversations/{}"

View file

@ -1,5 +1,4 @@
import copy
import random
from typing import List, Any, Tuple, Dict
from zulip_bots.game_handler import GameAdapter, BadMoveException

View file

@ -1,5 +1,5 @@
from unittest.mock import patch
from requests.exceptions import HTTPError, ConnectionError
from requests.exceptions import ConnectionError
from zulip_bots.test_lib import StubBotHandler, BotTestCase, DefaultTests, get_bot_message_handler

View file

@ -1,8 +1,5 @@
import re
import os
import sys
import logging
import configparser
import requests

View file

@ -1,12 +1,11 @@
# See readme.md for instructions on running this code.
import logging
from urllib import parse
import requests
from bs4 import BeautifulSoup
from typing import Dict, Any, Union, List
from typing import Any, Dict, List
def google_search(keywords: str) -> List[Dict[str, str]]:
query = {'q': keywords}

View file

@ -2,7 +2,6 @@
# googletranslate.conf in this (zulip_bots/bots/googletranslate/) directory.
import requests
from requests.exceptions import HTTPError, ConnectionError
class GoogleTranslateHandler:
'''

View file

@ -2,7 +2,6 @@ from unittest.mock import patch
from requests.exceptions import ConnectionError
from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler
from zulip_bots.bots.google_translate.google_translate import TranslateError
help_text = '''
Google translate bot

View file

@ -19,7 +19,6 @@ class TeamNotFoundException(Exception):
class UnknownCommandSyntax(Exception):
def __init__(self, detail: str) -> None:
self.detail = detail
pass
class UnspecifiedProblemException(Exception):
pass

View file

@ -1,10 +1,8 @@
import html
import json
import random
import re
from zulip_bots.lib import Any
from typing import Optional, Any, Dict, Tuple
from typing import Any, Dict, Tuple
QUESTION = 'How should we handle this?'

View file

@ -1,7 +1,7 @@
import base64
import re
import requests
from typing import Any, Dict, Iterable, Optional
from typing import Any, Dict, Optional
GET_REGEX = re.compile('get "(?P<issue_key>.+)"$')
CREATE_REGEX = re.compile(

View file

@ -1,6 +1,5 @@
import re
import requests
import logging
from typing import Any, Dict

View file

@ -2,7 +2,6 @@
import requests
from typing import Any, List, Dict
import logging
class MentionHandler:
def initialize(self, bot_handler: Any) -> None:

View file

@ -10,8 +10,6 @@ finished yet so any matches that are finished will be removed.
import json
from .constants import EMPTY_BOARD
class MerelsStorage():
def __init__(self, topic_name, storage):

View file

@ -5,7 +5,7 @@ from zulip_bots.bots.merels.libraries import (
database,
game_data
)
from zulip_bots.game_handler import GameAdapter, SamePlayerMove, GameInstance
from zulip_bots.game_handler import GameAdapter, SamePlayerMove
class Storage:
data = {}

View file

@ -1,11 +1,8 @@
import unittest
from libraries import database
from libraries import game_data
from zulip_bots.simple_lib import SimpleStorage
from zulip_bots.test_lib import BotTestCase, DefaultTests
from zulip_bots.game_handler import GameInstance
from merels import MerelsHandler
class DatabaseTest(BotTestCase, DefaultTests):
bot_name = 'merels'

View file

@ -2,10 +2,8 @@
import simple_salesforce
from typing import Dict, Any, List
import getpass
import re
import logging
import json
from zulip_bots.bots.salesforce.utils import commands, object_types, link_query, default_query
base_help_text = '''Salesforce bot

View file

@ -1,7 +1,5 @@
import requests
import logging
import re
import urllib
from typing import Optional, Any, Dict

View file

@ -1,5 +1,5 @@
import requests
from typing import Dict, Any, Tuple, Union
from typing import Any, Dict
class SusiHandler:
'''

View file

@ -8,7 +8,6 @@ from zulip_bots.test_file_utils import (
read_bot_fixture_data,
)
from unittest.mock import patch
import tweepy
class TestTwitpostBot(BotTestCase, DefaultTests):
bot_name = "twitpost"

View file

@ -1,6 +1,5 @@
import zulip
import tweepy
from typing import Dict, Any, Union, List, Tuple, Optional
from typing import Any, Dict
class TwitpostBot:

View file

@ -3,7 +3,7 @@
import re
import os
from typing import Any, Dict, List, Tuple, Callable, Set, Union
from typing import Any, Dict, List, Set, Tuple, Union
class VirtualFsHandler:
META = {

View file

@ -1,7 +1,5 @@
# See readme.md for instructions on running this code.
import requests
import json
import logging
from typing import Any, Dict

View file

@ -1,7 +1,5 @@
import requests
import logging
import re
import urllib
from zulip_bots.lib import Any
from typing import Optional, Any, Dict

View file

@ -2,7 +2,6 @@
from typing import Dict, Any, Optional, Callable
import wit
import sys
import importlib.util
class WitaiHandler:

View file

@ -1,7 +1,6 @@
# See readme.md for instructions on running this code.
import logging
import ssl
import sys
import requests
from typing import Any, Dict

View file

@ -1,6 +1,5 @@
import requests
import logging
import sys
from requests.exceptions import HTTPError, ConnectionError
from typing import Dict, Any, Union, List, Tuple, Optional

View file

@ -4,8 +4,6 @@ import random
import logging
from copy import deepcopy
from typing import Any, Dict, Tuple, List
from zulip_bots.test_lib import BotTestCase
import operator
import random

View file

@ -11,7 +11,6 @@ import re
from typing import Any, Optional, List, Dict, IO, Text
from zulip import Client, ZulipError
from zulip_bots.custom_exceptions import ConfigValidationError
class NoBotConfigException(Exception):

View file

@ -6,7 +6,6 @@ import os
import sys
import subprocess
import glob
import pip
from typing import Iterator
def get_bot_paths() -> Iterator[str]:

View file

@ -4,7 +4,6 @@ import logging
import argparse
import sys
import os
from os.path import basename, splitext
from zulip_bots.lib import (
zulip_env_vars_are_present,

View file

@ -10,7 +10,7 @@ import importlib.util
from configparser import MissingSectionHeaderError, NoOptionError
from flask import Flask, request
from importlib import import_module
from typing import Any, Dict, Union, List, Optional
from typing import Any, Dict, List, Optional
from types import ModuleType
from werkzeug.exceptions import BadRequest, Unauthorized