From 9e6e294491fda23218bdbd9fad3fae3606887abf Mon Sep 17 00:00:00 2001 From: Homer S Date: Thu, 1 Jul 2021 20:44:29 +0200 Subject: [PATCH] Fixed https://git.ismus.net/homer77/FritzAB2Matrix/issues/4 by appending a single message to list. --- fritzab2matrix.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fritzab2matrix.py b/fritzab2matrix.py index 7b9244f..88b8722 100755 --- a/fritzab2matrix.py +++ b/fritzab2matrix.py @@ -64,10 +64,16 @@ def fritzab2matrix(): return messages l = get_message_list(message_list_url) - if l['Root'] == None: + if l['Root'] == None or l['Root']['Message'] == None: 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 msg_info = a['Date'] + " - " + a['Number'] @@ -139,5 +145,3 @@ if __name__ == "__main__": - -