updated debug print

This commit is contained in:
Fredrick W. Warren 2024-12-29 07:41:15 -07:00
parent a77019638d
commit f786cceed1
2 changed files with 4 additions and 4 deletions

View File

@ -30,4 +30,4 @@ EVENT_LIST = ( # ------------- --------
# (--------, [- ], 18, 00, 20, 00, "Main Campus", "Youth Group", "South County Youth Group 6:00pm", ""), # (--------, [- ], 18, 00, 20, 00, "Main Campus", "Youth Group", "South County Youth Group 6:00pm", ""),
) )
DEBUG = False DEBUG = True

View File

@ -13,7 +13,7 @@ from dataclass_csv import DataclassWriter
from events import EVENT_LIST, YEAR, DEBUG from events import EVENT_LIST, YEAR, DEBUG
def debug_print(data, condition=True): def debug_print(data, condition=True, end="\n"):
"""Conditionally print data using pprint. """Conditionally print data using pprint.
Args: Args:
@ -21,7 +21,7 @@ def debug_print(data, condition=True):
condition: A boolean value. If True, the data will be printed. condition: A boolean value. If True, the data will be printed.
""" """
if condition: if condition:
pprint(data) print(data, end=end)
""" """
@ -142,7 +142,7 @@ def process_month(MONTHS, monthly_events, week_of_month, week, events):
month, week_of_month, day_of_week, day month, week_of_month, day_of_week, day
use monthly_events[day_of_week] use monthly_events[day_of_week]
""" """
debug_print(f" {day_of_week}-{day:02d}", DEBUG) debug_print(f" {day_of_week}-{day:02d}", DEBUG," ")
day_events = [x[1:] for x in monthly_events[day_of_week] if week_of_month + 1 in x[0]] day_events = [x[1:] for x in monthly_events[day_of_week] if week_of_month + 1 in x[0]]
debug_print(day_events, DEBUG) debug_print(day_events, DEBUG)
debug_print("", DEBUG) debug_print("", DEBUG)