tornado: Sort imports in files with no merge conflicts.

This commit is contained in:
Tim Abbott 2017-11-15 15:53:11 -08:00
parent 10ab9410c9
commit dc8dd2333c
5 changed files with 35 additions and 39 deletions

View File

@ -1,14 +1,13 @@
import atexit import atexit
from django.conf import settings
from zerver.tornado.handlers import AsyncDjangoHandler
from zerver.tornado.socket import get_sockjs_router
from zerver.lib.queue import get_queue_client
import tornado.autoreload import tornado.autoreload
import tornado.web import tornado.web
from django.conf import settings
from zerver.lib.queue import get_queue_client
from zerver.tornado.handlers import AsyncDjangoHandler
from zerver.tornado.socket import get_sockjs_router
def setup_tornado_rabbitmq() -> None: def setup_tornado_rabbitmq() -> None:
# When tornado is shut down, disconnect cleanly from rabbitmq # When tornado is shut down, disconnect cleanly from rabbitmq

View File

@ -2,7 +2,7 @@ from typing import Text
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from zerver.lib.exceptions import JsonableError, ErrorCode from zerver.lib.exceptions import ErrorCode, JsonableError
class BadEventQueueIdError(JsonableError): class BadEventQueueIdError(JsonableError):
code = ErrorCode.BAD_EVENT_QUEUE_ID code = ErrorCode.BAD_EVENT_QUEUE_ID

View File

@ -1,29 +1,28 @@
import sys
import tornado.web
import logging import logging
import sys
import urllib
from threading import Lock
from typing import Any, Callable, Dict, List, Optional
import tornado.web
from django import http from django import http
from django.conf import settings from django.conf import settings
from django.core.handlers.wsgi import WSGIRequest, get_script_name from django.core import exceptions, signals, urlresolvers
from django.core.exceptions import MiddlewareNotUsed
from django.core.handlers import base from django.core.handlers import base
from django.core.handlers.exception import convert_exception_to_response from django.core.handlers.exception import convert_exception_to_response
from django.core.handlers.wsgi import WSGIRequest, get_script_name
from django.core.urlresolvers import set_script_prefix from django.core.urlresolvers import set_script_prefix
from django.core import signals
from django.core import exceptions, urlresolvers
from django.core.exceptions import MiddlewareNotUsed
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.module_loading import import_string from django.utils.module_loading import import_string
from threading import Lock
from tornado.wsgi import WSGIContainer from tornado.wsgi import WSGIContainer
import urllib
from zerver.decorator import RespondAsynchronously from zerver.decorator import RespondAsynchronously
from zerver.lib.response import json_response from zerver.lib.response import json_response
from zerver.middleware import async_request_stop, async_request_restart from zerver.middleware import async_request_restart, async_request_stop
from zerver.tornado.descriptors import get_descriptor_by_handler_id from zerver.tornado.descriptors import get_descriptor_by_handler_id
from typing import Any, Callable, Dict, List, Optional
current_handler_id = 0 current_handler_id = 0
handlers = {} # type: Dict[int, 'AsyncDjangoHandler'] handlers = {} # type: Dict[int, 'AsyncDjangoHandler']

View File

@ -1,11 +1,11 @@
import logging
import select
import time
from typing import Any, List, Tuple from typing import Any, List, Tuple
import logging
import time
import select
from django.conf import settings from django.conf import settings
from tornado.ioloop import IOLoop, PollIOLoop from tornado.ioloop import IOLoop, PollIOLoop
# There isn't a good way to get at what the underlying poll implementation # There isn't a good way to get at what the underlying poll implementation
# will be without actually constructing an IOLoop, so we just assume it will # will be without actually constructing an IOLoop, so we just assume it will
# be epoll. # be epoll.

View File

@ -1,23 +1,21 @@
from django.utils.translation import ugettext as _
from django.http import HttpRequest, HttpResponse
from zerver.models import get_client, UserProfile, Client
from zerver.decorator import asynchronous, \
internal_notify_view, RespondAsynchronously, \
has_request_variables, REQ, _RespondAsynchronously
from zerver.lib.response import json_success, json_error
from zerver.lib.validator import check_bool, check_list, check_string
from zerver.tornado.event_queue import get_client_descriptor, \
process_notification, fetch_events
from zerver.tornado.exceptions import BadEventQueueIdError
from django.core.handlers.base import BaseHandler
from typing import Union, Optional, Iterable, Sequence, List, Text
import time import time
from typing import Iterable, List, Optional, Sequence, Text, Union
import ujson import ujson
from django.core.handlers.base import BaseHandler
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import REQ, RespondAsynchronously, \
_RespondAsynchronously, asynchronous, \
has_request_variables, internal_notify_view
from zerver.lib.response import json_error, json_success
from zerver.lib.validator import check_bool, check_list, check_string
from zerver.models import Client, UserProfile, get_client
from zerver.tornado.event_queue import fetch_events, \
get_client_descriptor, process_notification
from zerver.tornado.exceptions import BadEventQueueIdError
@internal_notify_view(True) @internal_notify_view(True)
def notify(request: HttpRequest) -> HttpResponse: def notify(request: HttpRequest) -> HttpResponse: