Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def show(self, width=None):
"""Inserts markup that displays each element in the list as an image.
Takes an optional keyword argument width.
"""
output = ''
for element in sorted(self.elements):
if element.ok:
new_image = element.show(width=width)
if isinstance(new_image, InlineImage) or isinstance(new_image, Subdoc):
return new_image
output += new_image
return output
def path(self):
def show(self, **kwargs):
"""Inserts markup that displays each part of the file collection as an
image or link.
"""
the_files = [getattr(self, ext).show(**kwargs) for ext in self._extension_list() if hasattr(self, ext)]
for the_file in the_files:
if isinstance(the_file, InlineImage) or isinstance(the_file, Subdoc):
return the_file
return u' '.join(the_files)
def __str__(self):