removed some stuff

This commit is contained in:
Florian Kellermann 2022-04-26 07:39:06 +02:00
parent 1697928545
commit 05bd1948f3

View File

@ -40,19 +40,18 @@ user_crontab = []
load_dotenv(dotenv_path='.env') load_dotenv(dotenv_path='.env')
def start_updater(): def start_updater():
""" main loop for regularly sending updates """ starting function for regularly sending updates
:raises: none :raises: none
:rtype: 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"))) 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 """ Updating crontab lists every hour
:type pCurrent_Time: time when starting crontab update :type pCurrent_Time: time when starting crontab update
:param pCurrent_Time: datetime :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_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): 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() my_scheduler = BackgroundScheduler()
print(len(user_ids)) #Debug
for i in range(len(p_user_ids)): for i in range(len(p_user_ids)):
cron_split = p_user_crontab[i].split(" ") cron_split = p_user_crontab[i].split(" ")
print(cron_split[4], cron_split[1], cron_split[0], cron_split[3], cron_split[2]) 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__": if __name__ == "__main__":
print('bot_updates.py starting.')
try: try:
start_updater() start_updater()
sys.exit(-1) sys.exit(-1)