Change ASCII Logo

Update logo text

Reformat app.py
This commit is contained in:
Adam Hopkins 2018-12-30 12:22:27 +02:00
parent 50b359fdb2
commit 040468755c
No known key found for this signature in database
GPG Key ID: 7028135130579DF1
2 changed files with 14 additions and 24 deletions

View File

@ -13,7 +13,7 @@ from traceback import format_exc
from urllib.parse import urlencode, urlunparse from urllib.parse import urlencode, urlunparse
from sanic import reloader_helpers from sanic import reloader_helpers
from sanic.config import Config from sanic.config import Config, BASE_LOGO
from sanic.constants import HTTP_METHODS from sanic.constants import HTTP_METHODS
from sanic.exceptions import SanicException, ServerError, URLBuildError from sanic.exceptions import SanicException, ServerError, URLBuildError
from sanic.handlers import ErrorHandler from sanic.handlers import ErrorHandler
@ -1256,10 +1256,14 @@ class Sanic:
logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)
if ( if (
self.config.LOGO is not None self.config.LOGO
and os.environ.get("SANIC_SERVER_RUNNING") != "true" and os.environ.get("SANIC_SERVER_RUNNING") != "true"
): ):
logger.debug(self.config.LOGO) logger.debug(
self.config.LOGO
if isinstance(self.config.LOGO, str)
else BASE_LOGO
)
if run_async: if run_async:
server_settings["run_async"] = True server_settings["run_async"] = True

View File

@ -5,32 +5,18 @@ from sanic.exceptions import PyFileError
SANIC_PREFIX = "SANIC_" SANIC_PREFIX = "SANIC_"
BASE_LOGO = """
Sanic
Build Fast. Run Fast.
"""
class Config(dict): class Config(dict):
def __init__(self, defaults=None, load_env=True, keep_alive=True): def __init__(self, defaults=None, load_env=True, keep_alive=True):
super().__init__(defaults or {}) super().__init__(defaults or {})
self.LOGO = """ self.LOGO = BASE_LOGO
_______________
/ \\
| Gotta go fast! |
| _________________/
|/
"""
self.REQUEST_MAX_SIZE = 100000000 # 100 megabytes self.REQUEST_MAX_SIZE = 100000000 # 100 megabytes
self.REQUEST_BUFFER_QUEUE_SIZE = 100 self.REQUEST_BUFFER_QUEUE_SIZE = 100
self.REQUEST_TIMEOUT = 60 # 60 seconds self.REQUEST_TIMEOUT = 60 # 60 seconds