Reformatting

This commit is contained in:
Administrator 2022-05-12 09:09:05 +02:00
parent 86264d38f5
commit 2a94c4c246
2 changed files with 56 additions and 56 deletions

View File

@ -77,8 +77,8 @@ def update_crontab(p_my_handler):
user_crontab.append(str(element["cron"])) user_crontab.append(str(element["cron"]))
except: except:
user_ids.pop() # if something goes wrong with cron I have to delete matching user id user_ids.pop() # if something goes wrong with cron I have to delete matching user id
except: continue except:
continue
print(user_ids) print(user_ids)
@ -112,9 +112,10 @@ def update_based_on_crontab(p_user_ids, p_user_crontab, p_my_handler):
my_scheduler.start() my_scheduler.start()
time.sleep( 600 ) # scheduler runs in background and I wait 10mins time.sleep(600) # scheduler runs in background and I wait 10mins
my_scheduler.shutdown() # after this the new crontabs will be loaded my_scheduler.shutdown() # after this the new crontabs will be loaded
def update_for_user(p_user_id, p_my_handler): def update_for_user(p_user_id, p_my_handler):
""" Pull shares and send updates for specific user id """ Pull shares and send updates for specific user id
:type p_user_id: integer :type p_user_id: integer
@ -139,7 +140,7 @@ def update_for_user(p_user_id, p_my_handler):
share_amounts.append(element["count"]) share_amounts.append(element["count"])
my_user = p_my_handler.get_user(p_user_id) my_user = p_my_handler.get_user(p_user_id)
send_to_user("Hello %s this is your share update for today:"%str(my_user["username"]), pUser_id=p_user_id) send_to_user("Hello %s this is your share update for today:" % str(my_user["username"]), pUser_id=p_user_id)
shares = p_my_handler.get_user_shares(p_user_id) # all interest shares shares = p_my_handler.get_user_shares(p_user_id) # all interest shares

View File

@ -32,7 +32,7 @@ def get_share_price(str_search_for):
stock_price = round(float(stock_price), 2) stock_price = round(float(stock_price), 2)
str_return =str(stock_price) + " " + str(currency) # return + currency str_return = str(stock_price) + " " + str(currency) # return + currency
return str_return return str_return
@ -48,7 +48,7 @@ def get_share_price(str_search_for):
stock_price = recent_data.iloc[-1]["Close"] stock_price = recent_data.iloc[-1]["Close"]
#convert stock price from currency to EUR # convert stock price from currency to EUR
stock_price = my_Converter.convert(float(stock_price), str(currency), 'EUR') stock_price = my_Converter.convert(float(stock_price), str(currency), 'EUR')
stock_price = round(float(stock_price), 2) stock_price = round(float(stock_price), 2)
@ -109,7 +109,6 @@ def get_share_information(str_search_for):
def get_share_information_markdown(str_search_for): def get_share_information_markdown(str_search_for):
try: try:
search_result = investpy.search_quotes(text=str_search_for, products=['stocks'], search_result = investpy.search_quotes(text=str_search_for, products=['stocks'],
countries=['germany'], n_results=1) countries=['germany'], n_results=1)