From 246ac7cadc89888a677e6159fdfb83d414c90daa Mon Sep 17 00:00:00 2001 From: Sampriti Panda Date: Sun, 1 Jan 2017 02:01:28 +0530 Subject: [PATCH] mypy: Annotate api/integrations/twitter/twitter-search-bot --- api/integrations/twitter/twitter-search-bot | 9 +++++---- tools/run-mypy | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/integrations/twitter/twitter-search-bot b/api/integrations/twitter/twitter-search-bot index 93e3538d22..a10bca7cfd 100755 --- a/api/integrations/twitter/twitter-search-bot +++ b/api/integrations/twitter/twitter-search-bot @@ -27,13 +27,14 @@ from __future__ import print_function import os import sys import optparse -import six.moves.configparser +from six.moves.configparser import ConfigParser, NoSectionError, NoOptionError import zulip VERSION = "0.9" CONFIGFILE = os.path.expanduser("~/.zulip_twitterrc") def write_config(config, since_id): + # type: (ConfigParser, int) -> None if 'search' not in config.sections(): config.add_section('search') config.set('search', 'since_id', since_id) @@ -111,14 +112,14 @@ if not opts.search_terms: parser.error('You must specify a search term.') try: - config = six.moves.configparser.ConfigParser() + config = ConfigParser() config.read(CONFIGFILE) consumer_key = config.get('twitter', 'consumer_key') consumer_secret = config.get('twitter', 'consumer_secret') access_token_key = config.get('twitter', 'access_token_key') access_token_secret = config.get('twitter', 'access_token_secret') -except (six.moves.configparser.NoSectionError, six.moves.configparser.NoOptionError): +except (NoSectionError, NoOptionError): parser.error("Please provide a ~/.zulip_twitterrc") if not (consumer_key and consumer_secret and access_token_key and access_token_secret): @@ -126,7 +127,7 @@ if not (consumer_key and consumer_secret and access_token_key and access_token_s try: since_id = config.getint('search', 'since_id') -except (six.moves.configparser.NoOptionError, six.moves.configparser.NoSectionError): +except (NoOptionError, NoSectionError): since_id = 0 try: diff --git a/tools/run-mypy b/tools/run-mypy index fbd78edc95..220025b875 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -30,7 +30,6 @@ api/integrations/basecamp/zulip_basecamp_mirror api/integrations/codebase/zulip_codebase_mirror api/integrations/git/post-receive api/integrations/rss/rss-bot -api/integrations/twitter/twitter-search-bot tools/deprecated/iframe-bot/show-last-messages tools/deprecated/inject-messages/inject-messages zproject/settings.py