From 05bd1948f3e200f028e1e46b2ecc6e288bc9b8a0 Mon Sep 17 00:00:00 2001 From: Florian Kellermann Date: Tue, 26 Apr 2022 07:39:06 +0200 Subject: [PATCH] removed some stuff --- telegram_bot/bot_updates.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/telegram_bot/bot_updates.py b/telegram_bot/bot_updates.py index c6dce42..1816581 100644 --- a/telegram_bot/bot_updates.py +++ b/telegram_bot/bot_updates.py @@ -40,19 +40,18 @@ user_crontab = [] load_dotenv(dotenv_path='.env') def start_updater(): - """ main loop for regularly sending updates + """ starting function for regularly sending updates :raises: none :rtype: none """ - current_time_datetime = datetime.datetime.now() my_handler = API_Handler("https://gruppe1.testsites.info/api", str(os.getenv("BOT_EMAIL")), str(os.getenv("BOT_PASSWORD"))) - update_crontab(current_time_datetime, my_handler) + update_crontab(my_handler) -def update_crontab(pCurrent_Time, p_my_handler): +def update_crontab(p_my_handler): """ Updating crontab lists every hour :type pCurrent_Time: time when starting crontab update :param pCurrent_Time: datetime @@ -79,7 +78,7 @@ def update_crontab(pCurrent_Time, p_my_handler): update_based_on_crontab(user_ids, user_crontab, p_my_handler) - update_crontab(datetime.datetime.now(), p_my_handler) + update_crontab(p_my_handler) def update_based_on_crontab(p_user_ids, p_user_crontab, p_my_handler): @@ -101,8 +100,6 @@ def update_based_on_crontab(p_user_ids, p_user_crontab, p_my_handler): my_scheduler = BackgroundScheduler() - print(len(user_ids)) #Debug - for i in range(len(p_user_ids)): cron_split = p_user_crontab[i].split(" ") print(cron_split[4], cron_split[1], cron_split[0], cron_split[3], cron_split[2]) @@ -184,8 +181,6 @@ def send_to_user(pText, pUser_id , md_mode = False): if __name__ == "__main__": - - print('bot_updates.py starting.') try: start_updater() sys.exit(-1)