From f2355577736480aa3921056544246571ebcb4f18 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 1 Dec 2023 11:14:19 -0800 Subject: [PATCH] move hilite method as per code review feedback --- app/utils/__init__.py | 8 ++++++++ app/utils/time.py | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/utils/__init__.py b/app/utils/__init__.py index 814ce150c..d5905b712 100644 --- a/app/utils/__init__.py +++ b/app/utils/__init__.py @@ -117,6 +117,14 @@ def hide_from_search_engines(f): return decorated_function +# Function used for debugging. +# Do print(hilite(message)) while debugging, then remove your print statements +def hilite(message): + ansi_green = "\033[32m" + ansi_reset = "\033[0m" + return f"{ansi_green}{message}{ansi_reset}" + + # Function to merge two dict or lists with a JSON-like structure into one. # JSON-like means they can contain all types JSON can: all the main primitives # plus nested lists or dictionaries. diff --git a/app/utils/time.py b/app/utils/time.py index b658fba56..9ae24b1bd 100644 --- a/app/utils/time.py +++ b/app/utils/time.py @@ -22,9 +22,3 @@ def is_less_than_days_ago(date_from_db, number_of_days): def parse_naive_dt(dt): return parser.parse(dt, ignoretz=True) - - -def hilite(message): - ansi_green = "\033[32m" - ansi_reset = "\033[0m" - return f"{ansi_green}{message}{ansi_reset}"