Mine
public text v1 · immutable def sizes(self):
"""return image sizes"""
sizes = { 'default': self.default_size,
'thumbnail': self.thumbnail }
for option, value in self.env.config.options('ticket-image'):
if option.startswith('size.'):
sizes[option.split('.', 1)[-1]] = value
for size in sizes:
try:
dimension = [ i.strip() and int(i) or None for i in sizes[size].split('x') ]
except ValueError:
sizes.pop(size)
continue
sizes[size] = dimension
return sizes