Fixed #4 by appending a single message to list.

This commit is contained in:
Homer S. 2021-07-01 20:44:29 +02:00
parent 57243129a3
commit 9e6e294491
1 changed files with 8 additions and 4 deletions

View File

@ -64,10 +64,16 @@ def fritzab2matrix():
return messages return messages
l = get_message_list(message_list_url) l = get_message_list(message_list_url)
if l['Root'] == None: if l['Root'] == None or l['Root']['Message'] == None:
return False return False
else:
messages = l['Root']['Message']
if type(messages) is not list:
m = []
m.append(messages)
messages = m
for a in l['Root']['Message']: for a in messages:
# format the information regarding the message # format the information regarding the message
msg_info = a['Date'] + " - " + a['Number'] msg_info = a['Date'] + " - " + a['Number']
@ -139,5 +145,3 @@ if __name__ == "__main__":