From afba6a4364baffd20f135f3e276a550c206199bd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 21 Feb 2022 16:58:37 +0000 Subject: [PATCH] Snake case --- happening.py | 6 +++--- webapp_calendar.py | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/happening.py b/happening.py index 5590de4df..afb7ec281 100644 --- a/happening.py +++ b/happening.py @@ -178,7 +178,7 @@ def _is_happening_post(post_json_object: {}) -> bool: def get_todays_events(base_dir: str, nickname: str, domain: str, curr_year: int, curr_month_number: int, - currDayOfMonth: int) -> {}: + curr_day_of_month: int) -> {}: """Retrieves calendar events for today Returns a dictionary of lists containing Event and Place activities """ @@ -191,10 +191,10 @@ def get_todays_events(base_dir: str, nickname: str, domain: str, month_number = now.month else: month_number = curr_month_number - if not currDayOfMonth: + if not curr_day_of_month: day_number = now.day else: - day_number = currDayOfMonth + day_number = curr_day_of_month calendar_filename = \ acct_dir(base_dir, nickname, domain) + \ diff --git a/webapp_calendar.py b/webapp_calendar.py index d5f6f24e2..be512ab86 100644 --- a/webapp_calendar.py +++ b/webapp_calendar.py @@ -267,9 +267,11 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {}, """ domain = remove_domain_port(domain_full) - month_number = 0 + default_year = 1970 + default_month = 0 + month_number = default_month day_number = None - year = 1970 + year = default_year actor = http_prefix + '://' + domain_full + path.replace('/calendar', '') if '?' in actor: first = True @@ -296,7 +298,7 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {}, actor = actor.split('?')[0] curr_date = datetime.now() - if year == 1970 and month_number == 0: + if year == default_year and month_number == default_month: year = curr_date.year month_number = curr_date.month @@ -318,7 +320,6 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {}, year, month_number, day_number, person_cache) - day_events = None events = \ get_todays_events(base_dir, nickname, domain,