Apply Python 3 futurize transform libmodernize.fixes.fix_imports_six
Refer to #256
This commit is contained in:
parent
ab2692b217
commit
f4643de011
|
@ -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__))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue