|
@@ -1,16 +1,15 @@
|
|
|
#! venv/bin/python
|
|
#! venv/bin/python
|
|
|
import json
|
|
import json
|
|
|
import sys
|
|
import sys
|
|
|
|
|
+from pprint import pprint
|
|
|
|
|
|
|
|
import model
|
|
import model
|
|
|
import view
|
|
import view
|
|
|
|
|
|
|
|
-import types
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
status = model.get_loot_level()
|
|
status = model.get_loot_level()
|
|
|
- print(status)
|
|
|
|
|
|
|
+ # print(status)
|
|
|
old_status = 0
|
|
old_status = 0
|
|
|
write_file_next = False
|
|
write_file_next = False
|
|
|
try:
|
|
try:
|
|
@@ -28,18 +27,20 @@ if __name__ == '__main__':
|
|
|
print('Created new file ... Exiting')
|
|
print('Created new file ... Exiting')
|
|
|
empty_status_file.close()
|
|
empty_status_file.close()
|
|
|
sys.exit(1)
|
|
sys.exit(1)
|
|
|
- print(old_status)
|
|
|
|
|
|
|
+ # print(old_status)
|
|
|
send_message = False
|
|
send_message = False
|
|
|
- print('if old_status {} != status[1] {}'.format(old_status, status[1]))
|
|
|
|
|
- assert type(old_status) is types.IntType, f"old_status {old_status} is not an integer: {type(old_status)}"
|
|
|
|
|
- assert type(status[1]) is types.IntType, f"status[1] {status[1]} is not an integer: {type(status[1])}"
|
|
|
|
|
|
|
+ # print('if old_status {} != status[1] {}'.format(old_status, status[1]))
|
|
|
|
|
+ assert type(old_status) is int, f"old_status {old_status} is not an integer: {type(old_status)}"
|
|
|
|
|
+ assert type(status[1]) is int, f"status[1] {status[1]} is not an integer: {type(status[1])}"
|
|
|
if old_status != status[1]:
|
|
if old_status != status[1]:
|
|
|
write_file_next = True
|
|
write_file_next = True
|
|
|
send_message = True
|
|
send_message = True
|
|
|
- print('write_file_next: {}'.format(write_file_next))
|
|
|
|
|
|
|
+ # print('write_file_next: {}'.format(write_file_next))
|
|
|
if write_file_next:
|
|
if write_file_next:
|
|
|
summary = {'text': status[2], 'roman': status[0], 'integer': status[1]}
|
|
summary = {'text': status[2], 'roman': status[0], 'integer': status[1]}
|
|
|
|
|
+ pprint(summary)
|
|
|
summary_json = json.dumps(summary, indent=2)
|
|
summary_json = json.dumps(summary, indent=2)
|
|
|
|
|
+ print(summary_json)
|
|
|
write_file = open('status.json', 'w')
|
|
write_file = open('status.json', 'w')
|
|
|
write_file.write(summary_json)
|
|
write_file.write(summary_json)
|
|
|
write_file.close()
|
|
write_file.close()
|