mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
Apply Python 3 futurize transform libmodernize.fixes.fix_imports_six.
This commit is contained in:
@@ -34,7 +34,7 @@ import urllib
|
||||
import random
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
from ConfigParser import SafeConfigParser
|
||||
from six.moves.configparser import SafeConfigParser
|
||||
import logging
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import optparse
|
||||
|
||||
from sleekxmpp import ClientXMPP, InvalidJID, JID
|
||||
from sleekxmpp.exceptions import IqError, IqTimeout
|
||||
from ConfigParser import SafeConfigParser
|
||||
from six.moves.configparser import SafeConfigParser
|
||||
import os, sys, zulip, getpass
|
||||
import re
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import glob
|
||||
import twitter
|
||||
import platform
|
||||
import time
|
||||
import HTMLParser
|
||||
import six.moves.html_parser
|
||||
import httplib2
|
||||
import itertools
|
||||
import urllib
|
||||
@@ -433,7 +433,7 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor):
|
||||
|
||||
## TODO: unescape is an internal function, so we should
|
||||
## use something else if we can find it
|
||||
text = HTMLParser.HTMLParser().unescape(res['text'])
|
||||
text = six.moves.html_parser.HTMLParser().unescape(res['text'])
|
||||
urls = res.get('urls', {})
|
||||
user_mentions = res.get('user_mentions', [])
|
||||
media = res.get('media', [])
|
||||
|
||||
@@ -10,7 +10,7 @@ import socket
|
||||
import logging
|
||||
import ujson
|
||||
import requests
|
||||
import cPickle as pickle
|
||||
import six.moves.cPickle as pickle
|
||||
import atexit
|
||||
import sys
|
||||
import signal
|
||||
|
||||
@@ -4,7 +4,7 @@ from __future__ import print_function
|
||||
from django.core.management.base import BaseCommand
|
||||
from zerver.models import get_user_profile_by_email, UserProfile
|
||||
import os
|
||||
from ConfigParser import SafeConfigParser
|
||||
from six.moves.configparser import SafeConfigParser
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = """Sync your API key from ~/.zuliprc into your development instance"""
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
# On a normal Zulip production server, zproject/local_settings.py is a
|
||||
# symlink to /etc/zulip/settings.py (based off local_settings_template.py).
|
||||
import platform
|
||||
import ConfigParser
|
||||
import six.moves.configparser
|
||||
from base64 import b64decode
|
||||
|
||||
config_file = ConfigParser.RawConfigParser()
|
||||
config_file = six.moves.configparser.RawConfigParser()
|
||||
config_file.read("/etc/zulip/zulip.conf")
|
||||
|
||||
# Whether we're running in a production environment. Note that PRODUCTION does
|
||||
|
||||
@@ -12,7 +12,7 @@ import os
|
||||
import platform
|
||||
import time
|
||||
import sys
|
||||
import ConfigParser
|
||||
import six.moves.configparser
|
||||
|
||||
from zerver.lib.db import TimeTrackingConnection
|
||||
|
||||
@@ -20,14 +20,14 @@ from zerver.lib.db import TimeTrackingConnection
|
||||
# INITIAL SETTINGS
|
||||
########################################################################
|
||||
|
||||
config_file = ConfigParser.RawConfigParser()
|
||||
config_file = six.moves.configparser.RawConfigParser()
|
||||
config_file.read("/etc/zulip/zulip.conf")
|
||||
|
||||
# Whether this instance of Zulip is running in a production environment.
|
||||
PRODUCTION = config_file.has_option('machine', 'deploy_type')
|
||||
DEVELOPMENT = not PRODUCTION
|
||||
|
||||
secrets_file = ConfigParser.RawConfigParser()
|
||||
secrets_file = six.moves.configparser.RawConfigParser()
|
||||
if PRODUCTION:
|
||||
secrets_file.read("/etc/zulip/zulip-secrets.conf")
|
||||
else:
|
||||
@@ -374,7 +374,7 @@ try:
|
||||
domain = config_file.get('django', 'cookie_domain')
|
||||
SESSION_COOKIE_DOMAIN = '.' + domain
|
||||
CSRF_COOKIE_DOMAIN = '.' + domain
|
||||
except ConfigParser.Error:
|
||||
except six.moves.configparser.Error:
|
||||
# Failing here is OK
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user