isort: Reformat using isort.

This commit is contained in:
PIG208 2021-05-28 17:00:04 +08:00 committed by Tim Abbott
parent 37e2596124
commit 5580c68ae5
162 changed files with 539 additions and 444 deletions

View file

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

View file

@ -1,14 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from typing import Any, List, Dict, Callable import argparse
import os import os
import sys import sys
import argparse
import zipfile
import textwrap import textwrap
import requests
import urllib.parse import urllib.parse
import zipfile
from typing import Any, Callable, Dict, List
import requests
from requests import Response from requests import Response
red = '\033[91m' # type: str red = '\033[91m' # type: str

View file

@ -3,9 +3,9 @@
import argparse import argparse
import sys import sys
from zulint.command import add_default_linter_arguments, LinterConfig from zulint.command import LinterConfig, add_default_linter_arguments
from custom_check import python_rules, non_py_rules from custom_check import non_py_rules, python_rules
EXCLUDED_FILES = [ EXCLUDED_FILES = [
# This is an external file that doesn't comply with our codestyle # This is an external file that doesn't comply with our codestyle

View file

@ -1,10 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os
import sys
import argparse import argparse
import subprocess
import glob import glob
import os
import subprocess
import sys
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
ZULIP_BOTS_DIR = os.path.join(CURRENT_DIR, '..', 'zulip_bots') ZULIP_BOTS_DIR = os.path.join(CURRENT_DIR, '..', 'zulip_bots')

View file

@ -1,15 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from contextlib import contextmanager
import os
import argparse import argparse
import glob import glob
import os
import shutil import shutil
import tempfile import tempfile
from contextlib import contextmanager
import crayons import crayons
import twine.commands.upload
import setuptools.sandbox import setuptools.sandbox
import twine.commands.upload
REPO_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) REPO_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

View file

@ -3,6 +3,7 @@
import subprocess import subprocess
import sys import sys
def exit(message: str) -> None: def exit(message: str) -> None:
print('PROBLEM!') print('PROBLEM!')
print(message) print(message)

View file

@ -1,14 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os
import sys
import argparse import argparse
import os
import subprocess import subprocess
import sys
from collections import OrderedDict from collections import OrderedDict
from pathlib import PurePath from pathlib import PurePath
from typing import Dict, List, cast
from zulint import lister from zulint import lister
from typing import cast, Dict, List
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
os.chdir(os.path.dirname(TOOLS_DIR)) os.chdir(os.path.dirname(TOOLS_DIR))

View file

@ -1,10 +1,11 @@
import os
import sys
import argparse import argparse
import unittest import os
import pytest
import shutil import shutil
import sys
import unittest
import pytest
TOOLS_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TOOLS_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(os.path.dirname(TOOLS_DIR)) os.chdir(os.path.dirname(TOOLS_DIR))

View file

@ -1,14 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from os.path import dirname, basename
import os
import sys
import argparse import argparse
import glob import glob
import os
import sys
import unittest import unittest
from os.path import basename, dirname
import pytest import pytest
def parse_args(): def parse_args():
description = """ description = """
Script to run test_<bot_name>.py files in the Script to run test_<bot_name>.py files in the

View file

@ -1,13 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys
import os
import argparse import argparse
import multiprocessing as mp import multiprocessing as mp
import zulip import os
import sys
from typing import Any, Callable, Dict
import interrealm_bridge_config import interrealm_bridge_config
from typing import Any, Callable, Dict import zulip
def create_pipe_event(to_client: zulip.Client, from_bot: Dict[str, Any], def create_pipe_event(to_client: zulip.Client, from_bot: Dict[str, Any],

View file

@ -5,10 +5,11 @@
# #
import argparse import argparse
import zulip
import sys import sys
import traceback import traceback
import zulip
usage = """./irc-mirror.py --irc-server=IRC_SERVER --channel=<CHANNEL> --nick-prefix=<NICK> --stream=<STREAM> [optional args] usage = """./irc-mirror.py --irc-server=IRC_SERVER --channel=<CHANNEL> --nick-prefix=<NICK> --stream=<STREAM> [optional args]
Example: Example:

View file

@ -1,9 +1,10 @@
import multiprocessing as mp
from typing import Any, Dict
import irc.bot import irc.bot
import irc.strings import irc.strings
from irc.client import Event, ServerConnection, ip_numstr_to_quad from irc.client import Event, ServerConnection, ip_numstr_to_quad
from irc.client_aio import AioReactor from irc.client_aio import AioReactor
import multiprocessing as mp
from typing import Any, Dict
class IRCBot(irc.bot.SingleServerIRCBot): class IRCBot(irc.bot.SingleServerIRCBot):

View file

@ -1,23 +1,22 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os
import logging
import signal
import traceback
import zulip
import sys
import argparse import argparse
import re
import configparser import configparser
import logging
import os
import re
import signal
import sys
import traceback
from collections import OrderedDict from collections import OrderedDict
from types import FrameType from types import FrameType
from typing import Any, Callable, Dict, Optional from typing import Any, Callable, Dict, Optional
from matrix_client.errors import MatrixRequestError
from matrix_client.client import MatrixClient from matrix_client.client import MatrixClient
from matrix_client.errors import MatrixRequestError
from requests.exceptions import MissingSchema from requests.exceptions import MissingSchema
import zulip
GENERAL_NETWORK_USERNAME_REGEX = '@_?[a-zA-Z0-9]+_([a-zA-Z0-9-_]+):[a-zA-Z0-9.]+' GENERAL_NETWORK_USERNAME_REGEX = '@_?[a-zA-Z0-9]+_([a-zA-Z0-9-_]+):[a-zA-Z0-9.]+'
MATRIX_USERNAME_REGEX = '@([a-zA-Z0-9-_]+):matrix.org' MATRIX_USERNAME_REGEX = '@([a-zA-Z0-9-_]+):matrix.org'

View file

@ -1,22 +1,17 @@
from .matrix_bridge import (
check_zulip_message_validity,
zulip_to_matrix,
)
from unittest import TestCase, mock
from subprocess import Popen, PIPE
import os import os
import shutil import shutil
from contextlib import contextmanager from contextlib import contextmanager
from subprocess import PIPE, Popen
from tempfile import mkdtemp from tempfile import mkdtemp
from unittest import TestCase, mock
from .matrix_bridge import check_zulip_message_validity, zulip_to_matrix
script_file = "matrix_bridge.py" script_file = "matrix_bridge.py"
script_dir = os.path.dirname(__file__) script_dir = os.path.dirname(__file__)
script = os.path.join(script_dir, script_file) script = os.path.join(script_dir, script_file)
from typing import List, Iterator from typing import Iterator, List
sample_config_path = "matrix_test.conf" sample_config_path = "matrix_test.conf"

View file

@ -8,11 +8,11 @@ import threading
import traceback import traceback
from typing import Any, Callable, Dict from typing import Any, Callable, Dict
import bridge_with_slack_config
import slack_sdk import slack_sdk
import zulip
from slack_sdk.rtm import RTMClient from slack_sdk.rtm import RTMClient
import bridge_with_slack_config import zulip
# change these templates to change the format of displayed message # change these templates to change the format of displayed message
ZULIP_MESSAGE_TEMPLATE = "**{username}**: {message}" ZULIP_MESSAGE_TEMPLATE = "**{username}**: {message}"

View file

@ -8,15 +8,15 @@
# #
# python-dateutil is a dependency for this script. # python-dateutil is a dependency for this script.
import requests
import logging import logging
import pytz
import time
import sys
import os import os
import sys
import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
import pytz
import requests
try: try:
import dateutil.parser import dateutil.parser
except ImportError as e: except ImportError as e:
@ -26,12 +26,14 @@ except ImportError as e:
sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(0, os.path.dirname(__file__))
import zulip_codebase_config as config import zulip_codebase_config as config
VERSION = "0.9" VERSION = "0.9"
if config.ZULIP_API_PATH is not None: if config.ZULIP_API_PATH is not None:
sys.path.append(config.ZULIP_API_PATH) sys.path.append(config.ZULIP_API_PATH)
from typing import Any, Dict, List, Optional
import zulip import zulip
from typing import Any, List, Dict, Optional
client = zulip.Client( client = zulip.Client(
email=config.ZULIP_USER, email=config.ZULIP_USER,

View file

@ -9,20 +9,22 @@
# For example: # For example:
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master # aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
from typing import Text
import os import os
import sys
import subprocess
import os.path import os.path
import subprocess
import sys
from typing import Text
sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(0, os.path.dirname(__file__))
import zulip_git_config as config import zulip_git_config as config
VERSION = "0.9" VERSION = "0.9"
if config.ZULIP_API_PATH is not None: if config.ZULIP_API_PATH is not None:
sys.path.append(config.ZULIP_API_PATH) sys.path.append(config.ZULIP_API_PATH)
import zulip import zulip
client = zulip.Client( client = zulip.Client(
email=config.ZULIP_USER, email=config.ZULIP_USER,
site=config.ZULIP_SITE, site=config.ZULIP_SITE,

View file

@ -1,5 +1,5 @@
# #
from typing import Dict, Text, Optional from typing import Dict, Optional, Text
# Name of the stream to send notifications to, default is "commits" # Name of the stream to send notifications to, default is "commits"
STREAM_NAME = 'commits' STREAM_NAME = 'commits'

View file

@ -1,12 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
from typing import Optional from typing import Optional
from oauth2client import client, tools
from oauth2client.file import Storage
try: try:
import argparse import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args() # type: Optional[argparse.Namespace] flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args() # type: Optional[argparse.Namespace]

View file

@ -2,20 +2,21 @@
# #
# This script depends on python-dateutil and python-pytz for properly handling # This script depends on python-dateutil and python-pytz for properly handling
# times and time zones of calendar events. # times and time zones of calendar events.
import argparse
import datetime import datetime
import dateutil.parser
import httplib2
import itertools import itertools
import logging import logging
import argparse
import os import os
import pytz
import sys import sys
import time import time
from typing import List, Optional, Set, Tuple from typing import List, Optional, Set, Tuple
import dateutil.parser
import httplib2
import pytz
from oauth2client import client from oauth2client import client
from oauth2client.file import Storage from oauth2client.file import Storage
try: try:
from googleapiclient import discovery from googleapiclient import discovery
except ImportError: except ImportError:

View file

@ -5,10 +5,13 @@
# This hook is called when changesets are pushed to the master repository (ie # This hook is called when changesets are pushed to the master repository (ie
# `hg push`). See https://zulip.com/integrations for installation instructions. # `hg push`). See https://zulip.com/integrations for installation instructions.
import zulip
import sys import sys
from typing import Text from typing import Text
from mercurial import ui, repository as repo
from mercurial import repository as repo
from mercurial import ui
import zulip
VERSION = "0.9" VERSION = "0.9"

View file

@ -1,13 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys
import subprocess
import os import os
import traceback
import signal import signal
import subprocess
import sys
import traceback
from types import FrameType from types import FrameType
from zulip import RandomExponentialBackoff from zulip import RandomExponentialBackoff
def die(signal: int, frame: FrameType) -> None: def die(signal: int, frame: FrameType) -> None:
"""We actually want to exit, so run os._exit (so as not to be caught and restarted)""" """We actually want to exit, so run os._exit (so as not to be caught and restarted)"""
os._exit(1) os._exit(1)

View file

@ -23,6 +23,11 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
import logging
import optparse
import sys
from configparser import SafeConfigParser
# The following is a table showing which kinds of messages are handled by the # The following is a table showing which kinds of messages are handled by the
# mirror in each mode: # mirror in each mode:
# #
@ -37,18 +42,13 @@
# | other sender| x | | | # | other sender| x | | |
# public mode +-------------+-----+----+--------+---- # public mode +-------------+-----+----+--------+----
# | self sender | | | | # | self sender | | | |
from typing import Dict, List, Set, Optional from typing import Any, Callable, Dict, List, Optional, Set
import logging from sleekxmpp import JID, ClientXMPP, InvalidJID
import optparse
from sleekxmpp import ClientXMPP, InvalidJID, JID
from sleekxmpp.stanza import Message as JabberMessage from sleekxmpp.stanza import Message as JabberMessage
from configparser import SafeConfigParser
import sys
import zulip import zulip
from zulip import Client from zulip import Client
from typing import Any, Callable
__version__ = "1.1" __version__ = "1.1"

View file

@ -5,8 +5,8 @@ import errno
import os import os
import platform import platform
import re import re
import sys
import subprocess import subprocess
import sys
import tempfile import tempfile
import traceback import traceback
@ -25,9 +25,10 @@ except ImportError:
import json import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../")) sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../"))
import zulip
from typing import List from typing import List
import zulip
temp_dir = "/var/tmp/" if os.name == "posix" else tempfile.gettempdir() temp_dir = "/var/tmp/" if os.name == "posix" else tempfile.gettempdir()
def mkdir_p(path: str) -> None: def mkdir_p(path: str) -> None:

View file

@ -1,9 +1,9 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import zulip
from typing import Any, Dict, Text from typing import Any, Dict, Text
import zulip
VERSION = "0.9" VERSION = "0.9"
# Nagios passes the notification details as command line options. # Nagios passes the notification details as command line options.
# In Nagios, "output" means "first line of output", and "long # In Nagios, "output" means "first line of output", and "long

View file

@ -9,12 +9,14 @@ from typing import Dict
sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(0, os.path.dirname(__file__))
import zulip_openshift_config as config import zulip_openshift_config as config
VERSION = '0.1' VERSION = '0.1'
if config.ZULIP_API_PATH is not None: if config.ZULIP_API_PATH is not None:
sys.path.append(config.ZULIP_API_PATH) sys.path.append(config.ZULIP_API_PATH)
import zulip import zulip
client = zulip.Client( client = zulip.Client(
email=config.ZULIP_USER, email=config.ZULIP_USER,
site=config.ZULIP_SITE, site=config.ZULIP_SITE,

View file

@ -1,5 +1,5 @@
# https://github.com/python/mypy/issues/1141 # https://github.com/python/mypy/issues/1141
from typing import Dict, Text, Optional from typing import Dict, Optional, Text
# Change these values to configure authentication for the plugin # Change these values to configure authentication for the plugin
ZULIP_USER = 'openshift-bot@example.com' ZULIP_USER = 'openshift-bot@example.com'

View file

@ -15,8 +15,8 @@ For example:
''' '''
import os import os
import sys
import os.path import os.path
import sys
import git_p4 import git_p4
@ -24,12 +24,14 @@ __version__ = "0.1"
sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(0, os.path.dirname(__file__))
from typing import Any, Dict, Optional from typing import Any, Dict, Optional
import zulip_perforce_config as config import zulip_perforce_config as config
if config.ZULIP_API_PATH is not None: if config.ZULIP_API_PATH is not None:
sys.path.append(config.ZULIP_API_PATH) sys.path.append(config.ZULIP_API_PATH)
import zulip import zulip
client = zulip.Client( client = zulip.Client(
email=config.ZULIP_USER, email=config.ZULIP_USER,
site=config.ZULIP_SITE, site=config.ZULIP_SITE,

View file

@ -3,21 +3,23 @@
# RSS integration for Zulip # RSS integration for Zulip
# #
import argparse
import calendar import calendar
import errno import errno
import hashlib import hashlib
from html.parser import HTMLParser
import logging import logging
import argparse
import os import os
import re import re
import sys import sys
import time import time
import urllib.parse import urllib.parse
from typing import Dict, List, Tuple, Any from html.parser import HTMLParser
from typing import Any, Dict, List, Tuple
import feedparser import feedparser
import zulip import zulip
VERSION = "0.9" # type: str VERSION = "0.9" # type: str
RSS_DATA_DIR = os.path.expanduser(os.path.join('~', '.cache', 'zulip-rss')) # type: str RSS_DATA_DIR = os.path.expanduser(os.path.join('~', '.cache', 'zulip-rss')) # type: str
OLDNESS_THRESHOLD = 30 # type: int OLDNESS_THRESHOLD = 30 # type: int

View file

@ -10,19 +10,22 @@
# /srv/svn/carols 1843 # /srv/svn/carols 1843
import os import os
import sys
import os.path import os.path
import pysvn import sys
from typing import Any, Dict, Optional, Text, Tuple from typing import Any, Dict, Optional, Text, Tuple
import pysvn
sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(0, os.path.dirname(__file__))
import zulip_svn_config as config import zulip_svn_config as config
VERSION = "0.9" VERSION = "0.9"
if config.ZULIP_API_PATH is not None: if config.ZULIP_API_PATH is not None:
sys.path.append(config.ZULIP_API_PATH) sys.path.append(config.ZULIP_API_PATH)
import zulip import zulip
client = zulip.Client( client = zulip.Client(
email=config.ZULIP_USER, email=config.ZULIP_USER,
site=config.ZULIP_SITE, site=config.ZULIP_SITE,

View file

@ -11,12 +11,15 @@
# You may then need to restart trac (or restart Apache) for the bot # You may then need to restart trac (or restart Apache) for the bot
# (or changes to the bot) to actually be loaded by trac. # (or changes to the bot) to actually be loaded by trac.
import os.path
import sys
from trac.core import Component, implements from trac.core import Component, implements
from trac.ticket import ITicketChangeListener from trac.ticket import ITicketChangeListener
import sys
import os.path
sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(0, os.path.dirname(__file__))
import zulip_trac_config as config import zulip_trac_config as config
VERSION = "0.9" VERSION = "0.9"
from typing import Any, Dict from typing import Any, Dict
@ -25,6 +28,7 @@ if config.ZULIP_API_PATH is not None:
sys.path.append(config.ZULIP_API_PATH) sys.path.append(config.ZULIP_API_PATH)
import zulip import zulip
client = zulip.Client( client = zulip.Client(
email=config.ZULIP_USER, email=config.ZULIP_USER,
site=config.ZULIP_SITE, site=config.ZULIP_SITE,

View file

@ -3,8 +3,8 @@
# An easy Trello integration for Zulip. # An easy Trello integration for Zulip.
import sys
import argparse import argparse
import sys
try: try:
import requests import requests

View file

@ -2,12 +2,13 @@
# Twitter integration for Zulip # Twitter integration for Zulip
import argparse
import os import os
import sys import sys
import argparse from configparser import ConfigParser, NoOptionError, NoSectionError
from configparser import ConfigParser, NoSectionError, NoOptionError
import zulip import zulip
VERSION = "0.9" VERSION = "0.9"
CONFIGFILE = os.path.expanduser("~/.zulip_twitterrc") CONFIGFILE = os.path.expanduser("~/.zulip_twitterrc")
INSTRUCTIONS = r""" INSTRUCTIONS = r"""

View file

@ -1,16 +1,17 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys import hashlib
import time import logging
import optparse import optparse
import random import random
import logging
import subprocess import subprocess
import hashlib import sys
import zephyr import time
import zulip
from typing import Dict, List, Set, Tuple from typing import Dict, List, Set, Tuple
import zephyr
import zulip
parser = optparse.OptionParser() parser = optparse.OptionParser()
parser.add_option('--verbose', parser.add_option('--verbose',
dest='verbose', dest='verbose',

View file

@ -1,8 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os
import sys
import subprocess
import base64 import base64
import os
import subprocess
import sys
short_user = sys.argv[1] short_user = sys.argv[1]
api_key = sys.argv[2] api_key = sys.argv[2]

View file

@ -1,14 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys
import os
import logging
import argparse import argparse
import json import json
import logging
import os
import sys
import unicodedata import unicodedata
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'api')) sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'api'))
import zulip import zulip
def write_public_streams() -> None: def write_public_streams() -> None:
public_streams = set() public_streams = set()

View file

@ -1,10 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys
import subprocess
import os import os
import traceback
import signal import signal
import subprocess
import sys
import traceback
sys.path[:0] = [os.path.dirname(__file__)] sys.path[:0] = [os.path.dirname(__file__)]
from zephyr_mirror_backend import parse_args from zephyr_mirror_backend import parse_args
@ -13,6 +13,7 @@ from zephyr_mirror_backend import parse_args
from types import FrameType from types import FrameType
def die(signal: int, frame: FrameType) -> None: def die(signal: int, frame: FrameType) -> None:
# We actually want to exit, so run os._exit (so as not to be caught and restarted) # We actually want to exit, so run os._exit (so as not to be caught and restarted)

View file

@ -1,21 +1,20 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from typing import Any, Dict, IO, List, NoReturn, Optional, Set, Tuple, Union import hashlib
from types import FrameType
import sys
import json import json
import re import logging
import time
import subprocess
import optparse import optparse
import os import os
import textwrap import re
import signal
import logging
import hashlib
import tempfile
import select import select
import signal
import subprocess
import sys
import tempfile
import textwrap
import time
from types import FrameType
from typing import IO, Any, Dict, List, NoReturn, Optional, Set, Tuple, Union
from typing_extensions import Literal, TypedDict from typing_extensions import Literal, TypedDict

View file

@ -1,11 +1,9 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from typing import Any, Dict, Generator, List, Tuple import itertools
import os import os
import sys import sys
from typing import Any, Dict, Generator, List, Tuple
import itertools
with open("README.md") as fh: with open("README.md") as fh:
long_description = fh.read() long_description = fh.read()
@ -73,13 +71,14 @@ setuptools_info = dict(
) )
try: try:
from setuptools import setup, find_packages from setuptools import find_packages, setup
package_info.update(setuptools_info) package_info.update(setuptools_info)
package_info['packages'] = find_packages(exclude=['tests']) package_info['packages'] = find_packages(exclude=['tests'])
except ImportError: except ImportError:
from distutils.core import setup from distutils.core import setup
from distutils.version import LooseVersion from distutils.version import LooseVersion
# Manual dependency check # Manual dependency check
try: try:
import requests import requests

View file

@ -1,15 +1,16 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import os
import io import io
import os
import unittest import unittest
import zulip
from unittest import TestCase from unittest import TestCase
from zulip import ZulipError
from unittest.mock import patch from unittest.mock import patch
import zulip
from zulip import ZulipError
class TestDefaultArguments(TestCase): class TestDefaultArguments(TestCase):
def test_invalid_arguments(self) -> None: def test_invalid_arguments(self) -> None:

View file

@ -1,9 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import unittest import unittest
from unittest import TestCase
import zulip import zulip
from unittest import TestCase
class TestHashUtilDecode(TestCase): class TestHashUtilDecode(TestCase):
def test_hash_util_decode(self) -> None: def test_hash_util_decode(self) -> None:

View file

@ -1,21 +1,34 @@
import json
import requests
import time
import traceback
import sys
import os
import optparse
import argparse import argparse
import json
import logging
import optparse
import os
import platform import platform
import random import random
import sys
import time
import traceback
import types import types
import urllib.parse
from configparser import SafeConfigParser
from distutils.version import LooseVersion from distutils.version import LooseVersion
from typing import (
IO,
Any,
Callable,
Dict,
Iterable,
List,
Mapping,
Optional,
Sequence,
Text,
Tuple,
Union,
)
import distro import distro
from configparser import SafeConfigParser import requests
import urllib.parse
import logging
from typing import Any, Callable, Dict, Iterable, IO, List, Mapping, Optional, Text, Tuple, Union, Sequence
__version__ = "0.8.0" __version__ = "0.8.0"

View file

@ -1,8 +1,9 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse
import os import os
import zulip import zulip
import argparse
def main() -> None: def main() -> None:
usage = """zulip-api-examples [script_name] usage = """zulip-api-examples [script_name]

View file

@ -1,12 +1,12 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import logging import logging
import sys import sys
from typing import Any, Dict, List from typing import Any, Dict, List
import zulip
import click import click
import zulip
logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.basicConfig(stream=sys.stdout, level=logging.INFO)
log = logging.getLogger("zulip-cli") log = logging.getLogger("zulip-cli")

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import json import json
from typing import Dict, List, Any from typing import Any, Dict, List
import zulip import zulip

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
from typing import Any, Dict from typing import Any, Dict
usage = """print-events [options] usage = """print-events [options]

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
from typing import Any, Dict from typing import Any, Dict
usage = """print-messages [options] usage = """print-messages [options]

View file

@ -1,11 +1,12 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
from io import StringIO as _StringIO from io import StringIO as _StringIO
from typing import IO, Any from typing import IO, Any
import zulip import zulip
class StringIO(_StringIO): class StringIO(_StringIO):
name = '' # https://github.com/python/typeshed/issues/598 name = '' # https://github.com/python/typeshed/issues/598

View file

@ -1,7 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from typing import Any, Dict, List
import zulip import zulip
from typing import Any, List, Dict
welcome_text = 'Hello {}, Welcome to Zulip!\n \ welcome_text = 'Hello {}, Welcome to Zulip!\n \
* The first thing you should do is to install the development environment. \ * The first thing you should do is to install the development environment. \

View file

@ -1,10 +1,9 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# zulip-send -- Sends a message to the specified recipients. # zulip-send -- Sends a message to the specified recipients.
import sys
import argparse import argparse
import logging import logging
import sys
from typing import Any, Dict from typing import Any, Dict
import zulip import zulip

View file

@ -70,7 +70,7 @@ setuptools_info = dict(
) )
try: try:
from setuptools import setup, find_packages from setuptools import find_packages, setup
package_info.update(setuptools_info) package_info.update(setuptools_info)
package_info['packages'] = find_packages() package_info['packages'] = find_packages()
package_info['package_data'] = package_data package_info['package_data'] = package_data

View file

@ -1,9 +1,12 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
from typing import Any, List, Dict from typing import Any, Dict, List
from zulip_bots.lib import BotHandler
import requests import requests
from zulip_bots.lib import BotHandler
class BaremetricsHandler: class BaremetricsHandler:
def initialize(self, bot_handler: BotHandler) -> None: def initialize(self, bot_handler: BotHandler) -> None:
self.config_info = bot_handler.get_config_info('baremetrics') self.config_info = bot_handler.get_config_info('baremetrics')

View file

@ -1,7 +1,8 @@
from unittest.mock import patch from unittest.mock import patch
from zulip_bots.test_lib import BotTestCase, DefaultTests
from zulip_bots.test_lib import StubBotHandler
from zulip_bots.bots.baremetrics.baremetrics import BaremetricsHandler from zulip_bots.bots.baremetrics.baremetrics import BaremetricsHandler
from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler
class TestBaremetricsBot(BotTestCase, DefaultTests): class TestBaremetricsBot(BotTestCase, DefaultTests):
bot_name = "baremetrics" bot_name = "baremetrics"

View file

@ -1,9 +1,11 @@
import requests
import logging import logging
from typing import Dict from typing import Dict
from zulip_bots.lib import BotHandler
import requests
from requests.exceptions import ConnectionError from requests.exceptions import ConnectionError
from zulip_bots.lib import BotHandler
help_message = ''' help_message = '''
You can add datapoints towards your beeminder goals \ You can add datapoints towards your beeminder goals \
following the syntax shown below :smile:.\n \ following the syntax shown below :smile:.\n \

View file

@ -1,7 +1,10 @@
from unittest.mock import patch from unittest.mock import patch
from zulip_bots.test_lib import StubBotHandler, BotTestCase, DefaultTests, get_bot_message_handler
from requests.exceptions import ConnectionError from requests.exceptions import ConnectionError
from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler, get_bot_message_handler
class TestBeeminderBot(BotTestCase, DefaultTests): class TestBeeminderBot(BotTestCase, DefaultTests):
bot_name = "beeminder" bot_name = "beeminder"
normal_config = { normal_config = {

View file

@ -1,8 +1,10 @@
import copy
import re
from typing import Any, Dict, Optional
import chess import chess
import chess.uci import chess.uci
import re
import copy
from typing import Any, Optional, Dict
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
START_REGEX = re.compile('start with other user$') START_REGEX = re.compile('start with other user$')

View file

@ -1,5 +1,6 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestChessBot(BotTestCase, DefaultTests): class TestChessBot(BotTestCase, DefaultTests):
bot_name = "chessbot" bot_name = "chessbot"

View file

@ -1,7 +1,8 @@
from zulip_bots.game_handler import GameAdapter
from zulip_bots.bots.connect_four.controller import ConnectFourModel
from typing import Any from typing import Any
from zulip_bots.bots.connect_four.controller import ConnectFourModel
from zulip_bots.game_handler import GameAdapter
class ConnectFourMessageHandler: class ConnectFourMessageHandler:
tokens = [':blue_circle:', ':red_circle:'] tokens = [':blue_circle:', ':red_circle:']

View file

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

View file

@ -1,8 +1,8 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests from typing import Dict, List
from zulip_bots.bots.connect_four.connect_four import ConnectFourModel from zulip_bots.bots.connect_four.connect_four import ConnectFourModel
from zulip_bots.game_handler import BadMoveException from zulip_bots.game_handler import BadMoveException
from typing import Dict, List from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestConnectFourBot(BotTestCase, DefaultTests): class TestConnectFourBot(BotTestCase, DefaultTests):

View file

@ -1,13 +1,13 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
import copy import copy
from math import log10, floor from math import floor, log10
from typing import Any, Dict, List
from zulip_bots.bots.converter import utils from zulip_bots.bots.converter import utils
from typing import Any, Dict, List
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
def is_float(value: Any) -> bool: def is_float(value: Any) -> bool:
try: try:
float(value) float(value)

View file

@ -1,6 +1,6 @@
from zulip_bots.bots.converter import utils
from zulip_bots.test_lib import BotTestCase, DefaultTests from zulip_bots.test_lib import BotTestCase, DefaultTests
from zulip_bots.bots.converter import utils
class TestConverterBot(BotTestCase, DefaultTests): class TestConverterBot(BotTestCase, DefaultTests):
bot_name = "converter" bot_name = "converter"

View file

@ -1,12 +1,14 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
import logging import logging
import requests
import html2text
import string import string
from typing import Dict from typing import Dict
import html2text
import requests
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
class DefineHandler: class DefineHandler:
''' '''
This plugin define a word that the user inputs. It This plugin define a word that the user inputs. It

View file

@ -1,6 +1,8 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests
from unittest.mock import patch from unittest.mock import patch
from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestDefineBot(BotTestCase, DefaultTests): class TestDefineBot(BotTestCase, DefaultTests):
bot_name = "define" bot_name = "define"

View file

@ -1,10 +1,10 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
import logging
import json import json
import logging
from typing import Dict
import apiai import apiai
from typing import Dict
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
help_message = '''DialogFlow bot help_message = '''DialogFlow bot

View file

@ -1,12 +1,10 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests, read_bot_fixture_data import json
from contextlib import contextmanager from contextlib import contextmanager
from typing import ByteString, Iterator
from unittest.mock import patch from unittest.mock import patch
from typing import Iterator, ByteString from zulip_bots.test_lib import BotTestCase, DefaultTests, read_bot_fixture_data
import json
class MockHttplibRequest(): class MockHttplibRequest():
def __init__(self, response: str) -> None: def __init__(self, response: str) -> None:

View file

@ -1,7 +1,9 @@
from dropbox import Dropbox
from typing import Any, Dict, List, Tuple
from zulip_bots.lib import BotHandler
import re import re
from typing import Any, Dict, List, Tuple
from dropbox import Dropbox
from zulip_bots.lib import BotHandler
URL = "[{name}](https://www.dropbox.com/home{path})" URL = "[{name}](https://www.dropbox.com/home{path})"

View file

@ -1,14 +1,15 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests
from unittest.mock import patch from unittest.mock import patch
from zulip_bots.bots.dropbox_share.test_util import ( from zulip_bots.bots.dropbox_share.test_util import (
MockFileMetadata, MockFileMetadata,
MockHttpResponse,
MockListFolderResult, MockListFolderResult,
MockPathLinkMetadata,
MockSearchMatch, MockSearchMatch,
MockSearchResult, MockSearchResult,
MockPathLinkMetadata,
MockHttpResponse
) )
from zulip_bots.test_lib import BotTestCase, DefaultTests
def get_root_files_list(*args, **kwargs): def get_root_files_list(*args, **kwargs):
return MockListFolderResult( return MockListFolderResult(

View file

@ -1,5 +1,6 @@
from typing import List from typing import List
class MockFileMetadata: class MockFileMetadata:
def __init__(self, name: str, path_lower: str): def __init__(self, name: str, path_lower: str):
self.name = name self.name = name

View file

@ -1,6 +1,8 @@
from typing import Dict from typing import Dict
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
def encrypt(text: str) -> str: def encrypt(text: str) -> str:
# This is where the actual ROT13 is applied # This is where the actual ROT13 is applied
# WHY IS .JOIN NOT WORKING?! # WHY IS .JOIN NOT WORKING?!

View file

@ -1,5 +1,6 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestEncryptBot(BotTestCase, DefaultTests): class TestEncryptBot(BotTestCase, DefaultTests):
bot_name = "encrypt" bot_name = "encrypt"

View file

@ -1,8 +1,9 @@
from typing import Dict
from zulip_bots.lib import BotHandler
import os import os
from pathlib import Path from pathlib import Path
from typing import Dict
from zulip_bots.lib import BotHandler
class FileUploaderHandler: class FileUploaderHandler:
def usage(self) -> str: def usage(self) -> str:

View file

@ -1,11 +1,8 @@
from pathlib import Path
from unittest.mock import Mock, patch from unittest.mock import Mock, patch
from zulip_bots.test_lib import ( from zulip_bots.test_lib import BotTestCase, DefaultTests
BotTestCase,
DefaultTests,
)
from pathlib import Path
class TestFileUploaderBot(BotTestCase, DefaultTests): class TestFileUploaderBot(BotTestCase, DefaultTests):
bot_name = "file_uploader" bot_name = "file_uploader"

View file

@ -1,9 +1,11 @@
import logging import logging
from typing import Any, Dict, List, Optional, Tuple
import requests import requests
from typing import Any, Dict, List, Tuple, Optional
from zulip_bots.lib import BotHandler
from requests.exceptions import ConnectionError from requests.exceptions import ConnectionError
from zulip_bots.lib import BotHandler
USERS_LIST_URL = 'https://api.flock.co/v1/roster.listContacts' USERS_LIST_URL = 'https://api.flock.co/v1/roster.listContacts'
SEND_MESSAGE_URL = 'https://api.flock.co/v1/chat.sendMessage' SEND_MESSAGE_URL = 'https://api.flock.co/v1/chat.sendMessage'

View file

@ -1,7 +1,10 @@
from unittest.mock import patch from unittest.mock import patch
from zulip_bots.test_lib import BotTestCase, DefaultTests
from requests.exceptions import ConnectionError from requests.exceptions import ConnectionError
from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestFlockBot(BotTestCase, DefaultTests): class TestFlockBot(BotTestCase, DefaultTests):
bot_name = "flock" bot_name = "flock"
normal_config = {"token": "12345"} normal_config = {"token": "12345"}

View file

@ -1,7 +1,9 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
from typing import Dict from typing import Dict
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
class FollowupHandler: class FollowupHandler:
''' '''
This plugin facilitates creating follow-up tasks when This plugin facilitates creating follow-up tasks when

View file

@ -1,7 +1,4 @@
from zulip_bots.test_lib import ( from zulip_bots.test_lib import BotTestCase, DefaultTests
BotTestCase,
DefaultTests,
)
class TestFollowUpBot(BotTestCase, DefaultTests): class TestFollowUpBot(BotTestCase, DefaultTests):

View file

@ -1,8 +1,11 @@
import requests
import re import re
from typing import Any, Dict from typing import Any, Dict
import requests
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
class FrontHandler: class FrontHandler:
FRONT_API = "https://api2.frontapp.com/conversations/{}" FRONT_API = "https://api2.frontapp.com/conversations/{}"
COMMANDS = [ COMMANDS = [

View file

@ -2,6 +2,7 @@ from typing import Any, Dict, Optional
from zulip_bots.test_lib import BotTestCase, DefaultTests from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestFrontBot(BotTestCase, DefaultTests): class TestFrontBot(BotTestCase, DefaultTests):
bot_name = 'front' bot_name = 'front'

View file

@ -1,5 +1,6 @@
from zulip_bots.game_handler import GameAdapter, BadMoveException from typing import Any, List
from typing import List, Any
from zulip_bots.game_handler import BadMoveException, GameAdapter
class GameHandlerBotMessageHandler: class GameHandlerBotMessageHandler:

View file

@ -1,9 +1,9 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests from typing import Any, Dict, List
from zulip_bots.game_handler import GameInstance
from mock import patch from mock import patch
from typing import Any, Dict, List from zulip_bots.game_handler import GameInstance
from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestGameHandlerBot(BotTestCase, DefaultTests): class TestGameHandlerBot(BotTestCase, DefaultTests):

View file

@ -1,7 +1,8 @@
import copy import copy
from typing import Any, Dict, List, Tuple
from zulip_bots.game_handler import BadMoveException, GameAdapter
from typing import List, Any, Tuple, Dict
from zulip_bots.game_handler import GameAdapter, BadMoveException
class GameOfFifteenModel: class GameOfFifteenModel:

View file

@ -1,8 +1,8 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests from typing import Dict, List, Tuple
from zulip_bots.bots.game_of_fifteen.game_of_fifteen import GameOfFifteenModel from zulip_bots.bots.game_of_fifteen.game_of_fifteen import GameOfFifteenModel
from zulip_bots.game_handler import BadMoveException from zulip_bots.game_handler import BadMoveException
from typing import Dict, List, Tuple from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestGameOfFifteenBot(BotTestCase, DefaultTests): class TestGameOfFifteenBot(BotTestCase, DefaultTests):

View file

@ -1,10 +1,11 @@
from typing import Dict, Union
from zulip_bots.lib import BotHandler
import requests
import logging import logging
from requests.exceptions import HTTPError, ConnectionError from typing import Dict, Union
import requests
from requests.exceptions import ConnectionError, HTTPError
from zulip_bots.custom_exceptions import ConfigValidationError from zulip_bots.custom_exceptions import ConfigValidationError
from zulip_bots.lib import BotHandler
GIPHY_TRANSLATE_API = 'http://api.giphy.com/v1/gifs/translate' GIPHY_TRANSLATE_API = 'http://api.giphy.com/v1/gifs/translate'
GIPHY_RANDOM_API = 'http://api.giphy.com/v1/gifs/random' GIPHY_RANDOM_API = 'http://api.giphy.com/v1/gifs/random'

View file

@ -1,7 +1,9 @@
from unittest.mock import patch from unittest.mock import patch
from requests.exceptions import ConnectionError from requests.exceptions import ConnectionError
from zulip_bots.test_lib import StubBotHandler, BotTestCase, DefaultTests, get_bot_message_handler from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler, get_bot_message_handler
class TestGiphyBot(BotTestCase, DefaultTests): class TestGiphyBot(BotTestCase, DefaultTests):
bot_name = "giphy" bot_name = "giphy"

View file

@ -1,11 +1,12 @@
import re
import logging import logging
import re
from typing import Any, Dict, Tuple, Union
import requests import requests
from typing import Dict, Any, Tuple, Union
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
class GithubHandler: class GithubHandler:
''' '''
This bot provides details on github issues and pull requests when they're This bot provides details on github issues and pull requests when they're

View file

@ -1,9 +1,5 @@
from zulip_bots.test_lib import ( from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler, get_bot_message_handler
StubBotHandler,
BotTestCase,
DefaultTests,
get_bot_message_handler,
)
class TestGithubDetailBot(BotTestCase, DefaultTests): class TestGithubDetailBot(BotTestCase, DefaultTests):
bot_name = "github_detail" bot_name = "github_detail"

View file

@ -1,13 +1,13 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
import logging import logging
from typing import Dict, List
import requests import requests
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from typing import Dict, List
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
def google_search(keywords: str) -> List[Dict[str, str]]: def google_search(keywords: str) -> List[Dict[str, str]]:
query = {'q': keywords} query = {'q': keywords}
# Gets the page # Gets the page

View file

@ -1,6 +1,7 @@
from unittest.mock import patch
from zulip_bots.test_lib import BotTestCase, DefaultTests from zulip_bots.test_lib import BotTestCase, DefaultTests
from unittest.mock import patch
class TestGoogleSearchBot(BotTestCase, DefaultTests): class TestGoogleSearchBot(BotTestCase, DefaultTests):
bot_name = 'google_search' bot_name = 'google_search'

View file

@ -3,6 +3,7 @@
import requests import requests
class GoogleTranslateHandler: class GoogleTranslateHandler:
''' '''
This bot will translate any messages sent to it using google translate. This bot will translate any messages sent to it using google translate.

View file

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

View file

@ -1,8 +1,10 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
from typing import Any, Dict from typing import Any, Dict
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
class HelloWorldHandler: class HelloWorldHandler:
def usage(self) -> str: def usage(self) -> str:
return ''' return '''

View file

@ -1,5 +1,6 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestHelpBot(BotTestCase, DefaultTests): class TestHelpBot(BotTestCase, DefaultTests):
bot_name = "helloworld" # type: str bot_name = "helloworld" # type: str

View file

@ -1,7 +1,9 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
from typing import Dict from typing import Dict
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
class HelpHandler: class HelpHandler:
def usage(self) -> str: def usage(self) -> str:
return ''' return '''

View file

@ -1,5 +1,6 @@
from zulip_bots.test_lib import BotTestCase, DefaultTests from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestHelpBot(BotTestCase, DefaultTests): class TestHelpBot(BotTestCase, DefaultTests):
bot_name = "help" bot_name = "help"

View file

@ -1,8 +1,9 @@
import requests
import logging import logging
import re import re
from typing import Any, Dict, List, Optional
import requests
from typing import Any, Dict, Optional, List
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
API_BASE_URL = "https://beta.idonethis.com/api/v2" API_BASE_URL = "https://beta.idonethis.com/api/v2"

View file

@ -2,6 +2,7 @@ from unittest.mock import patch
from zulip_bots.test_lib import BotTestCase, DefaultTests from zulip_bots.test_lib import BotTestCase, DefaultTests
class TestIDoneThisBot(BotTestCase, DefaultTests): class TestIDoneThisBot(BotTestCase, DefaultTests):
bot_name = "idonethis" # type: str bot_name = "idonethis" # type: str

View file

@ -1,6 +1,7 @@
import json import json
import re import re
from typing import Any, Dict, Tuple from typing import Any, Dict, Tuple
from zulip_bots.lib import BotHandler from zulip_bots.lib import BotHandler
QUESTION = 'How should we handle this?' QUESTION = 'How should we handle this?'

View file

@ -1,8 +1,10 @@
# See readme.md for instructions on running this code. # See readme.md for instructions on running this code.
from typing import Dict from typing import Dict
from zulip_bots.lib import BotHandler, use_storage from zulip_bots.lib import BotHandler, use_storage
class IncrementorHandler: class IncrementorHandler:
META = { META = {
'name': 'Incrementor', 'name': 'Incrementor',

View file

@ -1,11 +1,7 @@
from unittest.mock import patch from unittest.mock import patch
from zulip_bots.test_lib import ( from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler, get_bot_message_handler
get_bot_message_handler,
StubBotHandler,
DefaultTests,
BotTestCase,
)
class TestIncrementorBot(BotTestCase, DefaultTests): class TestIncrementorBot(BotTestCase, DefaultTests):
bot_name = "incrementor" bot_name = "incrementor"

Some files were not shown because too many files have changed in this diff Show more