From b164bf3fff0872b77606db4eae87d0c8caabf6c0 Mon Sep 17 00:00:00 2001 From: erik-dunteman Date: Mon, 24 Jul 2023 13:56:34 -0700 Subject: [PATCH] only print Running init() if user specifies an init --- potassium/potassium.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/potassium/potassium.py b/potassium/potassium.py index 1b45db0..4117138 100644 --- a/potassium/potassium.py +++ b/potassium/potassium.py @@ -31,6 +31,7 @@ class Potassium(): def __init__(self, name): self.name = name + # default init function, if the user doesn't specify one def empty_init(): return {} @@ -53,6 +54,7 @@ def init(self, func): """ def wrapper(): + print(colored("Running init()", 'yellow')) self._context = func() if not isinstance(self._context, dict): raise Exception("Potassium init() must return a dictionary") @@ -204,7 +206,6 @@ def handle(path): # serve runs the http server def serve(self, host="0.0.0.0", port=8000): print(colored("------\nStarting Potassium Server 🍌", 'yellow')) - print(colored("Running init()", 'yellow')) self._init_func() flask_app = self._create_flask_app() server = make_server(host, port, flask_app)