Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for file_element in entries_element.findall('File'):
# Name element
file = File()
file.name = file_element.findtext('Name')
# Properties
properties_element = file_element.find('Properties')
file.properties.content_length = int(properties_element.findtext('Content-Length'))
# Add file to list
entries.append(file)
for directory_element in entries_element.findall('Directory'):
# Name element
directory = Directory()
directory.name = directory_element.findtext('Name')
# Add directory to list
entries.append(directory)
return entries
def _parse_directory(response, name):
if response is None:
return None
metadata = _parse_metadata(response)
props = _parse_properties(response, DirectoryProperties)
return Directory(name, props, metadata)