Itterate through list

main
Bob Mottram 2021-07-18 20:08:17 +01:00
parent b89c2b7dcd
commit 8c8c279cd0
1 changed files with 3 additions and 1 deletions

View File

@ -2567,6 +2567,8 @@ def validUrlPrefix(url: str) -> bool:
def getActorLanguagesList(actorJson: {}) -> []: def getActorLanguagesList(actorJson: {}) -> []:
"""Returns a list containing languages used by the given actor """Returns a list containing languages used by the given actor
""" """
if not actorJson.get('attachment'):
return []
for propertyValue in actorJson['attachment']: for propertyValue in actorJson['attachment']:
if not propertyValue.get('name'): if not propertyValue.get('name'):
continue continue
@ -2591,7 +2593,7 @@ def getActorLanguages(actorJson: {}) -> str:
if not langList: if not langList:
return '' return ''
languagesStr = '' languagesStr = ''
for lang in languagesStr: for lang in langList:
if languagesStr: if languagesStr:
languagesStr += ' / ' + lang languagesStr += ' / ' + lang
else: else: