a['Name'] doesn't get an empty string but type None. So a check for its length led to a failure.
This commit is contained in:
parent
2f827d594c
commit
8c79991ae7
|
@ -42,6 +42,7 @@ def main():
|
||||||
message_list_url = message_list['NewURL']
|
message_list_url = message_list['NewURL']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Build the url to download the message via smb
|
# Build the url to download the message via smb
|
||||||
def build_download_url(mid, tam=0):
|
def build_download_url(mid, tam=0):
|
||||||
recording = "rec." + str(tam) + r"." + str(mid).zfill(3)
|
recording = "rec." + str(tam) + r"." + str(mid).zfill(3)
|
||||||
|
@ -62,12 +63,13 @@ def main():
|
||||||
messages = xmltodict.parse(doc)
|
messages = xmltodict.parse(doc)
|
||||||
return messages
|
return messages
|
||||||
|
|
||||||
|
l = get_message_list(message_list_url)
|
||||||
|
|
||||||
for a in get_message_list(message_list_url)['Root']['Message']:
|
for a in l['Root']['Message']:
|
||||||
|
|
||||||
# format the information regarding the message
|
# format the information regarding the message
|
||||||
msg_info = a['Date'] + " - " + a['Number']
|
msg_info = a['Date'] + " - " + a['Number']
|
||||||
if len(a['Name']) > 1:
|
if a['Name']:
|
||||||
msg_info += " (" + a['Name'] + ") "
|
msg_info += " (" + a['Name'] + ") "
|
||||||
|
|
||||||
# format the string for sound file's meta information
|
# format the string for sound file's meta information
|
||||||
|
|
Loading…
Reference in New Issue