Commit e54124d4 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Preparation of erp5_base migration from FS: Fix pylint redefined-builtin warnings.

parent 080dafd0
...@@ -189,9 +189,9 @@ class Image(TextConvertableMixin, File, OFSImage): ...@@ -189,9 +189,9 @@ class Image(TextConvertableMixin, File, OFSImage):
id_list = list(DEFAULT_DISPLAY_ID_LIST) id_list = list(DEFAULT_DISPLAY_ID_LIST)
# Exclude specified displays # Exclude specified displays
if exclude: if exclude:
for id in exclude: for id_ in exclude:
if id in id_list: if id_ in id_list:
id_list.remove(id) id_list.remove(id_)
# Sort by desired photo surface area # Sort by desired photo surface area
def getSurfaceArea(img): def getSurfaceArea(img):
x, y = self.getSizeFromImageDisplay(img) x, y = self.getSizeFromImageDisplay(img)
...@@ -214,22 +214,22 @@ class Image(TextConvertableMixin, File, OFSImage): ...@@ -214,22 +214,22 @@ class Image(TextConvertableMixin, File, OFSImage):
displays = [] displays = []
if quality is _MARKER: if quality is _MARKER:
quality = self.getDefaultImageQuality(format) quality = self.getDefaultImageQuality(format)
for id in self.displayIds(exclude): for id_ in self.displayIds(exclude):
if self._isGenerated(id, format=format, quality=quality,\ if self._isGenerated(id_, format=format, quality=quality,\
resolution=resolution): resolution=resolution):
photo_width = self._photos[(id,format)].width photo_width = self._photos[(id_,format)].width
photo_height = self._photos[(id,format)].height photo_height = self._photos[(id_,format)].height
bytes = self._photos[(id,format)]._size() bytes_ = self._photos[(id_,format)]._size()
age = self._photos[(id,format)]._age() age = self._photos[(id_,format)]._age()
else: else:
(photo_width, photo_height, bytes, age) = (None, None, None, None) (photo_width, photo_height, bytes_, age) = (None, None, None, None)
image_size = self.getSizeFromImageDisplay(id) image_size = self.getSizeFromImageDisplay(id_)
displays.append({'id': id, displays.append({'id': id_,
'width': image_size[0], 'width': image_size[0],
'height': image_size[1], 'height': image_size[1],
'photo_width': photo_width, 'photo_width': photo_width,
'photo_height': photo_height, 'photo_height': photo_height,
'bytes': bytes, 'bytes': bytes_,
'age': age 'age': age
}) })
return displays return displays
...@@ -397,8 +397,8 @@ class Image(TextConvertableMixin, File, OFSImage): ...@@ -397,8 +397,8 @@ class Image(TextConvertableMixin, File, OFSImage):
quality = self.getDefaultImageQuality(format) quality = self.getDefaultImageQuality(format)
width, height = image_size width, height = image_size
base, ext = splitext(self.id) base, ext = splitext(self.id)
id = '%s_%s_%s.%s'% (base, width, height, ext,) id_ = '%s_%s_%s.%s'% (base, width, height, ext,)
image = OFSImage(id, self.getTitle(), image = OFSImage(id_, self.getTitle(),
self._getDisplayData(format, quality, resolution, self._getDisplayData(format, quality, resolution,
frame, image_size, frame, image_size,
crop)) crop))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment