From a59978ec5ba6fc740331747b66e470b01a10df60 Mon Sep 17 00:00:00 2001 From: alpcentaur Date: Tue, 23 Jan 2024 18:00:24 +0100 Subject: [PATCH] added first updaterooms all command syntax change instead of only updaterooms updating all rooms --- fdb_spider_interface.py | 10 +++++++--- new_message_file.txt | 2 +- roomhistories/65afd8b77954218b501634f2.txt | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fdb_spider_interface.py b/fdb_spider_interface.py index 901d543..0d91e3b 100644 --- a/fdb_spider_interface.py +++ b/fdb_spider_interface.py @@ -406,7 +406,7 @@ if __name__ == '__main__': command : `printfdbs` ----------------------------------------------------------------------------------------- To update all rooms use - command : `updaterooms` + command : `updaterooms all` ----------------------------------------------------------------------------------------- To update one room use the room_id from the output of printrooms: command : `updaterooms ` @@ -488,7 +488,7 @@ if __name__ == '__main__': data = dict({}) for room in room_list: - if room[0] == room_to_update or room_to_update == 'NONE': + if room[0] == room_to_update or room_to_update == 'all': room_was_found = True print(room[0]) room_fdbs = room[2] @@ -549,7 +549,11 @@ if __name__ == '__main__': print('oioioioioiOIOIOI') for key in data[room_fdb][i]: contains_tag = False - period_data_formatted = dateutil.parser.parse(data[room_fdb][i][key]["period"]) + try: + period_data_formatted = dateutil.parser.parse(data[room_fdb][i][key]["period"]) + except Exception as e: + period_data_formatted = 'NONE' + print('getting the period did not work for', room_fdb, i, key, ' ori err is:', e) name_data_lower = [word.lower() for word in data[room_fdb][i][key]["name"].split(' ')] info_data_lower = [word.lower() for word in data[room_fdb][i][key]["info"].split(' ')] text_data_lower = [word.lower() for word in data[room_fdb][i][key]["text"].split(' ')] diff --git a/new_message_file.txt b/new_message_file.txt index 0c858c8..5b52fb8 100644 --- a/new_message_file.txt +++ b/new_message_file.txt @@ -1 +1 @@ -updaterooms 65afd8b77954218b501634f2§%§%Z4SCmA6Ydbs7YHHHo \ No newline at end of file +updaterooms 65afd8b77954218b501634f2§%§%uBPGeQtsNmy3wvSga \ No newline at end of file diff --git a/roomhistories/65afd8b77954218b501634f2.txt b/roomhistories/65afd8b77954218b501634f2.txt index e69de29..47a19ba 100644 --- a/roomhistories/65afd8b77954218b501634f2.txt +++ b/roomhistories/65afd8b77954218b501634f2.txt @@ -0,0 +1,2 @@ + +