Parcourir la source

[Bugfix] index error

Foppe Hemminga il y a 5 ans
Parent
commit
f9e2560a95
1 fichiers modifiés avec 2 ajouts et 3 suppressions
  1. 2 3
      main.py

+ 2 - 3
main.py

@@ -4,7 +4,6 @@ import stocks
 import view
 import database
 
-
 """
     This is the controller file
 """
@@ -32,7 +31,7 @@ def process_drop(this_stock):
     npc_drop = False
     total_stocks = data_latest.total_shares
     previous_available_shares = '{:,} / {:,}'.format(data_latest.available_shares,
-                                                               data_latest.total_shares)
+                                                     data_latest.total_shares)
     if model.is_npc_drop(data_previous, data_latest):
         npc_drop = True
     message = view.create_message(
@@ -96,7 +95,7 @@ if __name__ == '__main__':
     model.put_timestamp_stored(timestamp_latest)
     timestamp_previous = model.get_timestamp_previous(db)  # global
     for stock in stocks.stocks:
-        action = stock[-1]
+        action = stock[4]
         if action == "DROP":
             process_drop(stock)
         if action == "FORECAST":