diff --git a/sanic/__init__.py b/sanic/__init__.py index 786b6647..a6e7ba72 100644 --- a/sanic/__init__.py +++ b/sanic/__init__.py @@ -1,6 +1,7 @@ from sanic.app import Sanic from sanic.blueprints import Blueprint + __version__ = "0.8.3" __all__ = ["Sanic", "Blueprint"] diff --git a/sanic/__main__.py b/sanic/__main__.py index ede743fd..9bef96fc 100644 --- a/sanic/__main__.py +++ b/sanic/__main__.py @@ -1,8 +1,9 @@ from argparse import ArgumentParser from importlib import import_module -from sanic.log import logger from sanic.app import Sanic +from sanic.log import logger + if __name__ == "__main__": parser = ArgumentParser(prog="sanic") diff --git a/sanic/app.py b/sanic/app.py index 9fa2e4ce..9ef65260 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -1,29 +1,31 @@ -import os import logging import logging.config +import os import re import warnings -from asyncio import get_event_loop, ensure_future, CancelledError -from collections import deque, defaultdict + +from asyncio import CancelledError, ensure_future, get_event_loop +from collections import defaultdict, deque from functools import partial from inspect import getmodulename, isawaitable, signature, stack +from ssl import Purpose, create_default_context from traceback import format_exc from urllib.parse import urlencode, urlunparse -from ssl import create_default_context, Purpose + +import sanic.reloader_helpers as reloader_helpers from sanic.config import Config from sanic.constants import HTTP_METHODS -from sanic.exceptions import ServerError, URLBuildError, SanicException +from sanic.exceptions import SanicException, ServerError, URLBuildError from sanic.handlers import ErrorHandler -from sanic.log import logger, error_logger, LOGGING_CONFIG_DEFAULTS +from sanic.log import LOGGING_CONFIG_DEFAULTS, error_logger, logger from sanic.response import HTTPResponse, StreamingHTTPResponse from sanic.router import Router -from sanic.server import serve, serve_multiple, HttpProtocol, Signal +from sanic.server import HttpProtocol, Signal, serve, serve_multiple from sanic.static import register as static_register from sanic.testing import SanicTestClient from sanic.views import CompositionView -from sanic.websocket import WebSocketProtocol, ConnectionClosed -import sanic.reloader_helpers as reloader_helpers +from sanic.websocket import ConnectionClosed, WebSocketProtocol class Sanic: diff --git a/sanic/blueprints.py b/sanic/blueprints.py index c148a952..c837a2a9 100644 --- a/sanic/blueprints.py +++ b/sanic/blueprints.py @@ -3,6 +3,7 @@ from collections import defaultdict, namedtuple from sanic.constants import HTTP_METHODS from sanic.views import CompositionView + FutureRoute = namedtuple( "Route", [ diff --git a/sanic/cookies.py b/sanic/cookies.py index 7d323529..fc49ecfd 100644 --- a/sanic/cookies.py +++ b/sanic/cookies.py @@ -1,6 +1,7 @@ import re import string + # ------------------------------------------------------------ # # SimpleCookie # ------------------------------------------------------------ # diff --git a/sanic/exceptions.py b/sanic/exceptions.py index 6e9323a9..35318ac9 100644 --- a/sanic/exceptions.py +++ b/sanic/exceptions.py @@ -1,5 +1,6 @@ from sanic.helpers import STATUS_CODES + TRACEBACK_STYLE = """