Pārlūkot izejas kodu

Removed some unneeded lines

Foppe Hemminga 6 gadi atpakaļ
vecāks
revīzija
fb76626c22
2 mainītis faili ar 4 papildinājumiem un 7 dzēšanām
  1. 3 7
      model.py
  2. 1 0
      view.py

+ 3 - 7
model.py

@@ -46,12 +46,8 @@ def _get_status(this_id):
     this_status = this_json
     # pprint(this_status)
     status_return = None
-    if 'alert' not in this_status:
-        print('alert not in this_status')
-        pprint(this_status)
-        this_status['alert'] = {'15': False, '10': False, '5': False, '1': False}
     if this_status:
-        status_return = this_status['status'], this_status['name'], this_status['timestamp'], this_status['alert']
+        status_return = this_status['status'], this_status['name'], this_status['timestamp']
     return status_return
 
 
@@ -76,14 +72,14 @@ def _from_roman_to_integer(roman_number):
 
 def get_loot_level(this_id):
     this_loot_level = 0
-    this_status_status, this_status_name, this_status_timestamp, this_status_alert = _get_status(this_id)
+    this_status_status, this_status_name, this_status_timestamp = _get_status(this_id)
     if this_status_status and len(this_status_status) > 1:
         if this_status_status[0] == 'Okay' and 'Loot level' in this_status_status[1]:
             this_loot_level = this_status_status[1][11:].strip()
     # print(this_loot_level)
     this_integer = _from_roman_to_integer(this_loot_level)
     this_status_dict = {"id": this_id, "name": this_status_name, "integer": this_integer, "roman": this_loot_level,
-                        "text": this_status_status, "timestamp": this_status_timestamp, "alert": this_status_alert}
+                        "text": this_status_status, "timestamp": this_status_timestamp}
     return this_status_dict
 
 

+ 1 - 0
view.py

@@ -34,6 +34,7 @@ def _send(send_json):
         webhook = webhooks[webhook_key]
         if 'Alert: 10 mins' in send_json['content'] and webhook_key == 'Unrelenting':
             send_json['content'] = '@here ' + send_json['content']
+        pprint(send_json)
         url = base_url+webhook
         response = requests.post(url, json=send_json)
         if response.status_code in [200, 204]: