some small changes, just code style and removing unneccesary stuff
This commit is contained in:
@@ -39,7 +39,7 @@ user_crontab = []
|
||||
|
||||
load_dotenv(dotenv_path='.env')
|
||||
|
||||
def main_loop(): #loop? this is not a loop it is executed once (rename?)
|
||||
def start_updater():
|
||||
""" main loop for regularly sending updates
|
||||
:raises: none
|
||||
|
||||
@@ -49,10 +49,6 @@ def main_loop(): #loop? this is not a loop it is executed once (rename?)
|
||||
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_for_user(5270256395, my_handler) # Debug (running test update for kevins shares)
|
||||
|
||||
|
||||
update_crontab(current_time_datetime, my_handler)
|
||||
|
||||
|
||||
@@ -69,8 +65,6 @@ def update_crontab(pCurrent_Time, p_my_handler):
|
||||
global user_crontab
|
||||
global user_ids
|
||||
|
||||
#p_my_handler.set_cron_interval(user_id = 1770205310, cron_interval = "23 08 * * *")
|
||||
|
||||
all_users = p_my_handler.get_all_users()
|
||||
|
||||
user_ids = []
|
||||
@@ -166,7 +160,7 @@ def update_for_user(p_user_id, p_my_handler):
|
||||
|
||||
|
||||
|
||||
def send_to_user(pText, pUser_id = 1770205310, md_mode = False):
|
||||
def send_to_user(pText, pUser_id , md_mode = False):
|
||||
|
||||
""" Send message to user
|
||||
:type pText: string
|
||||
@@ -193,7 +187,7 @@ if __name__ == "__main__":
|
||||
|
||||
print('bot_updates.py starting.')
|
||||
try:
|
||||
main_loop()
|
||||
start_updater()
|
||||
sys.exit(-1)
|
||||
except KeyboardInterrupt:
|
||||
print("Ending")
|
||||
|
||||
Reference in New Issue
Block a user