From f4643de01132b59cc09befd37d334f658af07637 Mon Sep 17 00:00:00 2001 From: Eklavya Sharma Date: Thu, 10 Mar 2016 22:58:02 +0530 Subject: [PATCH] Apply Python 3 futurize transform libmodernize.fixes.fix_imports_six Refer to #256 --- integrations/basecamp/zulip_basecamp_mirror | 2 +- integrations/rss/rss-bot | 2 +- integrations/twitter/twitter-bot | 10 +++++----- integrations/twitter/twitter-search-bot | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/integrations/basecamp/zulip_basecamp_mirror b/integrations/basecamp/zulip_basecamp_mirror index 54e0044..ef38869 100755 --- a/integrations/basecamp/zulip_basecamp_mirror +++ b/integrations/basecamp/zulip_basecamp_mirror @@ -34,7 +34,7 @@ import re import sys import os from datetime import datetime, timedelta -from HTMLParser import HTMLParser +from six.moves.html_parser import HTMLParser import six sys.path.insert(0, os.path.dirname(__file__)) diff --git a/integrations/rss/rss-bot b/integrations/rss/rss-bot index 07a5808..b238315 100755 --- a/integrations/rss/rss-bot +++ b/integrations/rss/rss-bot @@ -27,7 +27,7 @@ from __future__ import print_function import calendar import errno import hashlib -from HTMLParser import HTMLParser +from six.moves.html_parser import HTMLParser import logging import optparse import os diff --git a/integrations/twitter/twitter-bot b/integrations/twitter/twitter-bot index e7ab8b6..c71fc4e 100755 --- a/integrations/twitter/twitter-bot +++ b/integrations/twitter/twitter-bot @@ -27,7 +27,7 @@ from __future__ import print_function import os import sys import optparse -import ConfigParser +import six.moves.configparser import zulip VERSION = "0.9" @@ -86,14 +86,14 @@ if not options.twitter_id: parser.error('You must specify --twitter-id') try: - config = ConfigParser.ConfigParser() + config = six.moves.configparser.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 (ConfigParser.NoSectionError, ConfigParser.NoOptionError): +except (six.moves.configparser.NoSectionError, six.moves.configparser.NoOptionError): parser.error("Please provide a ~/.zulip_twitterrc") if not consumer_key or not consumer_secret or not access_token_key or not access_token_secret: @@ -118,12 +118,12 @@ if not user.GetId(): try: since_id = config.getint('twitter', 'since_id') -except ConfigParser.NoOptionError: +except six.moves.configparser.NoOptionError: since_id = -1 try: user_id = config.get('twitter', 'user_id') -except ConfigParser.NoOptionError: +except six.moves.configparser.NoOptionError: user_id = options.twitter_id client = zulip.Client( diff --git a/integrations/twitter/twitter-search-bot b/integrations/twitter/twitter-search-bot index 6e29bc0..f097170 100755 --- a/integrations/twitter/twitter-search-bot +++ b/integrations/twitter/twitter-search-bot @@ -27,7 +27,7 @@ from __future__ import print_function import os import sys import optparse -import ConfigParser +import six.moves.configparser import zulip VERSION = "0.9" @@ -108,14 +108,14 @@ if not opts.search_terms: parser.error('You must specify a search term.') try: - config = ConfigParser.ConfigParser() + config = six.moves.configparser.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 (ConfigParser.NoSectionError, ConfigParser.NoOptionError): +except (six.moves.configparser.NoSectionError, six.moves.configparser.NoOptionError): parser.error("Please provide a ~/.zulip_twitterrc") if not (consumer_key and consumer_secret and access_token_key and access_token_secret): @@ -123,7 +123,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 (ConfigParser.NoOptionError, ConfigParser.NoSectionError): +except (six.moves.configparser.NoOptionError, six.moves.configparser.NoSectionError): since_id = 0 try: