From 040468755c8010435ba7383ca7ec66bc9f3abe48 Mon Sep 17 00:00:00 2001 From: Adam Hopkins Date: Sun, 30 Dec 2018 12:22:27 +0200 Subject: [PATCH] Change ASCII Logo Update logo text Reformat app.py --- sanic/app.py | 10 +++++++--- sanic/config.py | 28 +++++++--------------------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/sanic/app.py b/sanic/app.py index d3c98ba2..811597c7 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -13,7 +13,7 @@ from traceback import format_exc from urllib.parse import urlencode, urlunparse 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.exceptions import SanicException, ServerError, URLBuildError from sanic.handlers import ErrorHandler @@ -1256,10 +1256,14 @@ class Sanic: logger.setLevel(logging.DEBUG) if ( - self.config.LOGO is not None + self.config.LOGO 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: server_settings["run_async"] = True diff --git a/sanic/config.py b/sanic/config.py index 15341829..dda377f8 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -5,32 +5,18 @@ from sanic.exceptions import PyFileError SANIC_PREFIX = "SANIC_" +BASE_LOGO = """ + + Sanic + Build Fast. Run Fast. + +""" class Config(dict): def __init__(self, defaults=None, load_env=True, keep_alive=True): super().__init__(defaults or {}) - self.LOGO = """ - ▄▄▄▄▄ - ▀▀▀██████▄▄▄ _______________ - ▄▄▄▄▄ █████████▄ / \\ - ▀▀▀▀█████▌ ▀▐▄ ▀▐█ | Gotta go fast! | - ▀▀█████▄▄ ▀██████▄██ | _________________/ - ▀▄▄▄▄▄ ▀▀█▄▀█════█▀ |/ - ▀▀▀▄ ▀▀███ ▀ ▄▄ - ▄███▀▀██▄████████▄ ▄▀▀▀▀▀▀█▌ - ██▀▄▄▄██▀▄███▀ ▀▀████ ▄██ -▄▀▀▀▄██▄▀▀▌████▒▒▒▒▒▒███ ▌▄▄▀ -▌ ▐▀████▐███▒▒▒▒▒▐██▌ -▀▄▄▄▄▀ ▀▀████▒▒▒▒▄██▀ - ▀▀█████████▀ - ▄▄██▀██████▀█ - ▄██▀ ▀▀▀ █ - ▄█ ▐▌ - ▄▄▄▄█▌ ▀█▄▄▄▄▀▀▄ -▌ ▐ ▀▀▄▄▄▀ - ▀▀▄▄▀ -""" + self.LOGO = BASE_LOGO self.REQUEST_MAX_SIZE = 100000000 # 100 megabytes self.REQUEST_BUFFER_QUEUE_SIZE = 100 self.REQUEST_TIMEOUT = 60 # 60 seconds