Beispiel #1
0
 def __delitem__(self, i):
     location = None
     try:
         location = self.value.__getitem__(i)
     except Exception:
         return self.value.__delitem__(i)
     store.delete_image_from_backend(self.image_proxy.context,
                                     self.image_proxy.store_api,
                                     self.image_proxy.image.image_id,
                                     location['url'])
     self.value.__delitem__(i)
Beispiel #2
0
 def pop(self, i=-1):
     location = self.value.pop(i)
     try:
         store.delete_image_from_backend(self.image_proxy.context,
                                         self.image_proxy.store_api,
                                         self.image_proxy.image.image_id,
                                         location['url'])
     except Exception:
         with excutils.save_and_reraise_exception():
             self.value.insert(i, location)
     return location
Beispiel #3
0
 def __delslice__(self, i, j):
     i = max(i, 0)
     j = max(j, 0)
     locations = []
     try:
         locations = self.value.__getslice__(i, j)
     except Exception:
         return self.value.__delslice__(i, j)
     for location in locations:
         store.delete_image_from_backend(self.image_proxy.context,
                                         self.image_proxy.store_api,
                                         self.image_proxy.image.image_id,
                                         location['url'])
         self.value.__delitem__(i)